apollo-ai-api-client
Advanced tools
Comparing version 0.1.16 to 0.1.17
@@ -26,2 +26,10 @@ export interface IAutoAbstractResponse { | ||
} | ||
export interface IArticle { | ||
id: string; | ||
headline?: string; | ||
content: string; | ||
url?: string; | ||
date?: Date; | ||
abstract?: string[]; | ||
} | ||
export interface IAbstractInputBody { | ||
@@ -39,2 +47,3 @@ headline?: string; | ||
clusteringEndpoint: string; | ||
continuedClusteringEndpoint: string; | ||
autoAbstractEndpoint: string; | ||
@@ -46,2 +55,3 @@ constructor(apiKey: string); | ||
clustering(articles: IClusteringArticle[], threshold?: number, language?: ClusteringLanguage): Promise<IClusteringResponse>; | ||
continuedClustering(newArticles: IArticle[] | string[], presentArticles?: IArticle[], abstractMaxChars?: number): Promise<any>; | ||
} |
@@ -23,2 +23,3 @@ "use strict"; | ||
this.clusteringEndpoint = 'clustering'; | ||
this.continuedClusteringEndpoint = 'https://beta.apollo.ai/api/combinedapi'; | ||
this.autoAbstractEndpoint = 'autoabstract'; | ||
@@ -93,4 +94,25 @@ } | ||
} | ||
continuedClustering(newArticles, presentArticles = [], abstractMaxChars = 500) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const url = new URL.URL(this.continuedClusteringEndpoint); | ||
const parameters = { | ||
newArticles, | ||
result: presentArticles, | ||
abstractMaxChars, | ||
}; | ||
const clusteringResult = yield node_fetch_1.default(url.toString(), { | ||
method: 'POST', | ||
headers: { | ||
'Accept': 'application/json', | ||
'Content-Type': 'application/json', | ||
'Authorization': 'Bearer ' + this.apiKey, | ||
}, | ||
body: JSON.stringify(parameters), | ||
timeout: 300000, | ||
}); | ||
return yield clusteringResult.json(); | ||
}); | ||
} | ||
} | ||
exports.ApolloAiClient = ApolloAiClient; | ||
//# sourceMappingURL=ApolloAiClient.js.map |
{ | ||
"name": "apollo-ai-api-client", | ||
"version": "0.1.16", | ||
"version": "0.1.17", | ||
"description": "Client for the apollo.ai auto abstract api.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12936
176