Documentation Index
Fetch the complete documentation index at: https://docs.pipecat.ai/llms.txt
Use this file to discover all available pages before exploring further.
@tool
Mark an agent method as an LLM tool. OnLLMAgent subclasses, decorated methods are automatically registered with the LLM and included in build_tools().
On FlowsAgent subclasses, decorated methods are automatically collected as global functions available at every flow node.
Parameters
Whether to cancel this tool call when an interruption occurs. Only applies to
LLMAgent tools.Timeout in seconds for this tool call. Defaults to
None (uses the LLM
service default).Method Signature
Tool methods receive the LLM function call parameters object as their first argument (afterself), followed by the tool’s declared parameters:
Tool methods must call
params.result_callback() to return a result to the
LLM. The method signature (parameter names, types, and docstring) is
automatically used to generate the tool schema.@task
Mark an agent method as a task handler. Decorated methods are automatically collected byBaseAgent at initialization and dispatched when matching task requests arrive. Each request runs in its own asyncio task so the bus message loop is never blocked.
name argument:
Parameters
Task name to match. The handler only receives requests with a matching name.
When
True, requests with this name run one at a time in FIFO order.
Concurrent requests wait for the previous one to finish before running. When
False (the default), multiple requests run concurrently. The wait time
counts against the requester’s timeout, so a slow predecessor can cause queued
requests to time out before they start.Method Signature
Task handler methods receive aBusTaskRequestMessage:
@agent_ready
Mark a method as a handler for a specific agent becoming ready. Decorated methods are automatically collected byBaseAgent at initialization. When on_ready fires, the agent calls watch_agent for each decorated handler. When the watched agent registers, the decorated method is called.
Parameters
The name of the agent to watch.
Method Signature
Agent-ready handler methods receive anAgentReadyData instance: