|
7 | 7 | from pathlib import Path |
8 | 8 | from typing import Any |
9 | 9 |
|
| 10 | +from balatrobot.enums import State |
10 | 11 | from openai import ( |
11 | 12 | APIConnectionError, |
12 | 13 | APIStatusError, |
|
18 | 19 | from openai.types.chat import ChatCompletion |
19 | 20 |
|
20 | 21 | from balatrobot import BalatroClient, BalatroError |
21 | | -from balatrobot.enums import State |
22 | 22 |
|
23 | 23 | from .config import Config, load_model_config |
24 | 24 | from .data_collection import ChatCompletionError, ChatCompletionResponse, StatsCollector |
@@ -227,9 +227,10 @@ async def _make_llm_request_with_retries( |
227 | 227 | request_id = str(time.time_ns() // 1_000_000) |
228 | 228 | response = await self.llm_client.chat.completions.create(**request_data) |
229 | 229 | self.responses.append(response) |
230 | | - self.balatro_client.screenshot( |
231 | | - self.data_collector.screenshot_dir / f"{custom_id}.png" |
232 | | - ) |
| 230 | + if self.config.take_screenshots: |
| 231 | + self.balatro_client.screenshot( |
| 232 | + self.data_collector.screenshot_dir / f"{custom_id}.png" |
| 233 | + ) |
233 | 234 | self.data_collector.write_response( |
234 | 235 | id=str(time.time_ns() // 1_000_000), |
235 | 236 | custom_id=custom_id, |
@@ -399,7 +400,7 @@ async def _init_game(self, base_dir: Path = Path.cwd()) -> dict[str, Any]: |
399 | 400 | "stake": self.config.stake, |
400 | 401 | "seed": self.config.seed, |
401 | 402 | "challenge": self.config.challenge, |
402 | | - "log_path": self.data_collector.run_dir / "gamestates.jsonl", |
| 403 | + # "log_path": self.data_collector.run_dir / "gamestates.jsonl", |
403 | 404 | } |
404 | 405 |
|
405 | 406 | return self.balatro_client.send_message("start_run", start_run_args) |
|
0 commit comments