dataflow.api.run_simplified¶

Simplified demo to launch a WebSocket server for chess games.

This is a minimal implementation that focuses on getting the WebSocket functionality working without the full API infrastructure.

Functions¶

get_client()

Serve the chess client HTML.

get_current_player(board)

Get the current player.

get_empty_board()

Create an empty chess board in starting position.

get_game_state(game_id)

Get the full game state.

get_game_status(board)

Get the current game status.

main()

Run the WebSocket server.

make_ai_move(websocket, game_id)

Make a simple AI move.

make_move(board, move_uci)

Make a move on the board.

move_is_valid(board, move_uci)

Check if a move is valid.

websocket_endpoint(websocket, game_id)

WebSocket endpoint for chess games.

Module Contents¶

async dataflow.api.run_simplified.get_client()¶

Serve the chess client HTML.

dataflow.api.run_simplified.get_current_player(board)¶

Get the current player.

dataflow.api.run_simplified.get_empty_board()¶

Create an empty chess board in starting position.

dataflow.api.run_simplified.get_game_state(game_id)¶

Get the full game state.

dataflow.api.run_simplified.get_game_status(board)¶

Get the current game status.

dataflow.api.run_simplified.main()¶

Run the WebSocket server.

async dataflow.api.run_simplified.make_ai_move(websocket, game_id)¶

Make a simple AI move.

Parameters:
  • websocket (fastapi.WebSocket)

  • game_id (str)

dataflow.api.run_simplified.make_move(board, move_uci)¶

Make a move on the board.

dataflow.api.run_simplified.move_is_valid(board, move_uci)¶

Check if a move is valid.

async dataflow.api.run_simplified.websocket_endpoint(websocket, game_id)¶

WebSocket endpoint for chess games.

Parameters:
  • websocket (fastapi.WebSocket)

  • game_id (str)