To Tool Function • AI Agent SDK

to_tool_function: Convert this handoff to a tool function that can be called by the LLM.

to_tool_function

Method

</div>

This is a method of the Handoff class in the handoff module.

Convert this handoff to a tool function that can be called by the LLM.

Diagram

uses

returns

Agent

Tool: to_tool_function

Result

Signature

python
def to_tool_function(source_agent: 'Agent') -> Callable

Parameters

ParamField Agent

The agent that will be using this handoff

Returns

ResponseField Callable

A callable function that performs the handoff

Uses

  • time.time
  • logger.info
  • HandoffResult
  • on_delegation
  • logger.warning
  • logger.error
  • inspect.Parameter
  • inspect.Signature

Source

View on GitHub

praisonaiagents/agent/handoff.py at line 1053


Related Documentation