Principle:Mistralai Client python Embedding Response Processing
| Knowledge Sources | |
|---|---|
| Domains | NLP, Embeddings |
| Last Updated | 2026-02-15 14:00 GMT |
Overview
A response extraction pattern that navigates embedding API response structures to retrieve vector representations and usage metadata.
Description
Embedding Response Processing extracts the embedding vectors and metadata from the EmbeddingResponse object returned by the embeddings API. The response contains a data list where each element has an embedding field (the vector as a list of floats) and an index indicating which input it corresponds to. The response also contains usage statistics.
Usage
Use this principle after calling client.embeddings.create() to extract vectors for downstream tasks (search indexing, clustering, similarity computation).
Theoretical Basis
Embedding response structure:
- data: List of EmbeddingResponseData objects, one per input text
- data[i].embedding: List[float] — the dense vector representation
- data[i].index: int — maps back to the input index
- usage: Token consumption for billing and monitoring