Skip to content

Change the docstring for the transfer_to_agent tool to remove unneeded information sent to the model. #4615

@slilichenko

Description

@slilichenko

The tool's docstring includes notes to developers. This docstring is sent on every invocation to the model, consuming input tokens and increasing chances of hallucinations. Example of the tool description sent to the model:

description: "Transfer the question to another agent. This tool hands off control to another agent when it's more suitable to answer the user's question according to the agent's description. Note: For most use cases, you should use TransferToAgentTool instead of this function directly. TransferToAgentTool provides additional enum constraints that prevent LLMs from hallucinating invalid agent names. Args: agent_name: the agent name to transfer to. "
name: "transfer_to_agent"

Metadata

Metadata

Assignees

No one assigned

    Labels

    core[Component] This issue is related to the core interface and implementation

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions