awesome-llm-apps/ai_agent_tutorials/ai_tic_tac_toe_agent
2025-01-02 04:06:48 +05:30
..
ai_tic_tac_toe_agent.py Add ai_tic_tac_toe_agent folder 2025-01-02 04:06:48 +05:30
README.md Add ai_tic_tac_toe_agent folder 2025-01-02 04:06:48 +05:30
requirements.txt Add ai_tic_tac_toe_agent folder 2025-01-02 04:06:48 +05:30

AI vs AI Tic-Tac-Toe Game 🎮

An interactive Tic-Tac-Toe game where two AI agents powered by different language models compete against each other built on phidata Agent Framework and Streamlit as UI. Watch as GPT-4O battles against either DeepSeek V3 or Google's Gemini 1.5 Flash in this classic game!

Features 🌟

  • Player X: Powered by OpenAI's GPT-4o (o1 models as api is yet to roll out for tier)
  • Player O: Choice between DeepSeek AI or Google's Gemini
  • Interactive game board using Streamlit
  • Real-time move visualization
  • AI Judge to determine game outcomes
  • Clean and intuitive user interface

Prerequisites 📋

  • Python 3.8+
  • OpenAI API key
  • Either DeepSeek API key or Google API key (for Player O)

How to Run 🚀

  1. Setup Environment

    # Clone the repository
    git clone https://github.com/Shubhamsaboo/awesome-llm-apps.git
    cd ai_agent_tutorials/ai_tic_tac_toe_agent
    
    # Install dependencies
    pip install -r requirements.txt
    
  2. Configure API Keys

  3. Run the Application

    streamlit run ai_tic_tac_toe_agent.py
    
  4. Using the Interface

    • Enter your API keys in the sidebar
    • Click "Start Game" to begin
    • Watch as the AI agents battle it out!
    • Monitor the game progress and final results

Game Components 🎯

  • Game Board

    • 3x3 interactive grid
    • Real-time move visualization
    • Clear symbol placement (X/O)
  • AI Players

    • Player X (GPT-4o): Strategic offensive moves
    • Player O (DeepSeek/Gemini): Defensive countermoves since this agent started later
    • AI Judge: Game outcome validation
  • Game Flow

    • Alternating turns between AIs
    • Move validation and error handling
    • Winner determination
    • Draw detection

Disclaimer ⚠️

This is a demonstration project showcasing AI capabilities in game playing. API costs will apply based on your usage of the OpenAI, DeepSeek, or Google APIs.