Comparing version 3.1.0 to 3.2.0
@@ -7,2 +7,3 @@ import * as models from './models'; | ||
chooseBest(model: string, config: models.chooseBest): Promise<models.cohereResponse<models.scores>>; | ||
extract(model: string, config: models.extract): Promise<models.cohereResponse<models.extraction[]>>; | ||
} | ||
@@ -33,4 +34,8 @@ declare class Cohere implements CohereService { | ||
classify(model: string, config: models.classify): Promise<models.cohereResponse<models.classifications>>; | ||
/** | ||
* Extract text from texts, with examples | ||
*/ | ||
extract(model: string, config: models.extract): Promise<models.cohereResponse<models.extraction[]>>; | ||
} | ||
declare const cohere: Cohere; | ||
export = cohere; |
@@ -40,2 +40,3 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
ENDPOINT["CLASSIFY"] = "/classify"; | ||
ENDPOINT["EXTRACT"] = "/extract"; | ||
})(ENDPOINT || (ENDPOINT = {})); | ||
@@ -108,2 +109,8 @@ var COHERE_EMBED_BATCH_SIZE = 5; | ||
}; | ||
/** | ||
* Extract text from texts, with examples | ||
*/ | ||
Cohere.prototype.extract = function (model, config) { | ||
return this.makeRequest(model, ENDPOINT.EXTRACT, config); | ||
}; | ||
return Cohere; | ||
@@ -110,0 +117,0 @@ }()); |
@@ -75,3 +75,3 @@ export interface cohereResponse<T> { | ||
export type cohereParameters = generate | embed | chooseBest | classify; | ||
export type cohereParameters = generate | embed | chooseBest | classify | extract; | ||
@@ -141,2 +141,22 @@ /* -- responses -- */ | ||
export interface extraction { | ||
id: string; | ||
text: string; | ||
entities: extractEntity[]; | ||
} | ||
export interface extractEntity { | ||
type: string; | ||
value: string; | ||
} | ||
export interface extractExample { | ||
text: string; | ||
entities: extractEntity[]; | ||
} | ||
export interface extract { | ||
examples: extractExample[]; | ||
texts: string[]; | ||
} | ||
export interface error { | ||
@@ -143,0 +163,0 @@ /** Text explaining what went wrong. */ |
{ | ||
"name": "cohere-ai", | ||
"version": "3.1.0", | ||
"version": "3.2.0", | ||
"description": "A Node.js SDK with TypeScript support for the Cohere API.", | ||
@@ -5,0 +5,0 @@ "homepage": "https://docs.cohere.ai", |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
38348
480
1