haive.games.framework.multi_player.config¶

Configuration for multi-player game agents.

This module provides the configuration class for multi-player game agents, supporting features like:

  • Role-based player configurations

  • LLM engine configurations per role

  • Game state schema definitions

  • Visualization settings

  • Game flow control

Example

>>> from haive.agents.agent_games.framework.multi_player.config import MultiPlayerGameConfig
>>> from haive.core.engine.aug_llm import AugLLMConfig
>>>
>>> # Create a game configuration
>>> config = MultiPlayerGameConfig(
...     state_schema=MyGameState,
...     engines={
...         "player": {"move": player_llm_config},
...         "narrator": {"narrate": narrator_llm_config}
...     }
... )

Classes¶

MultiPlayerGameConfig

Configuration for multi-player game agents.

Module Contents¶

class haive.games.framework.multi_player.config.MultiPlayerGameConfig[source]¶

Bases: haive.core.engine.agent.agent.AgentConfig

Configuration for multi-player game agents.

This class defines the configuration for multi-player game agents, including state management, player roles, and LLM configurations.

state_schema¶

State schema for the game.

Type:

Type[MultiPlayerGameState]

player_schemas¶

Role-specific schemas.

Type:

Dict[str, Type[BaseModel]]

engines¶

LLM configs by role.

Type:

Dict[str, Dict[str, AugLLMConfig]]

initial_player_count¶

Default number of players.

Type:

int

visualize¶

Whether to visualize the game.

Type:

bool

max_rounds¶

Maximum number of rounds.

Type:

Optional[int]

async_mode¶

Whether to run players asynchronously.

Type:

bool

Example

>>> config = MultiPlayerGameConfig(
...     state_schema=MyGameState,
...     engines={
...         "player": {
...             "move": AugLLMConfig(
...                 name="player_move",
...                 llm_config=my_llm_config,
...                 prompt_template=move_prompt
...             )
...         }
...     },
...     initial_player_count=4
... )
class Config[source]¶

Pydantic configuration.