Packages

Generative AI Wrapper: access multiple apis through single standardized interface.

Current section

Files

Jump to
genai lib gen_ai provider mistral protocols tool_protocol.ex
Raw

lib/gen_ai/provider/mistral/protocols/tool_protocol.ex

defprotocol GenAI.Provider.Mistral.ToolProtocol do
@moduledoc """
This protocol defines how to transform GenAI tool function structs into a format compatible with the Mistral tool API.
"""
@doc """
Transforms a GenAI tool function struct into a Mistral tool format.
"""
def tool(subject)
end
defimpl GenAI.Provider.Mistral.ToolProtocol, for: GenAI.Tool.Function do
def tool(subject) do
%{type: :function, function: subject}
end
end