# scripts/test_agent.py import asyncio from app.services.agents.agent_service import AgentService from app.services.agents.templates import get_order_taking_template async def test_agent(): """Test agent creation and execution""" # This is a simulation - in production use actual DB session print("šŸ¤– Testing Agent System\n") # Load template template = get_order_taking_template() print(f"āœ… Loaded template: {template['name']}") print(f" Steps: {len(template['config']['steps'])}") print(f" Actions: {len(template['config']['actions'])}\n") # Simulate conversation flow print("šŸ’¬ Simulating Conversation:\n") responses = [ "John Doe", "john@example.com", "555-1234", "2 large pizzas", "123 Main St" ] for i, step in enumerate(template['config']['steps']): print(f"Agent: {step['prompt']}") print(f"User: {responses[i]}") print(f"āœ“ Collected: {step['field']} = {responses[i]}\n") print("āœ… Workflow completed!") print("šŸ“§ Executing actions...") print(" - Sending confirmation email") print(" - Saving to Google Sheets") print("\nšŸŽ‰ Order processed successfully!") if __name__ == "__main__": asyncio.run(test_agent())