games.go.aug_llms¶

Go game LLM augmentations.

This module provides augmented LLM configurations for Go game agents, including:
  • Move generation prompts for black and white players

  • Position analysis prompts for both sides

  • Structured output models for moves and analysis

  • Pre-configured LLM configurations for easy agent setup

Example

>>> from haive.games.go.aug_llms import aug_llm_configs
>>>
>>> # Get black player's move generation config
>>> black_config = aug_llm_configs["black_player"]
>>>
>>> # Generate a prompt
>>> prompt = black_config.prompt_template.format(
...     board_size=19,
...     recent_moves=[(0, "black", (3, 4))],
...     captured_stones={"black": 0, "white": 0},
...     player_analysis="Territory is balanced"
... )

Functions¶

generate_go_analysis_prompt(color)

Generate a position analysis prompt for a Go player.

generate_go_move_prompt(color)

Generate a move prompt for a Go player.

Module Contents¶

games.go.aug_llms.generate_go_analysis_prompt(color)¶

Generate a position analysis prompt for a Go player.

This function creates a ChatPromptTemplate that guides an LLM to:
  • Analyze the position from a specific color’s perspective

  • Evaluate territory and influence

  • Identify key positions

  • Suggest strategic plans

Parameters:

color (str) – The player color (“black” or “white”) to analyze for.

Returns:

A prompt template for position analysis.

Return type:

ChatPromptTemplate

Example

>>> prompt = generate_go_analysis_prompt("black")
>>> formatted = prompt.format(
...     board_size=19,
...     recent_moves=[(0, "black", (3, 4))],
...     captured_stones={"black": 0, "white": 0}
... )

Notes

The prompt includes: - System role definition as an analyst - Game context (board size, move history) - Captured stones count - Structured analysis tasks:

  1. Territory assessment

  2. Key position identification

  3. Strategic planning

games.go.aug_llms.generate_go_move_prompt(color)¶

Generate a move prompt for a Go player.

This function creates a ChatPromptTemplate that guides an LLM to:
  • Play as a specific color in Go

  • Consider the current game context

  • Make legal moves in coordinate format

  • Follow Go strategy and rules

Parameters:

color (str) – The player color (“black” or “white”).

Returns:

A prompt template for move generation.

Return type:

ChatPromptTemplate

Example

>>> prompt = generate_go_move_prompt("black")
>>> formatted = prompt.format(
...     board_size=19,
...     recent_moves=[(0, "black", (3, 4))],
...     captured_stones={"black": 0, "white": 0},
...     player_analysis="Territory is balanced"
... )

Notes

The prompt includes: - System role definition as the specified color - Game context (board size, move history) - Captured stones count - Previous position analysis - Clear instruction for move format