dataflow.api.integrate_games

Integration module for adding game routes to the main Haive API.

This module provides functions to add game WebSocket endpoints and routes to an existing FastAPI application. It integrates with the game_router module to discover and register game agents dynamically.

Usage:

from haive.dataflow.api.app import app from haive.dataflow.api.integrate_games import add_game_routes

# Add game routes to the main app add_game_routes(app)

Functions

add_game_routes(app[, prefix])

Add game routes to the main API.

configure_import_paths()

Configure import paths for game_router module.

Module Contents

dataflow.api.integrate_games.add_game_routes(app, prefix='/games')

Add game routes to the main API.

This function discovers game agents and adds routes for each game type to the provided FastAPI application. It creates both REST endpoints and WebSocket endpoints for real-time game state streaming.

Parameters:
  • app (fastapi.FastAPI) – The FastAPI application to add routes to

  • prefix (str) – The URL prefix for game routes (default: “/games”)

Returns:

The updated FastAPI application

dataflow.api.integrate_games.configure_import_paths()

Configure import paths for game_router module.