Find answers from the community

F
Fremko
Offline, last seen 3 days ago
Joined January 21, 2025
F
Fremko
·

Tools

currently this is what i am using to pass description to tools parameter
Plain Text
from pydantic import Field

def get_weather(
    location: str = Field(default="australia"
        description="A city name and state, formatted like '<name>, <state>'"
    ),
) -> str:
    """Useful for getting the weather for a given location."""
    # Function implementation

tool = FunctionTool.from_defaults(get_weather)


however i would no longer be able to use the default values because they are passed as FieldInfo no the actual default value when i call the function with code, is there any better way?
4 comments
L
F
F
Fremko
·

Docs

it keeps scrolling up to the top every now and then
7 comments
L
F