dataflow.api.game_router_fixed¶
Game API router for Haive games using the discovery system.
This module discovers and loads game agents from haive-games package using the centralized discovery system, creating routes for each available game. It provides WebSocket endpoints for streaming game state and interacting with game agents.
Functions¶
|
Create or get a game instance. |
|
Create a router for a specific game type. |
Create a standalone FastAPI app for game routes. |
|
Discover game agents using the unified discovery system. |
|
|
Generate HTML for a specific game client. |
|
Get an existing game instance. |
Generate HTML for the index page with links to all games. |
|
Get a router with all game routes configured. |
|
|
Run the API server as standalone. |
Module Contents¶
- dataflow.api.game_router_fixed.create_game_instance(game_type, game_id)¶
Create or get a game instance.
- dataflow.api.game_router_fixed.create_game_router(game_type)¶
Create a router for a specific game type.
- Parameters:
game_type (str)
- Return type:
fastapi.APIRouter
- dataflow.api.game_router_fixed.create_game_router_app()¶
Create a standalone FastAPI app for game routes.
- dataflow.api.game_router_fixed.discover_game_agents()¶
Discover game agents using the unified discovery system.
- dataflow.api.game_router_fixed.get_game_client_html(game_type)¶
Generate HTML for a specific game client.
- Parameters:
game_type (str)
- dataflow.api.game_router_fixed.get_game_instance(game_type, game_id)¶
Get an existing game instance.
- dataflow.api.game_router_fixed.get_index_html()¶
Generate HTML for the index page with links to all games.
- dataflow.api.game_router_fixed.get_router()¶
Get a router with all game routes configured.
- dataflow.api.game_router_fixed.main()¶
Run the API server as standalone.