Skip to content

Chess game commentator using ChatGPT API and shows some of the popular chess games with commentaries stored in AWS.

License

Notifications You must be signed in to change notification settings

victoraysev/ChessCommentator

Repository files navigation

Chess Commentator

Welcome to Chess Commentator, a Python-based application built with Streamlit that provides insightful commentary on chess games. This project uses the Lichess API to fetch game data, the ChatGPT API to generate commentary, and a Spring Boot application deployed on AWS Lambda to fetch pre-saved chess games and their commentaries. You can see the readme file for spring boot application from below link:

https://github.com/utkuaysev/ChessCommentator/tree/master/ChessCommentatorJavaSource

Table of Contents

Features

  • Game Analysis: Fetch and analyze chess games using the Lichess API.
  • Insightful Commentary: Receive detailed commentary on the strategic aspects of the game, generated by the ChatGPT API.
  • Pre-Saved Games: Fetch pre-saved chess games and their commentaries from a Spring Boot application deployed on AWS Lambda.
  • Easy to Use: Simple and user-friendly interface built with Streamlit.
  • Extensible: Easily extendable to support more features in the future.

Installation

Prerequisites

  • Python 3.7 or higher
  • pip
  • OpenAI API key

Steps

  1. Clone the repository:

    git clone https://github.com/utkuaysev/ChessCommentator.git
    cd ChessCommentator
  2. Create and activate a virtual environment (optional but recommended):

    python -m venv venv
    source venv/bin/activate   # On Windows, use `venv\Scripts\activate`
  3. Install the dependencies:

    pip install -r requirements.txt
  4. Set up your environment variables:

    • Create a .env file in the root directory of the project and add your OpenAI API key:
      API_GATEWAY_TOKEN=<>
      LICHESS_API_TOKEN=<>
      

Usage

  1. Run the Streamlit app:

    streamlit run app.py
  2. Fetch a Chess Game:

    • Use the app interface to enter game ID to fetch and analyze the game.
  3. Fetch Pre-Saved Games:

    • Use the app interface to fetch pre-saved chess games and their commentaries from the AWS Lambda,DynamoDB powered Spring Boot application.
  4. View Commentary:

    • The application will provide detailed commentary for each move in the game, generated by the ChatGPT API.

References

You can directly use the application from below link:

https://chesscommentator.streamlit.app/

In this medium blog post you can see the detailed explanation about the application:

https://medium.com/@victor.aysev/chesscommentator-enhancing-chess-analysis-with-ai-generated-commentaries-fc67afdef42f

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contact

For any questions or feedback, please reach out to:

About

Chess game commentator using ChatGPT API and shows some of the popular chess games with commentaries stored in AWS.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published