-
Notifications
You must be signed in to change notification settings - Fork 19
Closed
Description
import chatlas
def get_weather_forecast(
lat: float, lon: float, location_name: str
) -> dict[str, str]:
"""Get the weather forecast for a location."""
# Mocked weather data for demonstration purposes
return {"temperature_2m": 18, "condition": "Partly Cloudy"}
weather_tool = chatlas.Tool.from_func(get_weather_forecast)
chat = chatlas.ChatOpenAI()
chat.register_tool(weather_tool)
#> Argument of type "Tool" cannot be assigned to parameter "func" of type "((...) -> Any) | ((...) -> Awaitable[Any])" in function "register_tool"
#> Type "Tool" is not assignable to type "((...) -> Any) | ((...) -> Awaitable[Any])"
#> Type "Tool" is not assignable to type "(...) -> Any"
#> Type "Tool" is not assignable to type "(...) -> Awaitable[Any]"PyrightreportArgumentTypeYou can get around this with a chat.set_tools() dance, which is not ideal.
chat.set_tools([*chat.get_tools(), weather_tool])Metadata
Metadata
Assignees
Labels
No labels