Spaces:
Sleeping
Sleeping
Download test_dual_npcs.py from Bellok/warbler-cda: direct link, hf CLI and curl.
- Browser
- Download file 881 Bytes
-
https://huggingface.co/spaces/Bellok/warbler-cda/resolve/refs%2Fpr%2F3/test_dual_npcs.py
- Command line
-
hf download hf://spaces/Bellok/warbler-cda@refs/pr/3/test_dual_npcs.py
-
curl -L -o test_dual_npcs.py https://huggingface.co/spaces/Bellok/warbler-cda/resolve/refs%2Fpr%2F3/test_dual_npcs.py
881 Bytes
| 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]) | |