games.debate.config¶
Configuration classes for debate agent setup and customization.
This module provides comprehensive configuration options for debate agents, including format-specific presets, role assignments, timing controls, and engine configurations. The configuration system supports various debate formats from formal parliamentary debates to trial simulations.
The configuration classes use Pydantic for validation and provide factory methods for common debate formats including standard debates, presidential debates, trial formats, and panel discussions.
Examples
Creating a standard debate configuration:
config = DebateAgentConfig.default()
agent = DebateAgent(config)
Creating a custom trial simulation:
config = DebateAgentConfig.trial()
config.time_limit = 600 # 10 minutes per phase
config.participant_roles["witness_1"] = "witness"
agent = DebateAgent(config)
Creating a presidential debate format:
config = DebateAgentConfig.presidential()
config.allow_interruptions = True
config.moderator_role = "moderator"
agent = DebateAgent(config)
Creating a custom configuration:
config = DebateAgentConfig(
name="custom_debate",
debate_format="oxford",
time_limit=300,
max_statements=5,
allow_interruptions=False,
voting_enabled=True,
participant_roles={
"pro_1": "pro", "pro_2": "pro",
"con_1": "con", "con_2": "con",
"moderator": "moderator"
}
)
Note
All configuration classes inherit from AgentConfig and include automatic engine setup through the build_debate_engines factory function. Custom engine configurations can be provided to override defaults.
Classes¶
Comprehensive configuration for debate agents with format-specific settings. |
Module Contents¶
- class games.debate.config.DebateAgentConfig¶
Bases:
haive.core.engine.agent.agent.AgentConfig
Comprehensive configuration for debate agents with format-specific settings.
This configuration class provides extensive customization options for debate agents, supporting various debate formats, role assignments, timing controls, and engine configurations. It includes validation for debate-specific parameters and provides factory methods for common debate formats.
The configuration system supports: - Multiple debate formats (standard, parliamentary, oxford, trial, presidential) - Flexible role assignment system for participants - Timing controls and statement limits - Interruption and voting settings - Custom engine configurations for different participant roles
- debate_format¶
Format type determining debate structure and rules. Supported formats: “standard”, “parliamentary”, “oxford”, “trial”, “presidential”, “panel”, “lincoln_douglas”.
- Type:
- time_limit¶
Maximum time in seconds per debate phase. None means no time limit. Typical values: 60-600 seconds.
- Type:
Optional[int]
- max_statements¶
Maximum statements per participant per phase. None means unlimited statements. Typical values: 1-5 statements.
- Type:
Optional[int]
- allow_interruptions¶
Whether participants can interrupt each other during their statements. Common in presidential and panel formats.
- Type:
- voting_enabled¶
Whether to include a voting phase at debate end. Typically enabled for competitive debates, disabled for discussions.
- Type:
- moderator_role¶
Specific role identifier for the moderator. None means no dedicated moderator. Common value: “moderator”.
- Type:
Optional[str]
- participant_roles¶
Mapping of participant IDs to their roles. Keys are participant identifiers, values are role names like “pro”, “con”, “judge”, “moderator”, “prosecutor”, “defense”, “witness”.
- state_schema¶
Pydantic model class for debate state. Defaults to DebateState but can be customized for specific formats.
- Type:
Type[BaseModel]
- engines¶
Engine configurations for different roles. Automatically built by build_debate_engines but can be customized.
- Type:
Dict[str, AugLLMConfig]
Examples
Basic debate configuration:
config = DebateAgentConfig( name="climate_debate", debate_format="oxford", time_limit=300, max_statements=3, participant_roles={ "scientist": "pro", "economist": "con", "moderator": "moderator" } )
Trial simulation configuration:
config = DebateAgentConfig( name="murder_trial", debate_format="trial", time_limit=600, allow_interruptions=False, participant_roles={ "prosecutor": "prosecutor", "defense_attorney": "defense", "judge": "judge", "witness_1": "witness", "witness_2": "witness" } )
Parliamentary debate configuration:
config = DebateAgentConfig( name="parliament_session", debate_format="parliamentary", time_limit=180, allow_interruptions=True, voting_enabled=True, participant_roles={ "pm": "government", "deputy_pm": "government", "leader_opposition": "opposition", "deputy_opposition": "opposition", "speaker": "moderator" } )
Note
The configuration automatically sets up appropriate engines for each role using the build_debate_engines factory. Custom engines can be provided to override defaults for specific use cases or to add specialized capabilities.
- classmethod default()¶
Create a default configuration for standard debate.
- classmethod panel_discussion()¶
Create a configuration for a panel discussion.
- classmethod presidential()¶
Create a configuration for presidential debate.
- classmethod trial()¶
Create a configuration for a trial format.
- classmethod validate_debate_format(v)¶
Validate debate format is supported.
- Parameters:
v (str) – Debate format to validate.
- Returns:
Validated format string.
- Return type:
- Raises:
ValueError – If format is not supported.