dataflow.connect4_api¶

Attributes¶

Classes¶

Connect4API

API for Connect4 agent.

Connect4MoveRequest

Request to make a move in Connect4.

Connect4Request

Request to create new Connect4 game.

Connect4Response

Response for Connect4 game.

Functions¶

run()

Run the Connect4 API server.

Module Contents¶

class dataflow.connect4_api.Connect4API¶

Bases: haive.dataflow.api.game_agent.GenericAgentAPI[haive_games.connect4.agent.Connect4Agent, haive_games.connect4.config.Connect4AgentConfig]

API for Connect4 agent.

class dataflow.connect4_api.Connect4MoveRequest(/, **data: Any)¶

Bases: pydantic.BaseModel

Request to make a move in Connect4.

Parameters:

data (Any)

column: int = None¶
explanation: str | None = None¶
class dataflow.connect4_api.Connect4Request(/, **data: Any)¶

Bases: pydantic.BaseModel

Request to create new Connect4 game.

Parameters:

data (Any)

config_overrides: dict[str, Any] | None = None¶
enable_analysis: bool = True¶
first_player: Literal['red', 'yellow'] = 'red'¶
persistence_type: str = 'postgres'¶
thread_id: str | None = None¶
class dataflow.connect4_api.Connect4Response(/, **data: Any)¶

Bases: haive.dataflow.api.game_agent.AgentResponseBase

Response for Connect4 game.

Parameters:

data (Any)

board: list[list[str | None]]¶
error_message: str | None¶
game_status: str¶
move_history: list[dict[str, Any]]¶
red_analysis: list[dict[str, Any]] | None¶
turn: str¶
winner: str | None¶
yellow_analysis: list[dict[str, Any]] | None¶
dataflow.connect4_api.run()¶

Run the Connect4 API server.

dataflow.connect4_api.connect4_api¶
dataflow.connect4_api.logger¶