"""๐Ÿงช Quick Agent Test - Verify build_graph function works""" import os os.environ["GOOGLE_API_KEY"] = "AIzaSyDZX6kuggMpFDlMSzCw2bq3hIuQq1bLXe4" try: from agent import build_graph, test_agent from langchain_core.messages import HumanMessage print("๐Ÿงช Testing Agent Initialization...") # Test 1: Build graph with Google provider print("\n1๏ธโƒฃ Testing build_graph with Google provider...") try: graph = build_graph("google") if graph: print("โœ… Graph built successfully!") # Test 2: Simple question print("\n2๏ธโƒฃ Testing simple question...") test_question = "What is 15 + 27?" messages = [HumanMessage(content=test_question)] result = graph.invoke({"messages": messages}) if result and "messages" in result and result["messages"]: answer = result["messages"][-1].content print(f"Question: {test_question}") print(f"Answer: {answer}") print("โœ… Agent working correctly!") else: print("โŒ No valid response from agent") else: print("โŒ Graph is None - build_graph failed") except Exception as e: print(f"โŒ Error during testing: {e}") import traceback traceback.print_exc() print("\n๐ŸŽฏ If you see 'โœ… Agent working correctly!' above, the fix is successful!") print("๐Ÿ“ค Deploy this fix to HF Space to resolve the 0% score issue.") except ImportError as e: print(f"โŒ Import error: {e}") print("This might indicate missing dependencies or import issues.")