An array of embedding vectors. Each inner array (number[]) corresponds
to an input text from the EmbeddingRequest. The order is preserved.
If an error occurred for a specific text in a batch, its corresponding
entry might be missing, or represented by a specific error object if partial
results are supported differently. The errors array should be checked.
[[0.1, 0.2, ...], [0.3, 0.4, ...]]
The ID of the embedding model that was actually used to generate the embeddings. This is important for consistency, especially if model selection was dynamic.
"text-embedding-3-small"
The ID of the LLM provider that was used.
"openai"
Information about token usage and cost for the embedding generation.
Optional inputOptional costUSD?: numberOptional errorsOptional: An array of error objects, relevant if processing a batch of texts
and some individual texts failed. If the entire request failed catastrophically,
the generateEmbeddings method itself should throw an error.
Optional details?: anyerrors: [{ textIndex: 1, message: "Content policy violation", details: { reason: "unsafe_content" } }]
Represents the response from an embedding generation request. This structure includes the generated embeddings, information about the model and provider used, token usage details, and any errors encountered during processing (especially relevant for batch requests).
EmbeddingResponse