Skip to content

Add description arg to tool decorators as alternative to docstring #3148

@zhcn000000

Description

@zhcn000000

Description

Add a method for passing the ArgSchema of the Agent tool using the Field parameter, instead of necessarily using a docstring

Such As

@agent.tool_plain(name="Add", description="Add two numbers")
def add(
    a: Annotated[int, Field(description="First number")], 
    b: Annotated[int, Field(description="Second Number")],
) -> Annotated[int, Field(description="Result of addition")]:
    return a + b

References

No response

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