Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/szilvia-csernus/command-line-chatbot
Basic command line chatbot, written in Python, using the OpenAI ChatGPT-3.5-turbo LLM API.
https://github.com/szilvia-csernus/command-line-chatbot
openai-api python
Last synced: about 1 month ago
JSON representation
Basic command line chatbot, written in Python, using the OpenAI ChatGPT-3.5-turbo LLM API.
- Host: GitHub
- URL: https://github.com/szilvia-csernus/command-line-chatbot
- Owner: szilvia-csernus
- Created: 2024-05-30T17:57:49.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-07-06T02:13:18.000Z (8 months ago)
- Last Synced: 2024-12-06T19:19:45.371Z (3 months ago)
- Topics: openai-api, python
- Language: Python
- Homepage:
- Size: 89.8 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Chatbot
Command line chatbot, written in Python, using the OpenAI ChatGPT 3.5-turbo LLM.
* Personality: Childish
* Personality: Rude
* Personality: Nice, Helpful (Default)
The maximum token number is set to 50, which can be changed in the code.
---
## How to run this project?
0. Prerequisites:
- Make sure Python3 is installed.
- If you don't have an account with OpenAI, create one here: https://openai.com/
- Create a project API key under Dashboard / API keys1. Clone the project.
2. Create a virtual environment inside the project folder:
`python -m venv venv`
3. Activate the virtual environment:
Mac: `source venv/bin/activate`
Windows: `venv\Scripts\activate`
4. Create an `.env` file in the root folder and add your project's API key:
`OPENAI_API_KEY=your-unique-opanai-project-key`
5. Install the python dependencies:
`pip install -r requirements.txt`
6. Run the project:
- with default personality (nice, helpful): `python chatbot.py`
- with the personality flag: `python chatbot.py --personality "childish"`## Credit
This project was adopted from Colt Steele's Walkthrough project on Udemy: [Mastering OpenAI Python APIs](https://www.udemy.com/course/mastering-openai/?couponCode=24T3MT53024).
Changes made: API calls have been updated as per the latest documentation.