# Test platform connectivityimport aiohttpasync def test_connection(): try: async with aiohttp.ClientSession() as session: async with session.get('https://app.conversimple.com/health') as response: print(f"Platform status: {response.status}") except Exception as e: print(f"Connection error: {e}")
Common Causes:
Invalid API key or customer ID
Network connectivity issues
Firewall blocking WebSocket connections
Solution:
# Verify credentialsprint(f"API Key: {api_key[:10]}...") # Print first 10 charsprint(f"Customer ID: {customer_id}")# Test with verbose loggingagent = MyAgent(api_key=api_key, customer_id=customer_id)await agent.start() # Watch logs for connection details
# Use clear, descriptive tool descriptions@tool("Get the current weather for a specific city or location")def get_weather(self, location: str) -> dict: """Clear description helps AI understand when to use the tool""" return {"temperature": 72, "condition": "sunny"}
import pdb@tool("Debug this tool")def my_tool(self, param: str) -> dict: """Tool with breakpoint""" # Set breakpoint pdb.set_trace() # Debug from here result = some_function(param) return result
def debug_state(self, conversation_id: str): """Print current conversation state""" state = self.conversations.get(conversation_id) if not state: print(f"No state found for {conversation_id}") return print(f"=== Conversation State: {conversation_id} ===") print(json.dumps(state, indent=2, default=str))
# Test tool without running full agentagent = MyAgent(api_key="test", customer_id="test")# Call tool directlyresult = agent.get_weather("San Francisco")print(f"Result: {result}")# Verify result formatassert "temperature" in resultassert "condition" in result