diff --git a/README.md b/README.md index abc7467..e31931a 100644 --- a/README.md +++ b/README.md @@ -174,18 +174,19 @@ ollama.show(request) - `options` ``: (Optional) Options to configure the runtime. - Returns: `` -### embeddings +### embed ```javascript -ollama.embeddings(request) +ollama.embed(request) ``` - `request` ``: The request object containing embedding parameters. - `model` `` The name of the model used to generate the embeddings. - - `prompt` ``: The prompt used to generate the embedding. + - `input` ` | `: The input used to generate the embedding. + - `truncate` ``: (Optional) Truncate the input to fit the maximum context length supported by the model. - `keep_alive` ``: (Optional) How long to keep the model loaded. - `options` ``: (Optional) Options to configure the runtime. -- Returns: `` +- Returns: `` ### ps diff --git a/src/browser.ts b/src/browser.ts index 40ba369..d83e25e 100644 --- a/src/browser.ts +++ b/src/browser.ts @@ -286,6 +286,7 @@ async encodeImage(image: Uint8Array | string): Promise { /** * Embeds a text prompt into a vector. + * @deprecated Use the `embed` method instead. * @param request {EmbeddingsRequest} - The request object. * @returns {Promise} - The response object. */ diff --git a/src/interfaces.ts b/src/interfaces.ts index c05763c..a9d5d4c 100644 --- a/src/interfaces.ts +++ b/src/interfaces.ts @@ -119,6 +119,9 @@ export interface EmbedRequest { options?: Partial } +/** + * @deprecated Use the EmbedRequest interface with the embed() method instead. + */ export interface EmbeddingsRequest { model: string prompt: string @@ -163,6 +166,9 @@ export interface EmbedResponse { embeddings: number[][] } +/** + * @deprecated Use the embed() method with the EmbedResponse instead. + */ export interface EmbeddingsResponse { embedding: number[] }