Skip to content

Returning BaseModel types from tool calls #3083

@ken-iks

Description

@ken-iks

Question

Take an example like this:

class Foo(BaseModel):
    """Some important info"""
    something: str
    something_else: int
    something_else2: str

@agent.tool
def some_tool() -> Foo:
    #do something that returns Foo type

I am curious if the model has access to the docstring of the Foo type which is being returned from the tool? Or if it only receives docstrings for pydantic types that will be parameters to tool calls (as well as the tool docstrings themselves). Thanks!

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions