Builds ReqLLM.Tool structs and callbacks from AshAi.Tool DSL entities.
This module is responsible for converting AshAi tool definitions into the format expected by ReqLLM, including generating the parameter schema and creating the callback function that executes the tool.
Summary
Functions
Builds a ReqLLM.Tool struct and callback function from an AshAi.Tool definition.
Functions
Builds a ReqLLM.Tool struct and callback function from an AshAi.Tool definition.
Returns a tuple of {ReqLLM.Tool, callback_fn} where:
ReqLLM.Toolcontains the tool schema for the LLMcallback_fnis a function/2 that takes (arguments, context) and executes the Ash action
Example
{tool, callback} = AshAi.Tool.Builder.build(tool_def)
result = callback.(%{"input" => %{"name" => "foo"}}, %{actor: current_user})