Skip to content

Latest commit

 

History

History
61 lines (41 loc) · 5.19 KB

README.md

File metadata and controls

61 lines (41 loc) · 5.19 KB

Embeddings

(embeddings)

Overview

OpenAI's API embeddings v1 endpoint

Available Operations

create

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.

Returns

  • Ok(Response) - The embeddings response from the processing node
  • Err(AtomaProxyError) - An error status code if any step fails

Errors

  • INTERNAL_SERVER_ERROR - Processing or node communication failures

Example Usage

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)

Parameters

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.

Response

models.CreateEmbeddingResponse

Errors

Error Type Status Code Content Type
models.APIError 4XX, 5XX */*