Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -44,7 +44,7 @@ def get_weather(
|
|
| 44 |
@tool
|
| 45 |
def get_universites_by_country(
|
| 46 |
country: str,
|
| 47 |
-
) ->
|
| 48 |
"""
|
| 49 |
Ищет список университетов для указанной страны с помощью HipoLabs API.
|
| 50 |
|
|
@@ -60,7 +60,9 @@ def get_universites_by_country(
|
|
| 60 |
url = f"http://universities.hipolabs.com/search?country={country}"
|
| 61 |
response = requests.get(url, timeout=10)
|
| 62 |
response.raise_for_status()
|
| 63 |
-
|
|
|
|
|
|
|
| 64 |
except Exception as e:
|
| 65 |
return f"Error fetching weather for {country}: {str(e)}"
|
| 66 |
|
|
|
|
| 44 |
@tool
|
| 45 |
def get_universites_by_country(
|
| 46 |
country: str,
|
| 47 |
+
) -> list:
|
| 48 |
"""
|
| 49 |
Ищет список университетов для указанной страны с помощью HipoLabs API.
|
| 50 |
|
|
|
|
| 60 |
url = f"http://universities.hipolabs.com/search?country={country}"
|
| 61 |
response = requests.get(url, timeout=10)
|
| 62 |
response.raise_for_status()
|
| 63 |
+
data = response.json()
|
| 64 |
+
names = [uni["name"] for uni in data]
|
| 65 |
+
return f"Университеты в {country}: {names}"
|
| 66 |
except Exception as e:
|
| 67 |
return f"Error fetching weather for {country}: {str(e)}"
|
| 68 |
|