Translates between the provider-neutral wire format (used by the Norns orchestrator) and ReqLLM's types.
Neutral format
Messages:
%{"role" => "user", "content" => "text"}%{"role" => "assistant", "content" => "text", "tool_calls" => [%{"id" => ..., "name" => ..., "arguments" => ...}]}%{"role" => "tool", "tool_call_id" => "tc_1", "name" => "search", "content" => "result"}
Tool definitions:
%{"name" => "search", "description" => "...", "parameters" => %{...}}
Finish reasons: "stop", "tool_call", "length", "error"
Summary
Functions
Convert an Anthropic API response body to neutral format.
Convert a ReqLLM Response to neutral wire format.
Normalize a model string to ReqLLM's provider:model format.
Convert neutral-format messages to Anthropic API format.
Convert neutral tool definitions to Anthropic format.
Convert neutral-format messages to a ReqLLM Context.
Convert neutral tool definitions to ReqLLM Tool structs.
Functions
Convert an Anthropic API response body to neutral format.
@spec from_req_llm_response(ReqLLM.Response.t()) :: map()
Convert a ReqLLM Response to neutral wire format.
Normalize a model string to ReqLLM's provider:model format.
If the string already contains a colon, it's passed through. Otherwise, infers the provider from the model name (claude → anthropic, gpt/o1/o3 → openai, gemini → google).
Convert neutral-format messages to Anthropic API format.
Convert neutral tool definitions to Anthropic format.
@spec to_req_llm_context([map()]) :: ReqLLM.Context.t()
Convert neutral-format messages to a ReqLLM Context.
@spec to_req_llm_tools([map()]) :: [ReqLLM.Tool.t()]
Convert neutral tool definitions to ReqLLM Tool structs.