mirror of
https://github.com/NousResearch/atropos.git
synced 2026-05-01 17:45:16 +00:00
linting
This commit is contained in:
parent
98d9ef87a2
commit
de3bf7c505
62 changed files with 1270 additions and 706 deletions
|
|
@ -1,96 +0,0 @@
|
|||
"""
|
||||
Configuration for DynastAI
|
||||
|
||||
This module holds configuration parameters for the DynastAI game environment.
|
||||
"""
|
||||
|
||||
import os
|
||||
from typing import Dict, List, Any, Optional
|
||||
from pydantic import BaseModel, Field
|
||||
from dotenv import load_dotenv
|
||||
|
||||
# Load environment variables
|
||||
load_dotenv()
|
||||
|
||||
class DynastAIConfig(BaseModel):
|
||||
"""
|
||||
Configuration class for DynastAI game
|
||||
"""
|
||||
# API configuration
|
||||
api_host: str = Field(default="localhost", description="API server host")
|
||||
api_port: int = Field(default=9001, description="API server port")
|
||||
|
||||
# Web UI configuration
|
||||
web_enabled: bool = Field(default=True, description="Enable web UI")
|
||||
web_port: int = Field(default=3000, description="Web UI port")
|
||||
|
||||
# Game configuration
|
||||
initial_metrics: Dict[str, int] = Field(
|
||||
default={
|
||||
"power": 50,
|
||||
"stability": 50,
|
||||
"piety": 50,
|
||||
"wealth": 50,
|
||||
"reign_year": 1
|
||||
},
|
||||
description="Initial game metrics"
|
||||
)
|
||||
|
||||
initial_category_weights: Dict[str, float] = Field(
|
||||
default={
|
||||
"power": 50.0,
|
||||
"stability": 50.0,
|
||||
"piety": 50.0,
|
||||
"wealth": 50.0
|
||||
},
|
||||
description="Initial category weights for card selection"
|
||||
)
|
||||
|
||||
# OpenRouter configuration
|
||||
openrouter_api_key: str = Field(
|
||||
default=os.getenv("OPENROUTER_API_KEY", ""),
|
||||
description="OpenRouter API key"
|
||||
)
|
||||
|
||||
openrouter_model: str = Field(
|
||||
default="qwen/Qwen1.5-7B",
|
||||
description="OpenRouter model to use"
|
||||
)
|
||||
|
||||
# Data storage configuration
|
||||
data_dir: str = Field(
|
||||
default="data",
|
||||
description="Directory for storing game data"
|
||||
)
|
||||
|
||||
# Card configuration
|
||||
cards_file: str = Field(
|
||||
default="cards.json",
|
||||
description="Filename for storing cards"
|
||||
)
|
||||
|
||||
use_local_cards: bool = Field(
|
||||
default=True,
|
||||
description="Whether to use cards from local JSON file"
|
||||
)
|
||||
|
||||
use_api_cards: bool = Field(
|
||||
default=True,
|
||||
description="Whether to generate cards using OpenRouter API"
|
||||
)
|
||||
|
||||
# Game difficulty settings
|
||||
min_effect_value: int = Field(default=-20, description="Minimum effect value")
|
||||
max_effect_value: int = Field(default=20, description="Maximum effect value")
|
||||
normal_effect_range: tuple = Field(default=(-10, 10), description="Normal range for effects")
|
||||
|
||||
# Adaptive weighting parameters
|
||||
weight_alpha: float = Field(default=0.9, description="Alpha parameter for EMA weight update")
|
||||
weight_beta: float = Field(default=0.1, description="Beta parameter for EMA weight update")
|
||||
|
||||
|
||||
def get_config() -> DynastAIConfig:
|
||||
"""
|
||||
Returns the configuration object with values from environment variables
|
||||
"""
|
||||
return DynastAIConfig()
|
||||
Loading…
Add table
Add a link
Reference in a new issue