games.among_us.configurable_config¶

Configurable Among Us configuration using the generic player agent system.

This module provides configurable Among Us game configurations that replace hardcoded LLM settings with dynamic, configurable player agents.

Classes¶

ConfigurableAmongUsConfig

Configurable Among Us configuration with dynamic LLM selection.

Functions¶

create_among_us_config([crewmate_model, impostor_model])

Create a configurable Among Us configuration with simple model specifications.

create_among_us_config_from_example(example_name, **kwargs)

Create a configurable Among Us configuration from a predefined example.

create_among_us_config_from_player_configs(...)

Create a configurable Among Us configuration from detailed player configurations.

create_budget_among_us_config(**kwargs)

Create a budget-friendly Among Us configuration.

create_detective_among_us_config(**kwargs)

Create a detective-style Among Us configuration with powerful models.

create_experimental_among_us_config(**kwargs)

Create an experimental Among Us configuration with mixed providers.

get_example_config(name)

Get a predefined example configuration by name.

list_example_configurations()

List all available example configurations.

Module Contents¶

class games.among_us.configurable_config.ConfigurableAmongUsConfig¶

Bases: haive.games.among_us.config.AmongUsConfig

Configurable Among Us configuration with dynamic LLM selection.

This configuration allows users to specify different LLMs for different roles in the Among Us game, providing flexibility and avoiding hardcoded models.

crewmate_model¶

Model for crewmate players (can be string or LLMConfig)

impostor_model¶

Model for impostor players (can be string or LLMConfig)

crewmate_player_name¶

Name for the crewmate players

impostor_player_name¶

Name for the impostor players

example_config¶

Optional example configuration name

player_configs¶

Optional detailed player configurations

temperature¶

Temperature for LLM generation

max_rounds¶

Maximum number of rounds before game ends

enable_analysis¶

Whether to enable game state analysis

recursion_limit¶

Python recursion limit for game execution

model_post_init(__context)¶

Initialize engines after model creation.

Parameters:

__context (Any)

Return type:

None

games.among_us.configurable_config.create_among_us_config(crewmate_model='gpt-4o', impostor_model='claude-3-5-sonnet-20240620', **kwargs)¶

Create a configurable Among Us configuration with simple model specifications.

Parameters:
  • crewmate_model (str) – Model for crewmate players and analyzers

  • impostor_model (str) – Model for impostor players and analyzers

  • **kwargs – Additional configuration parameters

Returns:

Configured Among Us game

Return type:

ConfigurableAmongUsConfig

Examples

>>> config = create_among_us_config("gpt-4o", "claude-3-opus", temperature=0.5)
>>> config = create_among_us_config(
...     "openai:gpt-4o",
...     "anthropic:claude-3-5-sonnet-20240620",
...     max_rounds=75
... )
games.among_us.configurable_config.create_among_us_config_from_example(example_name, **kwargs)¶

Create a configurable Among Us configuration from a predefined example.

Parameters:
  • example_name (str) – Name of the example configuration

  • **kwargs – Additional configuration parameters to override

Returns:

Configured Among Us game

Return type:

ConfigurableAmongUsConfig

Available examples:
  • “gpt_vs_claude”: GPT crewmate vs Claude impostor

  • “gpt_only”: GPT for both players

  • “claude_only”: Claude for both players

  • “budget”: Cost-effective models

  • “mixed”: Different provider per role

  • “detective_vs_mastermind”: High-powered models for intense gameplay

Examples

>>> config = create_among_us_config_from_example("budget", max_rounds=40)
>>> config = create_among_us_config_from_example("detective_vs_mastermind", enable_analysis=False)
games.among_us.configurable_config.create_among_us_config_from_player_configs(player_configs, **kwargs)¶

Create a configurable Among Us configuration from detailed player configurations.

Parameters:
Returns:

Configured Among Us game

Return type:

ConfigurableAmongUsConfig

Expected roles:
  • “crewmate_player”: Crewmate player configuration

  • “impostor_player”: Impostor player configuration

  • “crewmate_analyzer”: Crewmate analyzer configuration

  • “impostor_analyzer”: Impostor analyzer configuration

Examples

>>> player_configs = {
...     "crewmate_player": PlayerAgentConfig(
...         llm_config="gpt-4o",
...         temperature=0.7,
...         player_name="Detective Crewmate"
...     ),
...     "impostor_player": PlayerAgentConfig(
...         llm_config="claude-3-opus",
...         temperature=0.3,
...         player_name="Stealth Impostor"
...     ),
...     "crewmate_analyzer": PlayerAgentConfig(
...         llm_config="gpt-4o",
...         temperature=0.2,
...         player_name="Crew Analyst"
...     ),
...     "impostor_analyzer": PlayerAgentConfig(
...         llm_config="claude-3-opus",
...         temperature=0.2,
...         player_name="Impostor Strategist"
...     ),
... }
>>> config = create_among_us_config_from_player_configs(player_configs)
games.among_us.configurable_config.create_budget_among_us_config(**kwargs)¶

Create a budget-friendly Among Us configuration.

Return type:

ConfigurableAmongUsConfig

games.among_us.configurable_config.create_detective_among_us_config(**kwargs)¶

Create a detective-style Among Us configuration with powerful models.

Return type:

ConfigurableAmongUsConfig

games.among_us.configurable_config.create_experimental_among_us_config(**kwargs)¶

Create an experimental Among Us configuration with mixed providers.

Return type:

ConfigurableAmongUsConfig

games.among_us.configurable_config.get_example_config(name)¶

Get a predefined example configuration by name.

Parameters:

name (str) – Name of the example configuration

Returns:

The example configuration

Return type:

ConfigurableAmongUsConfig

Raises:

ValueError – If the example name is not found

games.among_us.configurable_config.list_example_configurations()¶

List all available example configurations.

Returns:

Mapping of configuration names to descriptions

Return type:

Dict[str, str]