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
Last synced: 1 day 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 (6 months ago)
- Default Branch: main
- Last Pushed: 2024-05-31T09:06:05.000Z (6 months ago)
- Last Synced: 2024-05-31T21:49:39.049Z (6 months ago)
- Language: Python
- Size: 88.9 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
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
![Chatbot-childish](chatbot-childish.png)* Personality: Rude
![Chatbot-rude](chatbot-rude.png)* Personality: Nice, Helpful (Default)
![Chatbot-helpful](chatbot-helpful.png)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.