mirror of
https://github.com/temporal-community/temporal-ai-agent.git
synced 2026-03-15 14:08:08 +01:00
25 lines
736 B
Python
25 lines
736 B
Python
def search_flights(args: dict) -> dict:
|
|
"""
|
|
Example function for searching flights.
|
|
Currently just prints/returns the passed args,
|
|
but you can add real flight search logic later.
|
|
"""
|
|
date_depart = args.get("dateDepart")
|
|
date_return = args.get("dateReturn")
|
|
origin = args.get("origin")
|
|
destination = args.get("destination")
|
|
|
|
print(f"Searching flights from {origin} to {destination}")
|
|
print(f"Depart: {date_depart}, Return: {date_return}")
|
|
|
|
# Return a mock result so you can verify it
|
|
return {
|
|
"tool": "SearchFlights",
|
|
"searchResults": [
|
|
"QF123: $1200",
|
|
"VA456: $1000",
|
|
],
|
|
"status": "search-complete",
|
|
"args": args,
|
|
}
|