Find answers from the community

Updated 4 months ago

Hello, I'm trying to use Llama-Index

At a glance
The community member is trying to use Llama-Index with a tool call and is wondering if it is possible to annotate the parameter in the function with a description, like def get_temperature(location: Annotated[str, "The location"]) -> Annotated[float, "Degree"]: pass. Another community member suggests using Field from Pydantic to add a description to the parameter, but notes that it may not work for return types, and recommends putting the return type description in the overall function description instead.
Hello, I'm trying to use Llama-Index with tool call. I'm wondering is it possible to annotate the parameter in the function with some description?
like:
Plain Text
def get_temperature(location: Annotated[str, "The location"]) -> Annotated[float, "Degree"]:
    pass
L
1 comment
You can use Field from pydantic

Plain Text
from pydantic.v1 import Field

def get_temperature(location: str = Field(description="a location.") -> str


I don't think it works for return types though. I would put the return type description in the overall function description
Add a reply
Sign up and join the conversation on Discord