Spaces:
Runtime error
Runtime error
#!/usr/bin/env python3 | |
from tools.mood_to_need import MoodToNeedTool, claude_mood_to_need_model | |
from tools.need_to_destination import NeedToDestinationTool, claude_need_to_destination_model | |
from tools.weather_tool import WeatherTool | |
from tools.country_info_tool import CountryInfoTool | |
from tools.find_flight import FlightsFinderTool | |
def test_tools(): | |
print("π§ͺ Testing individual tools...\n") | |
# Test 1: MoodToNeed | |
print("1οΈβ£ Testing MoodToNeed...") | |
mood_tool = MoodToNeedTool(model=claude_mood_to_need_model) | |
need = mood_tool.forward(mood="happy") | |
print(f" Input: 'happy' β Output: '{need}'\n") | |
# Test 2: NeedToDestination | |
print("2οΈβ£ Testing NeedToDestination...") | |
destination_tool = NeedToDestinationTool(model=claude_need_to_destination_model) | |
destinations = destination_tool.forward(need=need) | |
print(f" Input: '{need}' β Output: {destinations}\n") | |
# Test 3: WeatherTool | |
print("3οΈβ£ Testing WeatherTool...") | |
weather_tool = WeatherTool() | |
if destinations and len(destinations) > 0: | |
first_dest = destinations[0]["destination"] | |
weather = weather_tool.forward(location=first_dest) | |
print(f" Input: '{first_dest}' β Output: {weather[:200]}...\n") | |
# Test 4: CountryInfoTool | |
print("4οΈβ£ Testing CountryInfoTool...") | |
country_tool = CountryInfoTool() | |
if destinations and len(destinations) > 0: | |
# Extract country from destination | |
dest_parts = destinations[0]["destination"].split(", ") | |
if len(dest_parts) > 1: | |
country = dest_parts[1] | |
safety = country_tool.forward(country=country, info_type="security") | |
print(f" Input: '{country}' β Output: {safety[:200]}...\n") | |
# Test 5: FlightsFinderTool | |
print("5οΈβ£ Testing FlightsFinderTool...") | |
flights_tool = FlightsFinderTool() | |
if destinations and len(destinations) > 0: | |
dest_airport = destinations[0]["departure"]["to_airport"] | |
flights = flights_tool.forward( | |
departure_airport="CDG", | |
arrival_airport=dest_airport, | |
outbound_date="2025-06-15", | |
return_date="2025-06-22" | |
) | |
print(f" Input: CDG β {dest_airport} β Output: {flights[:200]}...\n") | |
print("β All tools tested!") | |
if __name__ == "__main__": | |
test_tools() |