(embeddings)
OpenAI's API embeddings v1 endpoint
- create - Create embeddings
This endpoint follows the OpenAI API format for generating vector embeddings from input text. The handler receives pre-processed metadata from middleware and forwards the request to the selected node.
Ok(Response)
- The embeddings response from the processing nodeErr(AtomaProxyError)
- An error status code if any step fails
INTERNAL_SERVER_ERROR
- Processing or node communication failures
from atoma_sdk import AtomaSDK
import os
with AtomaSDK(
bearer_auth=os.getenv("ATOMASDK_BEARER_AUTH", ""),
) as atoma_sdk:
res = atoma_sdk.embeddings.create(input_="The quick brown fox jumped over the lazy dog", model="intfloat/multilingual-e5-large-instruct", encoding_format="float", user="user-1234")
# Handle response
print(res)
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
input |
models.EmbeddingInput | ✔️ | N/A | |
model |
str | ✔️ | ID of the model to use. | intfloat/multilingual-e5-large-instruct |
dimensions |
OptionalNullable[int] | ➖ | The number of dimensions the resulting output embeddings should have. | |
encoding_format |
OptionalNullable[str] | ➖ | The format to return the embeddings in. Can be "float" or "base64". Defaults to "float" |
float |
user |
OptionalNullable[str] | ➖ | A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. | user-1234 |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
models.CreateEmbeddingResponse
Error Type | Status Code | Content Type |
---|---|---|
models.APIError | 4XX, 5XX | */* |