Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -8,19 +8,20 @@ from tools.final_answer import FinalAnswerTool
|
|
| 8 |
from Gradio_UI import GradioUI
|
| 9 |
|
| 10 |
# Below is an example of a tool that does nothing. Amaze us with your creativity !
|
|
|
|
| 11 |
@tool
|
| 12 |
def get_latitude_from_address(address: str) -> str:
|
| 13 |
-
"""Récupère la latitude
|
| 14 |
|
| 15 |
-
|
| 16 |
-
address (str): L'adresse complète à géocoder (ex: '10 Downing Street, London'
|
| 17 |
|
| 18 |
-
|
| 19 |
str: Une chaîne contenant la latitude et la longitude correspondantes.
|
| 20 |
"""
|
| 21 |
-
|
| 22 |
-
import requests
|
| 23 |
|
|
|
|
| 24 |
url = "https://nominatim.openstreetmap.org/search"
|
| 25 |
params = {"q": address, "format": "json", "limit": 1}
|
| 26 |
headers = {"User-Agent": "smolagents-geocoder/1.0"}
|
|
|
|
| 8 |
from Gradio_UI import GradioUI
|
| 9 |
|
| 10 |
# Below is an example of a tool that does nothing. Amaze us with your creativity !
|
| 11 |
+
|
| 12 |
@tool
|
| 13 |
def get_latitude_from_address(address: str) -> str:
|
| 14 |
+
"""Récupère la latitude et la longitude d'une adresse.
|
| 15 |
|
| 16 |
+
Args:
|
| 17 |
+
address (str): L'adresse complète à géocoder (ex: '10 Downing Street, London').
|
| 18 |
|
| 19 |
+
Returns:
|
| 20 |
str: Une chaîne contenant la latitude et la longitude correspondantes.
|
| 21 |
"""
|
| 22 |
+
import requests
|
|
|
|
| 23 |
|
| 24 |
+
try:
|
| 25 |
url = "https://nominatim.openstreetmap.org/search"
|
| 26 |
params = {"q": address, "format": "json", "limit": 1}
|
| 27 |
headers = {"User-Agent": "smolagents-geocoder/1.0"}
|