https://github.com/tankibaj/chatgpt-py
A simple Python script that allows users to interact with the OpenAI GPT API and remembers the conversation history.
https://github.com/tankibaj/chatgpt-py
Last synced: 5 months ago
JSON representation
A simple Python script that allows users to interact with the OpenAI GPT API and remembers the conversation history.
- Host: GitHub
- URL: https://github.com/tankibaj/chatgpt-py
- Owner: tankibaj
- Created: 2023-03-09T00:11:40.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-03-22T17:45:06.000Z (over 2 years ago)
- Last Synced: 2025-02-17T21:38:01.755Z (8 months ago)
- Language: Python
- Size: 27.3 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ChatGPT-Py
A simple Python script that allows users to interact with the OpenAI GPT API and remembers the conversation history.

This script uses the OpenAI API to generate responses to user prompts and keeps track of the conversation history in a list. When the user inputs `history`, the script prints the entire conversation history. The script uses the OpenAI API key stored in the `OPENAI_API_KEY` environment variable, so make sure to set this variable to your API key before running the script.
```bash
export OPENAI_API_KEY=
``````bash
python3 chatgpt.py
```