Find answers from the community

Updated 3 days ago

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?
L
F
4 comments
Use the python Annotated type to give descriptions
(Assuming you are using a recent version of llama-imdex, it should work fine)
thats what i was looking for
thanks πŸ‘
Add a reply
Sign up and join the conversation on Discord