Spaces:
Sleeping
Sleeping
| import requests | |
| import json | |
| print('=== DUAL NPC CHAT TEST: Bob and Alice Conversation ===') | |
| conversation_data = { | |
| 'npc_a': 'bob-skeptic', | |
| 'npc_b': 'alice-clean', | |
| 'max_turns': 6 # Shorter for demo | |
| } | |
| response = requests.post('http://localhost:8000/npc/workers/start-conversation', json=conversation_data) | |
| print('Dual NPC conversation status:', response.status_code) | |
| if response.status_code == 200: | |
| data = response.json() | |
| print('Conversation completed successfully!') | |
| print('Exchange log:') | |
| for i, exchange in enumerate(data.get('exchange_log', [])): | |
| print(f' Turn {i+1}: {exchange.get("speaker", "Unknown")} says: "{exchange.get("message", "No message")[:120]}..."') | |
| if 'response' in exchange: | |
| print(f' Response: "{exchange["response"][:120]}..."') | |
| else: | |
| print('Error:', response.status_code, response.text[:300]) | |