Imp.Adapter.Types.ToolCall (Imp v0.5.0)

Copy Markdown View Source

Provider-native tool call value with stable id, name, and arguments.

from_map/1 accepts the OpenAI wire shape (%{"function" => %{"name", "arguments"}}) and a flat map. In a flat map the name may be spelled name, recipient_name or tool, and the arguments arguments, args or parameters, with atom or string keys. The spellings are here rather than at each call site: tool/arguments is what a model emits when it writes a tool call as JSON prose instead of calling natively, which is what Imp.Predict.ReActV2 then has to execute.

Summary

Functions

format(call)

from_map(call)

new(name, arguments \\ %{}, opts \\ [])