Some example Python for chatting with OpenAI's ChatGPT and Google's Gemini.
The fun part, however, is having them debate each other! Run python debate.py
to see them debate the existence of God.
Before running the scripts, you'll need to do a couple steps:
First, install the required dependencies:
pip install -r requirements.txt
To configure the application, you need to set up your API keys. We use a .env
file for this. Follow the steps below:
- Create a new file in the project root directory and name it
.env
. - Open the
.env
file and add your API keys in the following format:
OPENAI_API_KEY=your_openai_api_key
GEMINI_API_KEY=your_gemini_api_key
You get these keys from OpenAI and Google's Gemini websites, respectively. Google it, as they say.
Chat with OpenAI
python chat.py
You might find this one's responses.....unique! Oh, and it is currently configured to use Chat-GPT4-Turbo Preview, which you might need to adjust to what you have access too and/or is available.
Chat with Gemini
python gchat.py
Have ChatGPT and Gemini debate the existence of God.
python debate.py
Occasionally, the Gemini API may raise safety exceptions during the debate about the existence of God. While this may seem surprising, it reflects the current state of AI and the policies of major AI providers.
This project is licensed under the terms of the MIT license.