View Source LangChain.ChatModels.ChatMistralAI (LangChain v0.4.0-rc.1)
Summary
Functions
Calls the Mistral API passing the ChatMistralAI struct plus either a simple string prompt or a list of messages as the prompt. Optionally pass in a list of tools.
Converts a LangChain Message-based structure into the expected map of data for
Mistral. We also include any tool_calls
stored on the message.
Formats this struct plus the given messages and tools as a request payload.
Restores the model from the config map.
Generate a config map that can later restore the model's configuration.
Types
@type t() :: %LangChain.ChatModels.ChatMistralAI{ api_key: term(), callbacks: term(), endpoint: term(), json_response: term(), json_schema: term(), max_tokens: term(), model: term(), random_seed: term(), receive_timeout: term(), safe_prompt: term(), stream: term(), temperature: term(), tool_choice: term(), top_p: term() }
Functions
Calls the Mistral API passing the ChatMistralAI struct plus either a simple string prompt or a list of messages as the prompt. Optionally pass in a list of tools.
@spec for_api( struct(), LangChain.Message.t() | LangChain.Message.ContentPart.t() | LangChain.Message.ToolCall.t() | LangChain.Message.ToolResult.t() | LangChain.Function.t() ) :: %{required(String.t()) => any()} | [%{required(String.t()) => any()}]
Converts a LangChain Message-based structure into the expected map of data for
Mistral. We also include any tool_calls
stored on the message.
@spec for_api(t(), [LangChain.Message.t()], LangChain.ChatModels.ChatModel.tools()) :: %{ required(atom()) => any() }
Formats this struct plus the given messages and tools as a request payload.
@spec new(attrs :: map()) :: {:ok, t()} | {:error, Ecto.Changeset.t()}
Restores the model from the config map.
Generate a config map that can later restore the model's configuration.