pip install mistralai
and configure your Mistral AI credentials, as described in the Working with Mistral AI tutorial.
View source on GitHub
UDFs
chat_completions()
udf
Chat Completion API.
Equivalent to the Mistral AI chat/completions
API endpoint. For additional details, see: https://docs.mistral.ai/api/#tag/chat
Request throttling: Applies the rate limit set in the config (section mistral
, key rate_limit
). If no rate limit is configured, uses a default of 600 RPM.
Requirements:
pip install mistralai
messages
(Json): The prompt(s) to generate completions for.model
(String): ID of the model to use. (See overview here: https://docs.mistral.ai/getting-started/models/)model_kwargs
(Optional[Json]): Additional keyword args for the Mistralchat/completions
API. For details on the available parameters, see: https://docs.mistral.ai/api/#tag/chat
- Json: A dictionary containing the response and other metadata.
mistral-latest-small
to an existing Pixeltable column tbl.prompt
of the table tbl
:
embeddings()
udf
Embeddings API.
Equivalent to the Mistral AI embeddings
API endpoint. For additional details, see: https://docs.mistral.ai/api/#tag/embeddings
Request throttling: Applies the rate limit set in the config (section mistral
, key rate_limit
). If no rate limit is configured, uses a default of 600 RPM.
Requirements:
pip install mistralai
input
(String): Text to embed.model
(String): ID of the model to use. (See overview here: https://docs.mistral.ai/getting-started/models/)
- Array[(None,), Float]: An array representing the application of the given embedding to
input
.
fim_completions()
udf
Fill-in-the-middle Completion API.
Equivalent to the Mistral AI fim/completions
API endpoint. For additional details, see: https://docs.mistral.ai/api/#tag/fim
Request throttling: Applies the rate limit set in the config (section mistral
, key rate_limit
). If no rate limit is configured, uses a default of 600 RPM.
Requirements:
pip install mistralai
prompt
(String): The text/code to complete.model
(String): ID of the model to use. (See overview here: https://docs.mistral.ai/getting-started/models/)model_kwargs
(Optional[Json]): Additional keyword args for the Mistralfim/completions
API. For details on the available parameters, see: https://docs.mistral.ai/api/#tag/fim
- Json: A dictionary containing the response and other metadata.
codestral-latest
to an existing Pixeltable column tbl.prompt
of the table tbl
: