Skip to content

Commit 34308c2

Browse files
S1M0N38claude
andcommitted
docs: add comprehensive documentation to Config class
- Add detailed class and method docstrings - Document all attributes with type and purpose information - Improve method documentation with parameters and return values - Add exception documentation for error cases 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 02bfa5b commit 34308c2

1 file changed

Lines changed: 32 additions & 4 deletions

File tree

src/balatrollm/config.py

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,24 @@
99

1010
@dataclass
1111
class Config:
12-
"""Configuration for LLMBot."""
12+
"""Configuration for LLMBot.
13+
14+
Stores all configuration parameters for bot execution including
15+
model settings, game parameters, and metadata.
16+
17+
Attributes:
18+
model: LLM model identifier (e.g., 'cerebras/gpt-oss-120b').
19+
strategy: Strategy name to use for game decisions (default: 'default').
20+
deck: Balatro deck type to use (default: 'Red Deck').
21+
stake: Difficulty stake level (default: 1).
22+
seed: Game seed for reproducible runs (default: 'OOOO155').
23+
challenge: Optional challenge mode identifier.
24+
version: Software version string.
25+
name: Human-readable configuration name.
26+
description: Configuration description.
27+
author: Configuration author identifier.
28+
tags: List of tags for categorization.
29+
"""
1330

1431
model: str
1532
strategy: str = "default"
@@ -25,7 +42,11 @@ class Config:
2542

2643
@classmethod
2744
def from_defaults(cls) -> "Config":
28-
"""Create configuration with default values."""
45+
"""Create configuration with default values.
46+
47+
Returns:
48+
Config instance with all default parameter values.
49+
"""
2950
return cls(
3051
model="cerebras/gpt-oss-120b",
3152
strategy="default",
@@ -48,7 +69,14 @@ def from_config_file(cls, config_path: Path) -> "Config":
4869
otherwise falls back to environment defaults for base_url and api_key.
4970
5071
Args:
51-
config_path: Path to the config.json file
72+
config_path: Path to the config.json file.
73+
74+
Returns:
75+
Config instance loaded from the JSON file.
76+
77+
Raises:
78+
FileNotFoundError: If the config file doesn't exist.
79+
ValueError: If config version doesn't match current repository version.
5280
"""
5381
config_file = Path(config_path)
5482
if not config_file.exists():
@@ -75,7 +103,7 @@ def to_config_file(self, config_path: Path) -> None:
75103
formatting and version information.
76104
77105
Args:
78-
config_path: Path to the config file to write
106+
config_path: Path to the config file to write.
79107
"""
80108
# Convert dataclass to dictionary and ensure version is current
81109
config_data = asdict(self)

0 commit comments

Comments
 (0)