Forráskód Böngészése

Revert "mark `embeddings()` method as deprecated in favor of `embed()` (#111)"

This reverts commit 2d31f216a98ce495da36ce5502b55afdc24a7902.
Bruce MacDonald 1 éve
szülő
commit
fdae8fe725
3 módosított fájl, 3 hozzáadás és 10 törlés
  1. 3 3
      README.md
  2. 0 1
      src/browser.ts
  3. 0 6
      src/interfaces.ts

+ 3 - 3
README.md

@@ -175,10 +175,10 @@ ollama.show(request)
   - `options` `<Options>`: (Optional) Options to configure the runtime.
 - Returns: `<ShowResponse>`
 
-### embed
+### embeddings
 
 ```javascript
-ollama.embed(request)
+ollama.embeddings(request)
 ```
 
 - `request` `<Object>`: The request object containing embedding parameters.
@@ -187,7 +187,7 @@ ollama.embed(request)
   - `truncate` `<boolean>`: (Optional) Truncate the input to fit the maximum context length supported by the model.
   - `keep_alive` `<string | number>`: (Optional) How long to keep the model loaded.
   - `options` `<Options>`: (Optional) Options to configure the runtime.
-- Returns: `<EmbedResponse>`
+- Returns: `<EmbeddingsResponse>`
 
 ### ps
 

+ 0 - 1
src/browser.ts

@@ -286,7 +286,6 @@ async encodeImage(image: Uint8Array | string): Promise<string> {
 
   /**
    * Embeds a text prompt into a vector.
-   * @deprecated Use the `embed` method instead.
    * @param request {EmbeddingsRequest} - The request object.
    * @returns {Promise<EmbeddingsResponse>} - The response object.
    */

+ 0 - 6
src/interfaces.ts

@@ -150,9 +150,6 @@ export interface EmbedRequest {
   options?: Partial<Options>
 }
 
-/**
- * @deprecated Use the EmbedRequest interface with the embed() method instead.
- */
 export interface EmbeddingsRequest {
   model: string
   prompt: string
@@ -197,9 +194,6 @@ export interface EmbedResponse {
   embeddings: number[][]
 }
 
-/**
- * @deprecated Use the embed() method with the EmbedResponse instead.
- */
 export interface EmbeddingsResponse {
   embedding: number[]
 }