Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -8,21 +8,36 @@ from tools.final_answer import FinalAnswerTool
|
|
| 8 |
from Gradio_UI import GradioUI
|
| 9 |
|
| 10 |
@tool
|
| 11 |
-
def
|
| 12 |
-
"""
|
| 13 |
|
| 14 |
Args:
|
| 15 |
-
|
|
|
|
| 16 |
|
| 17 |
Returns:
|
| 18 |
-
A result
|
|
|
|
|
|
|
| 19 |
"""
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
|
| 27 |
@tool
|
| 28 |
def get_current_time_in_timezone(timezone: str) -> str:
|
|
|
|
| 8 |
from Gradio_UI import GradioUI
|
| 9 |
|
| 10 |
@tool
|
| 11 |
+
def reserve_flight_ticket(departure_date: str, destination_airport: str) -> dict:
|
| 12 |
+
"""Reserve an airline ticket for a given date and destination.
|
| 13 |
|
| 14 |
Args:
|
| 15 |
+
departure_date: Departure date in ISO format (YYYY-MM-DD).
|
| 16 |
+
destination_airport: IATA airport code of the destination (e.g., HND, LAX).
|
| 17 |
|
| 18 |
Returns:
|
| 19 |
+
A dictionary containing the reservation result.
|
| 20 |
+
On success, returns status "success" and a ticket_number.
|
| 21 |
+
On failure, returns status "false".
|
| 22 |
"""
|
| 23 |
+
import random
|
| 24 |
+
import string
|
| 25 |
+
|
| 26 |
+
# Simulate reservation success or failure
|
| 27 |
+
success = random.choice([True, False])
|
| 28 |
+
|
| 29 |
+
if success:
|
| 30 |
+
ticket_number = "".join(
|
| 31 |
+
random.choices(string.ascii_uppercase + string.digits, k=10)
|
| 32 |
+
)
|
| 33 |
+
return {
|
| 34 |
+
"status": "success",
|
| 35 |
+
"ticket_number": ticket_number
|
| 36 |
+
}
|
| 37 |
+
else:
|
| 38 |
+
return {
|
| 39 |
+
"status": "false"
|
| 40 |
+
}
|
| 41 |
|
| 42 |
@tool
|
| 43 |
def get_current_time_in_timezone(timezone: str) -> str:
|