import asyncio import logging from core.llm_executor import LLMExecutor # Configure logging logging.basicConfig( level=logging.DEBUG, format='%(asctime)s - %(levelname)s - %(message)s' ) async def test_api(): try: # Test basic API connection print("Initializing LLMExecutor...") executor = LLMExecutor(model="deepseek-chat") # Simple test request with timeout print("Sending test request with 10 second timeout...") try: response = await asyncio.wait_for( executor.execute_step( step_instruction="Respond with 'Hello World'", step_input={"text": "Test"} ), timeout=10.0 ) print("Raw API Response:", response) if response.get("success"): print("API Response:", response["output"]) else: print("API Error:", response.get("error", "Unknown error")) except asyncio.TimeoutError: print("API request timed out after 10 seconds") except Exception as e: logging.exception("API test failed:") print("\nDetailed error information:") print(f"Exception type: {type(e).__name__}") print(f"Exception args: {e.args}") if hasattr(e, "__traceback__"): import traceback traceback.print_tb(e.__traceback__) if __name__ == "__main__": print("Starting API test...") asyncio.run(test_api())