Spaces:
Sleeping
Sleeping
updated description
Browse files- Gradio_UI.py +6 -5
- tools/weather.py +1 -1
Gradio_UI.py
CHANGED
|
@@ -38,14 +38,15 @@ class GradioUI:
|
|
| 38 |
gr.Markdown("# 🤖 My First Agent with smolagents")
|
| 39 |
gr.Markdown("""
|
| 40 |
This agent can:
|
| 41 |
-
-
|
| 42 |
-
|
|
|
|
|
|
|
|
|
|
| 43 |
|
| 44 |
Try asking it questions like:
|
| 45 |
- "What's the weather like in Tokyo?"
|
| 46 |
-
- "What
|
| 47 |
-
- "Who won the last World Cup?"
|
| 48 |
-
- "Tell me about the history of computers"
|
| 49 |
""")
|
| 50 |
|
| 51 |
chatbot = gr.Chatbot(
|
|
|
|
| 38 |
gr.Markdown("# 🤖 My First Agent with smolagents")
|
| 39 |
gr.Markdown("""
|
| 40 |
This agent can:
|
| 41 |
+
- Get weather information for specific cities.
|
| 42 |
+
|
| 43 |
+
This agent cannot:
|
| 44 |
+
- Disambiguate between cities with the same name.
|
| 45 |
+
- Use other locality information like states, countries, postal codes, etc.
|
| 46 |
|
| 47 |
Try asking it questions like:
|
| 48 |
- "What's the weather like in Tokyo?"
|
| 49 |
+
- "What's the temperature in Dallas?"
|
|
|
|
|
|
|
| 50 |
""")
|
| 51 |
|
| 52 |
chatbot = gr.Chatbot(
|
tools/weather.py
CHANGED
|
@@ -10,7 +10,7 @@ def get_weather(location: str) -> str:
|
|
| 10 |
Args:
|
| 11 |
location: A string representing a city (e.g., 'New York', 'Paris').
|
| 12 |
Returns:
|
| 13 |
-
str: A
|
| 14 |
"""
|
| 15 |
# Validate that location contains only allowed characters: letters, digits, spaces, and hyphens
|
| 16 |
if not re.fullmatch(r'[A-Za-z0-9\s-]+', location):
|
|
|
|
| 10 |
Args:
|
| 11 |
location: A string representing a city (e.g., 'New York', 'Paris').
|
| 12 |
Returns:
|
| 13 |
+
str: A json blob containing the current weather information for that city.
|
| 14 |
"""
|
| 15 |
# Validate that location contains only allowed characters: letters, digits, spaces, and hyphens
|
| 16 |
if not re.fullmatch(r'[A-Za-z0-9\s-]+', location):
|