Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -20,7 +20,8 @@ def get_name_age(name:str)-> str: #it's import to specify the return type
|
|
| 20 |
payload = {'name': name}
|
| 21 |
|
| 22 |
res = requests.post('https://api.agify.io/', params=payload)
|
| 23 |
-
|
|
|
|
| 24 |
|
| 25 |
except Exception as e:
|
| 26 |
return f"Error fetching age for {name} in data {e}"
|
|
|
|
| 20 |
payload = {'name': name}
|
| 21 |
|
| 22 |
res = requests.post('https://api.agify.io/', params=payload)
|
| 23 |
+
data = res.json()
|
| 24 |
+
age = data["age"]
|
| 25 |
|
| 26 |
except Exception as e:
|
| 27 |
return f"Error fetching age for {name} in data {e}"
|