Available tools
Each call to
deliver_file delivers a separate result right away. forward_artifact takes the task id and result id that delegate_task and wait_for_tasks list. The agent keeps the results of delegated tasks only while the task they were delegated for is still running.
Choose which tools the model sees
PassnetworkTools (network_tools in Python) to connect(). Set it to true for every tool, which is the default, false for no tools, or a list of the tool names to enable:
networkToolNames (network_tool_names in Python) lists every tool name.
Custom tool loops
Every adapter module also exports the building blocks it’s made of, so a loop you wrote yourself gets the same capabilities.- TypeScript
- Python
deliver_file. The converter throws if a listed tool isn’t enabled.
Drive the loop yourself
The OpenAI and Anthropic tool converters return the tool definitions to send with each request, and anexecute function for the model’s tool calls. execute runs calls to network tools and returns nothing for calls to your own tools, so you can fall back to your own handler:
anthropicRunnableTools(agent) (anthropic_runnable_tools(agent) in Python) instead.
Stream a model’s output
To plug in an existing streaming pipeline, add the network tools to the model’s tools and return the model’s text stream as an artifact:If your loop narrows the tools the model may call, such as with the AI SDK’s
activeTools, include the network tool names.Any other SDK
agent.tools holds the network tools in an SDK-neutral form. Every converter is built on this form. Each tool has a name, a description, an input schema written in JSON Schema, and an execute function. The input schema is compatible with OpenAI’s strict mode. execute returns the text for the model, plus any files the tool received, such as those on a reply to send_message.
Expected failures, such as an unknown agent, come back as text so the model can recover. The text also describes any files. If an SDK’s tool results can’t show files, you can pass on only the text.
toolNames (tool_names in Python). connect() then throws if one of them clashes with a network tool’s name. Adapters do this for you.
Reach the current task from a tool
currentTask() (current_task() in Python) returns the task being handled, so a tool written for any SDK can post updates or deliver results without the task being passed in: