File size: 1,476 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/usr/bin/env python3
"""Test AI Analysis System"""
from ai_analysis import get_ai_analyzer
import json

print('๐Ÿ”„ Testing summarize_combat_situation...')
analyzer = get_ai_analyzer()

# Mock game state
game_state = {
    'units': {
        'u1': {'player_id': 0, 'type': 'infantry'},
        'u2': {'player_id': 0, 'type': 'tank'},
        'u3': {'player_id': 1, 'type': 'infantry'},
        'u4': {'player_id': 1, 'type': 'infantry'},
        'u5': {'player_id': 1, 'type': 'tank'},
    },
    'buildings': {
        'b1': {'player_id': 0, 'type': 'hq'},
        'b2': {'player_id': 0, 'type': 'barracks'},
        'b3': {'player_id': 1, 'type': 'hq'},
    },
    'players': {
        0: {'credits': 500},
        1: {'credits': 300}
    }
}

print('\n๐Ÿ“Š Testing English...')
result_en = analyzer.summarize_combat_situation(game_state, 'en')
print(f"Summary: {result_en.get('summary')}")
print(f"Tips: {result_en.get('tips')}")
print(f"Coach: {result_en.get('coach')}")

print('\n๐Ÿ“Š Testing French...')
result_fr = analyzer.summarize_combat_situation(game_state, 'fr')
print(f"Summary: {result_fr.get('summary')}")
print(f"Tips: {result_fr.get('tips')}")
print(f"Coach: {result_fr.get('coach')}")

print('\n๐Ÿ“Š Testing Chinese...')
result_zh = analyzer.summarize_combat_situation(game_state, 'zh-TW')
print(f"Summary: {result_zh.get('summary')}")
print(f"Tips: {result_zh.get('tips')}")
print(f"Coach: {result_zh.get('coach')}")

print('\nโœ… All tests completed!')