New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

apollo-ai-api-client

Package Overview
Dependencies
Maintainers
3
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

apollo-ai-api-client - npm Package Compare versions

Comparing version 0.1.6 to 0.1.8

19

lib/apollo.ai/ApolloAiClient.d.ts

@@ -9,6 +9,25 @@ export interface IAutoAbstractResponse {

}
export interface IClusteringResponse {
status: number;
message: string;
data: IClusteringArticle[][];
}
export interface IClusteringArticle {
identifier: string;
title: string;
content: string;
link?: string;
publication_date?: string;
image?: string;
}
export declare enum ClusteringLanguage {
en = "en",
de = "de"
}
export declare class ApolloAiClient {
protected apiKey: string;
apolloApiEndpoint: string;
constructor(apiKey: string);
autoabstract(headline: string, text: string, maxCharacters?: number, keywords?: string[]): Promise<IAutoAbstractResponse>;
clustering(articles: IClusteringArticle[], threshold?: number, language?: ClusteringLanguage): Promise<IClusteringResponse>;
}

29

lib/apollo.ai/ApolloAiClient.js

@@ -12,5 +12,12 @@ "use strict";

const node_fetch_1 = require("node-fetch");
const URL = require("url");
var ClusteringLanguage;
(function (ClusteringLanguage) {
ClusteringLanguage["en"] = "en";
ClusteringLanguage["de"] = "de";
})(ClusteringLanguage = exports.ClusteringLanguage || (exports.ClusteringLanguage = {}));
class ApolloAiClient {
constructor(apiKey) {
this.apiKey = apiKey;
this.apolloApiEndpoint = 'https://api.apollo.ai/';
}

@@ -28,3 +35,3 @@ autoabstract(headline, text, maxCharacters = 400, keywords) {

}
const response = yield node_fetch_1.default('https://api.apollo.ai/autoabstract', {
const response = yield node_fetch_1.default(this.apolloApiEndpoint + 'autoabstract', {
method: 'POST',

@@ -44,4 +51,24 @@ headers: {

}
clustering(articles, threshold = 0.8, language = ClusteringLanguage.de) {
return __awaiter(this, void 0, void 0, function* () {
const url = new URL.URL(this.apolloApiEndpoint + 'clustering');
url.searchParams.append('threshold', threshold.toString());
url.searchParams.append('language', language);
console.log('Requesting: ' + url.toString());
const collectionResult = yield node_fetch_1.default(url.toString(), {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'Authorization': 'Bearer ' + this.apiKey,
},
body: JSON.stringify(articles),
timeout: 300000,
});
const clusterResult = yield collectionResult.json();
return clusterResult;
});
}
}
exports.ApolloAiClient = ApolloAiClient;
//# sourceMappingURL=ApolloAiClient.js.map

16

package.json
{
"name": "apollo-ai-api-client",
"version": "0.1.6",
"version": "0.1.8",
"description": "Client for the apollo.ai auto abstract api.",
"keywords": ["api client", "text processing", "auto abstract"],
"keywords": [
"api client",
"text processing",
"auto abstract"
],
"homepage": "https://www.apollo.ai",
"author": "APOLLO.AI",
"license": "MIT",
"repository" : {
"type" : "git",
"url" : "https://github.com/IWAtech/apollo.ai-api-client.git"
"repository": {
"type": "git",
"url": "https://github.com/IWAtech/apollo.ai-api-client.git"
},

@@ -21,3 +25,3 @@ "private": false,

"clean": "rm -rf lib",
"lint": "tslint -c tslint.json verbose \"src/**/*.ts\"",
"lint": "tslint -c tslint.json \"src/**/*.ts\"",
"build": "yarn run lint && echo Using TypeScript && tsc --version && tsc --pretty -p ."

@@ -24,0 +28,0 @@ },

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc