haive.games.among_us.generic_engines¶

Generic Among Us engine creation using the generic player agent system.

This module provides generic engine creation functions for Among Us games, allowing for configurable LLM models and game-specific player identifiers.

Classes¶

AmongUsEngineFactory

Factory for creating Among Us game engines.

AmongUsPlayerIdentifiers

Player identifiers for Among Us game.

AmongUsPromptGenerator

Prompt generator for Among Us game.

Functions¶

create_budget_among_us_engines(**kwargs)

Create budget-friendly Among Us engines.

create_detective_among_us_engines(**kwargs)

Create detective-style Among Us engines with high-powered models.

create_generic_among_us_config_from_example(example_name)

Create Among Us engines from a predefined example configuration.

create_generic_among_us_engines(player_configs)

Create Among Us engines from detailed player configurations.

create_generic_among_us_engines_simple(crewmate_model, ...)

Create Among Us engines with simple model specifications.

create_mixed_among_us_engines(**kwargs)

Create mixed-provider Among Us engines.

Module Contents¶

class haive.games.among_us.generic_engines.AmongUsEngineFactory¶

Bases: haive.games.core.agent.generic_player_agent.GenericGameEngineFactory[str, str]

Factory for creating Among Us game engines.

Init .

get_structured_output_model(role)¶

Get the structured output model for a specific role.

Parameters:

role (str)

Return type:

type

class haive.games.among_us.generic_engines.AmongUsPlayerIdentifiers¶

Bases: haive.games.core.agent.generic_player_agent.GamePlayerIdentifiers[str, str]

Player identifiers for Among Us game.

Init .

class haive.games.among_us.generic_engines.AmongUsPromptGenerator(players)¶

Bases: haive.games.core.agent.generic_player_agent.GenericPromptGenerator[str, str]

Prompt generator for Among Us game.

Init .

Parameters:

players (GamePlayerIdentifiers[PlayerType, PlayerType2]) – [TODO: Add description]

create_analyzer_prompt(player)¶

Create analysis prompt for Among Us game state.

Parameters:

player (str)

Return type:

langchain_core.prompts.ChatPromptTemplate

create_move_prompt(player)¶

Create move prompt for Among Us player.

Parameters:

player (str)

Return type:

langchain_core.prompts.ChatPromptTemplate

haive.games.among_us.generic_engines.create_budget_among_us_engines(**kwargs)¶

Create budget-friendly Among Us engines.

Return type:

dict[str, haive.core.engine.aug_llm.AugLLMConfig]

haive.games.among_us.generic_engines.create_detective_among_us_engines(**kwargs)¶

Create detective-style Among Us engines with high-powered models.

Return type:

dict[str, haive.core.engine.aug_llm.AugLLMConfig]

haive.games.among_us.generic_engines.create_generic_among_us_config_from_example(example_name, temperature=0.3)¶

Create Among Us engines from a predefined example configuration.

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

  • temperature (float) – Generation temperature

Returns:

Dictionary of Among Us engines

Return type:

Dict[str, AugLLMConfig]

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

haive.games.among_us.generic_engines.create_generic_among_us_engines(player_configs)¶

Create Among Us engines from detailed player configurations.

Parameters:

player_configs (dict[str, haive.games.core.agent.player_agent.PlayerAgentConfig]) – Dictionary mapping role names to player configurations

Returns:

Dictionary of Among Us engines

Return type:

Dict[str, AugLLMConfig]

Expected roles:
  • “crewmate_player”: Crewmate player configuration

  • “impostor_player”: Impostor player configuration

  • “crewmate_analyzer”: Crewmate analyzer configuration

  • “impostor_analyzer”: Impostor analyzer configuration

haive.games.among_us.generic_engines.create_generic_among_us_engines_simple(crewmate_model, impostor_model, temperature=0.3)¶

Create Among Us engines with simple model specifications.

Parameters:
  • crewmate_model (str) – Model for crewmate player and analyzer

  • impostor_model (str) – Model for impostor player and analyzer

  • temperature (float) – Generation temperature

Returns:

Dictionary of Among Us engines

Return type:

Dict[str, AugLLMConfig]

haive.games.among_us.generic_engines.create_mixed_among_us_engines(**kwargs)¶

Create mixed-provider Among Us engines.

Return type:

dict[str, haive.core.engine.aug_llm.AugLLMConfig]