pip install mistralai and configure your Mistral AI credentials, as described in the Working with Mistral AI tutorial.
View source on GitHub
udf chat_completions()
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(Json | None): Additional keyword args for the Mistralchat/completionsAPI. 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:
udf embeddings()
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 toinput.
udf fim_completions()
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(Json | None): Additional keyword args for the Mistralfim/completionsAPI. 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: