Spaces:
Sleeping
Sleeping
File size: 1,230 Bytes
12d64f8 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
#!/usr/bin/env python3
"""Debug AI Analysis - See raw output"""
from ai_analysis import get_ai_analyzer
import json
analyzer = get_ai_analyzer()
prompt = """You are an expert RTS (Red Alert style) commentator & coach. Return ONLY one <json>...</json> block.
JSON keys: summary (string concise tactical overview), tips (array of 1-4 short imperative build/composition suggestions), coach (1 motivational/adaptive sentence).
No additional keys. No text outside tags. Language: English.
Battle state: Player 2 units vs Enemy 3 units. Player 2 buildings vs Enemy 1 buildings. Credits: 500.
Example JSON:
{"summary": "Allies hold a modest resource advantage and a forward infantry presence near the center.", "tips": ["Build more tanks", "Defend north base", "Scout enemy position"], "coach": "You are doing well; keep pressure on the enemy."}
Generate tactical analysis in English:"""
print("📝 Prompt:")
print(prompt)
print("\n" + "="*80)
print("🤖 Generating response...")
result = analyzer.generate_response(
prompt=prompt,
max_tokens=300,
temperature=0.7,
timeout=25.0
)
print(f"\n✅ Status: {result.get('status')}")
print(f"📦 Data: {json.dumps(result.get('data'), indent=2, ensure_ascii=False)}")
|