forked from trpc-group/trpc-agent-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtools.py
More file actions
38 lines (34 loc) · 1 KB
/
Copy pathtools.py
File metadata and controls
38 lines (34 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# Tencent is pleased to support the open source community by making tRPC-Agent-Python available.
#
# Copyright (C) 2026 Tencent. All rights reserved.
#
# tRPC-Agent-Python is licensed under Apache-2.0.
""" Tools for the agent. """
def get_weather(city: str) -> dict:
"""Get weather information for the specified city.
Args:
city: The name of the city to get weather for.
Returns:
A dictionary containing weather information.
"""
# Simulate weather API response
weather_data = {
"Beijing": {
"city": "Beijing",
"temperature": "25C",
"condition": "Sunny",
"humidity": "60%"
},
"Shanghai": {
"city": "Shanghai",
"temperature": "28C",
"condition": "Cloudy",
"humidity": "70%"
},
}
return weather_data.get(city, {
"city": city,
"temperature": "Unknown",
"condition": "Data not available",
"humidity": "Unknown"
})