Skip to content

Latest commit

 

History

History
52 lines (34 loc) · 2.49 KB

README.md

File metadata and controls

52 lines (34 loc) · 2.49 KB

Embeddings

(embeddings)

Overview

Embeddings API.

Available Operations

create

Embeddings

Example Usage

from mistralai import Mistral
import os

s = Mistral(
    api_key=os.getenv("MISTRAL_API_KEY", ""),
)

res = s.embeddings.create(inputs="<value>", model="Wrangler")

if res is not None:
    # handle response
    pass

Parameters

Parameter Type Required Description
inputs models.Inputs ✔️ Text to embed.
model str ✔️ ID of the model to use.
encoding_format OptionalNullable[str] The format to return the embeddings in.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.EmbeddingResponse

Errors

Error Object Status Code Content Type
models.HTTPValidationError 422 application/json
models.SDKError 4xx-5xx /