Skip to content

tool_name and tool_description for Agent#as_tool() method #1174

@subhankaladi

Description

@subhankaladi

In the Agent Class, the name: strproperty is required — that's fine.
The property handoff_description: str | None = None is optional because it accepts both str and None types — this is also fine.

But But But...

def as_tool(
    self,
    tool_name: str | None,
    tool_description: str | None,
    custom_output_extractor: Callable[[RunResult], Awaitable[str]] | None = None,
) -> Tool:

This is a method of the Agent class. Bothtool_name and tool_description are annotated as str | None.
So why does it raise this error?
TypeError: Agent.as_tool() missing 2 required positional arguments: 'tool_name' and 'tool_description'

My mind is getting disturbed because of this issue.
Please help me fix it.
Thank You
Best Regard
SubhanKaladi

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions