Player 2 (#3)

Decision Making (not finish)
This commit is contained in:
Luca De Laurentiis
2025-04-12 21:47:57 +02:00
committed by GitHub
parent 3f9de128be
commit bc2ea68332
4 changed files with 33 additions and 60 deletions

View File

@ -4,7 +4,6 @@ import logging
import config
import json
from typing import Dict, Any
import csv
from pathlib import Path
from dto.responses import GameStartResponseDTO, GameDecisionResponseDTO
@ -129,16 +128,3 @@ def store_game_round_data(decision: str, response: GameStartResponseDTO | GameDe
except Exception as e:
logging.error(f"[!] Failed to save API response JSON: {e}")
def store_decision(client_id: str, decision: str):
path = Path('./resources/decision_log2.csv') # TODO clean me!!
path.parent.mkdir(parents=True, exist_ok=True) # create dirs if needed
exists = path.exists()
with open(path, 'a', newline='') as f:
writer = csv.writer(f)
if not exists:
writer.writerow(['client_id', 'decision']) # header
writer.writerow([client_id, decision])