apollo-ai-api-client
Advanced tools
Comparing version 0.1.15 to 0.1.16
@@ -41,5 +41,5 @@ export interface IAutoAbstractResponse { | ||
private executeAutoabstract; | ||
autoabstractUrl(url: string, maxCharacters?: number, keywords?: string[], maxSentences?: number): Promise<IAutoAbstractResponse>; | ||
autoabstract(headline: string, text: string, maxCharacters?: number, keywords?: string[], maxSentences?: number): Promise<IAutoAbstractResponse>; | ||
autoabstractUrl(url: string, maxCharacters?: number, keywords?: string[], maxSentences?: number, debug?: boolean): Promise<IAutoAbstractResponse>; | ||
autoabstract(headline: string, text: string, maxCharacters?: number, keywords?: string[], maxSentences?: number, debug?: boolean): Promise<IAutoAbstractResponse>; | ||
clustering(articles: IClusteringArticle[], threshold?: number, language?: ClusteringLanguage): Promise<IClusteringResponse>; | ||
} |
@@ -25,3 +25,3 @@ "use strict"; | ||
} | ||
executeAutoabstract(body) { | ||
executeAutoabstract(body, debug = false) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
@@ -35,3 +35,3 @@ const response = yield node_fetch_1.default(this.apolloApiEndpoint + this.autoAbstractEndpoint, { | ||
}, | ||
body: JSON.stringify(body), | ||
body: JSON.stringify(Object.assign({ debug }, body)), | ||
}); | ||
@@ -44,7 +44,7 @@ if (response.status !== 200) { | ||
} | ||
autoabstractUrl(url, maxCharacters = 400, keywords, maxSentences) { | ||
autoabstractUrl(url, maxCharacters = 400, keywords, maxSentences, debug) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const body = { | ||
url, | ||
keywords: '', | ||
keywords: keywords ? keywords.join(',') : '', | ||
}; | ||
@@ -57,9 +57,6 @@ if (maxSentences) { | ||
} | ||
if (keywords) { | ||
body.keywords = keywords.join(','); | ||
} | ||
return yield this.executeAutoabstract(body); | ||
return yield this.executeAutoabstract(body, debug); | ||
}); | ||
} | ||
autoabstract(headline, text, maxCharacters = 400, keywords, maxSentences) { | ||
autoabstract(headline, text, maxCharacters = 400, keywords, maxSentences, debug) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
@@ -69,3 +66,3 @@ const body = { | ||
text, | ||
keywords: '', | ||
keywords: keywords ? keywords.join(',') : '', | ||
}; | ||
@@ -78,6 +75,3 @@ if (maxSentences) { | ||
} | ||
if (keywords) { | ||
body.keywords = keywords.join(','); | ||
} | ||
return yield this.executeAutoabstract(body); | ||
return yield this.executeAutoabstract(body, debug); | ||
}); | ||
@@ -84,0 +78,0 @@ } |
{ | ||
"name": "apollo-ai-api-client", | ||
"version": "0.1.15", | ||
"version": "0.1.16", | ||
"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
11083
144