Spaces:
Sleeping
Sleeping
Update app.py
Browse filesfix get_list_of_people_on_iss tool function
app.py
CHANGED
|
@@ -8,8 +8,18 @@ from tools.final_answer import FinalAnswerTool
|
|
| 8 |
from Gradio_UI import GradioUI
|
| 9 |
|
| 10 |
@tool
|
| 11 |
-
def get_list_of_people_on_iss() ->
|
| 12 |
-
"""A tool that fetches the current number of people in space. When known it also fetches the names and spacecraft those people are on.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
|
| 14 |
url = "http://api.open-notify.org/astros.json"
|
| 15 |
response = requests.get(url)
|
|
|
|
| 8 |
from Gradio_UI import GradioUI
|
| 9 |
|
| 10 |
@tool
|
| 11 |
+
def get_list_of_people_on_iss() -> dict:
|
| 12 |
+
"""A tool that fetches the current number of people in space. When known it also fetches the names and spacecraft those people are on. Returns.
|
| 13 |
+
Returns:
|
| 14 |
+
dict: A JSON object containing the following keys:
|
| 15 |
+
- "message" (str): Status message (e.g., "success").
|
| 16 |
+
- "number" (int): The number of astronauts currently in space.
|
| 17 |
+
- "people" (list of dict): A list of astronauts, where each entry contains:
|
| 18 |
+
- "name" (str): The astronaut's name.
|
| 19 |
+
- "craft" (str): The name of the spacecraft they are on.
|
| 20 |
+
|
| 21 |
+
Args: None
|
| 22 |
+
"""
|
| 23 |
|
| 24 |
url = "http://api.open-notify.org/astros.json"
|
| 25 |
response = requests.get(url)
|