Custom tool-use components for the built-in tools.
Register these in the :tool_components map passed to init_session/2
so that content_block/1 dispatches to them instead of the default
tool_use/1 renderer:
init_session(socket,
tool_components: %{
"files" => &Omni.UI.ToolsUI.files_tool_use/1,
"repl" => &Omni.UI.ToolsUI.repl_tool_use/1
},
...
)Omni.UI.AgentLive registers both by default.
Summary
Functions
Renders a ToolUse content block for the files tool.
Renders a ToolUse content block for the REPL tool.
Functions
Renders a ToolUse content block for the files tool.
Delegates to Omni.UI.ChatUI.tool_use/1 and fills its :aside slot
with command-specific content. Receives the normalised tool-use assigns
map from content_block/1: @tool_use, @tool_result, @streaming.
Attributes
tool_use(Omni.Content.ToolUse) (required)tool_result(Omni.Content.ToolResult) - Defaults tonil.streaming(:boolean) - Defaults tofalse.
Renders a ToolUse content block for the REPL tool.
Receives the normalised tool-use assigns map from content_block/1:
@tool_use, @tool_result, @streaming.
Attributes
tool_use(Omni.Content.ToolUse) (required)tool_result(Omni.Content.ToolResult) - Defaults tonil.streaming(:boolean) - Defaults tofalse.