Welcome to the OpenAI Agents Poker project! This experimental project pits different versions of OpenAI's language models—GPT-3.5, GPT-4, and GPT-4o—against each other in games of Texas Hold'em poker. This README will guide you through the setup, execution, and analysis of the poker games.
The project simulates Texas Hold'em poker games with AI agents representing different OpenAI models. Each agent makes betting decisions based on their understanding of the game state, including their hand, community cards, bet history, and opponent behavior.
To run this project, follow these steps:
-
Clone the repository:
git clone https://github.com/nikogamulin/OpenAI-Agents-Poker.git cd OpenAI-Agents-Poker -
Install dependencies: This project requires Python 3.8+ and several Python packages. Install the required packages using pip:
pip install -r requirements.txt
-
Set up environment variables: Create a
.envfile in the root directory and add your OpenAI API key:OPENAI_API_KEY=your_openai_api_key
To start the poker simulation, execute the poker_agents.py script:
python poker_agents.pyThis script initializes the game, assigns roles to the players, deals cards, and simulates betting rounds until a winner is determined. The game results and players' reasoning are saved in a specified folder.
The project includes Jupyter notebooks for analyzing the results of the games. These notebooks are located in the notebooks directory. Before analyzing your own data, ensure that you have run the games and generated the necessary game logs.