mistral_common.protocol.embedding.response
EmbeddingObject(**data)
Bases: MistralBase
Embedding object returned by the API.
Attributes:
Name | Type | Description |
---|---|---|
object |
str
|
The type of the object returned. |
embedding |
List[float]
|
The embedding vector. |
index |
int
|
The index of the embedding in the input text. |
Examples:
>>> embedding_object = EmbeddingObject(
... object="embedding",
... embedding=[0.1, 0.2, 0.3],
... index=0
... )
Source code in .venv/lib/python3.13/site-packages/pydantic/main.py
EmbeddingResponse(**data)
Bases: MistralBase
"Embedding response returned by the API.
See the EmbeddingRequest for the request body.
Attributes:
Name | Type | Description |
---|---|---|
id |
str
|
The ID of the embedding. |
object |
str
|
The type of the object returned. |
data |
List[EmbeddingObject]
|
List of embeddings. |
model |
str
|
The model used to generate the embeddings. |
Examples:
>>> response = EmbeddingResponse(
... id="embd-123",
... object="list",
... data=[],
... model="text-embedding-ada-002",
... usage=UsageInfo(prompt_tokens=1, total_tokens=1, completion_tokens=0)
... )