CoolFace
Apppublic

daniela-veloz/adventure_weather_assistant

sourceHugging Facemitupdated 1y agoView on Hugging Face
0likes
debug_tools.py45 linesDownload Raw Back to root
1#!/usr/bin/env python32"""3Debug script to test tool calling functionality4"""5 6from dotenv import load_dotenv7load_dotenv()8 9from backend.activity_adventure_agent import ActivityAdventureAgent10import json11 12def test_tools():13    print("🔧 Testing Adventure Weather Agent tools...")14    15    # Create agent16    agent = ActivityAdventureAgent()17    18    # Print tools19    print("\n📋 Available tools:")20    for i, tool in enumerate(agent.TOOLS, 1):21        print(f"{i}. {tool['function']['name']}: {tool['function']['description']}")22    23    # Print function registry24    print("\n🔗 Function registry:")25    for name, func in agent.function_registry.items():26        print(f"- {name}: {func}")27    28    # Test simple call that should trigger weather API29    print("\n🧪 Testing with: 'What's the weather in Seattle?'")30    response = agent.chat("What's the weather in Seattle?", [])31    print(f"Response: {response}")32    33    # Test direct LLM client with function calling34    print("\n🧪 Testing direct LLM client function calling...")35    llm_response = agent.llm_client.chat_with_function_calling(36        user_prompt="What's the weather in Seattle?",37        system_prompt="You are a helpful assistant. Use the get_weather tool to get weather information.",38        tools=agent.TOOLS,39        function_registry=agent.function_registry,40        debug=True41    )42    print(f"Direct LLM Response: {llm_response}")43 44if __name__ == "__main__":45    test_tools()