Spaces:
Sleeping
Sleeping
| #!/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!') | |