Skip to main content

manual_timeout

Decorator to mark a function as having manual timeout handling. Use this decorator on toolkit methods that manage their own timeout logic internally but don’t have a timeout parameter in their signature. This prevents the automatic with_timeout wrapper from being applied by BaseToolkit. Parameters:
  • func (F): The function to mark as having manual timeout handling.
Returns: F: The same function with _manual_timeout attribute set to True.

BaseToolkit

Base class for toolkits. Parameters:
  • timeout (Optional[float]): The timeout for the toolkit.

init

init_subclass

get_tools

Returns: List[FunctionTool]: A list of FunctionTool objects representing the functions in the toolkit.

run_mcp_server

Run the MCP server in the specified mode. Parameters:
  • mode (Literal["stdio", "sse", "streamable-http"]): The mode to run the MCP server in.

RegisteredAgentToolkit

Mixin class for toolkits that need to register a ChatAgent. This mixin provides a standard interface for toolkits that require a reference to a ChatAgent instance. The ChatAgent will check if a toolkit has this mixin and automatically register itself.

init

agent

Returns: Optional[ChatAgent]: The registered agent, or None if not registered. Note: If None is returned, it means the toolkit has not been registered with a ChatAgent yet. Make sure to pass this toolkit to a ChatAgent via the toolkits parameter during initialization.

register_agent

Register a ChatAgent with this toolkit. This method allows registering an agent after initialization. The ChatAgent will automatically call this method if the toolkit to register inherits from RegisteredAgentToolkit. Parameters:
  • agent (ChatAgent): The ChatAgent instance to register.