From 65fd405bd48d7aaacbad83eb7137863969336d95 Mon Sep 17 00:00:00 2001 From: ishaan-jaff Date: Fri, 26 Jan 2024 13:33:11 -0800 Subject: [PATCH] (docs) dimensions embedding param --- .../docs/embedding/supported_embedding.md | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/docs/my-website/docs/embedding/supported_embedding.md b/docs/my-website/docs/embedding/supported_embedding.md index 735aa01c864..d864c5796c0 100644 --- a/docs/my-website/docs/embedding/supported_embedding.md +++ b/docs/my-website/docs/embedding/supported_embedding.md @@ -13,8 +13,8 @@ response = embedding(model='text-embedding-ada-002', input=["good morning from l - `model`: *string* - ID of the model to use. `model='text-embedding-ada-002'` -- `input`: *array* - Input text to embed, encoded as a string or array of tokens. To embed multiple inputs in a single request, pass an array of strings or array of token arrays. The input must not exceed the max input tokens for the model (8192 tokens for text-embedding-ada-002), cannot be an empty string, and any array must be 2048 dimensions or less. -``` +- `input`: *string or array* - Input text to embed, encoded as a string or array of tokens. To embed multiple inputs in a single request, pass an array of strings or array of token arrays. The input must not exceed the max input tokens for the model (8192 tokens for text-embedding-ada-002), cannot be an empty string, and any array must be 2048 dimensions or less. +```python input=["good morning from litellm"] ``` @@ -22,7 +22,11 @@ input=["good morning from litellm"] - `user`: *string (optional)* A unique identifier representing your end-user, -- `timeout`: *integer* - The maximum time, in seconds, to wait for the API to respond. Defaults to 600 seconds (10 minutes). +- `dimensions`: *integer (Optional)* The number of dimensions the resulting output embeddings should have. Only supported in OpenAI/Azure text-embedding-3 and later models. + +- `encoding_format`: *string (Optional)* The format to return the embeddings in. Can be either `"float"` or `"base64"`. Defaults to `encoding_format="float"` + +- `timeout`: *integer (Optional)* - The maximum time, in seconds, to wait for the API to respond. Defaults to 600 seconds (10 minutes). - `api_base`: *string (optional)* - The api endpoint you want to call the model with @@ -66,7 +70,12 @@ input=["good morning from litellm"] from litellm import embedding import os os.environ['OPENAI_API_KEY'] = "" -response = embedding('text-embedding-ada-002', input=["good morning from litellm"]) +response = embedding( + model="text-embedding-3-small", + input=["good morning from litellm", "this is another item"], + metadata={"anything": "good day"}, + dimensions=5 # Only supported in text-embedding-3 and later models. +) ``` | Model Name | Function Call | Required OS Variables |