dataflow.api.game_router¶

Game API router for Haive games.

This module discovers and loads game agents from haive-games package, creating routes for each available game. It provides WebSocket endpoints for streaming game state and interacting with game agents.

Functions¶

create_game_instance(game_type, game_id)

Create or get a game instance.

create_game_router(game_type)

Create a router for a specific game type.

create_game_router_app()

Create a standalone FastAPI app for game routes.

discover_game_agents()

Discover game agents from haive-games package.

get_game_client_html(game_type)

Generate HTML for a specific game client.

get_game_instance(game_type, game_id)

Get an existing game instance.

get_index_html()

Generate HTML for the index page with links to all games.

get_router()

Get a router with all game routes configured.

main()

Run the API server as standalone.

setup_routes(app)

Set up routes for all discovered game agents.

Module Contents¶

dataflow.api.game_router.create_game_instance(game_type, game_id)¶

Create or get a game instance.

dataflow.api.game_router.create_game_router(game_type)¶

Create a router for a specific game type.

dataflow.api.game_router.create_game_router_app()¶

Create a standalone FastAPI app for game routes.

dataflow.api.game_router.discover_game_agents()¶

Discover game agents from haive-games package.

dataflow.api.game_router.get_game_client_html(game_type)¶

Generate HTML for a specific game client.

dataflow.api.game_router.get_game_instance(game_type, game_id)¶

Get an existing game instance.

dataflow.api.game_router.get_index_html()¶

Generate HTML for the index page with links to all games.

dataflow.api.game_router.get_router()¶

Get a router with all game routes configured.

dataflow.api.game_router.main()¶

Run the API server as standalone.

dataflow.api.game_router.setup_routes(app)¶

Set up routes for all discovered game agents.