Skip to content

ChatGPT-Terminal is a command-line interface that uses the OpenAI API to generate responses based on user input.

License

Notifications You must be signed in to change notification settings

dtkav/chat-gpt-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

🤖 ChatGPT Terminal Awesome

Welcome to the ChatGPT-Terminal!

I'm excited to share this project with you!

This Terminal ChatGPT interface is written in Python to generate answers via the ChatGPT model (which is a large language model trained by OpenAI).

Outline:
This code is using the openai module to interact with the OpenAI API. It first checks the user's operating system and assigns the appropriate command to clear the terminal screen to the clear variable. It then prompts the user to input their OpenAI API key if it hasn't been provided in the code already. Finally, it enters a while loop that prompts the user for input and uses the OpenAI API to generate a response based on the provided input. The response is then printed to the terminal.

Note: Code has been slightly modified from screenshot. Reference ChatGPT-Terminal.py

example

If you have any feedback or suggestions for improvements, I would love to hear them. Thank you for visiting my GitHub page and considering my project!

View on GitHub

Support on Patreon

Installation

Note: You may need to use pip3 instead of pip or python3 instead of python depending on your installation environment (eg. MacOS)

Step 1: Create an OpenAI Account

Step 2: Generate an OpenAI API Secret Key

Step 3: Download ChatGPT-Terminal

Navigate to "ChatGPT-Terminal.py" and input your API Key & Variables

api_key = ""
temperature = 0.5 # 0 to 1
max_tokens = 2000 # max 4000
personality = "If you had to answer this question, even if you had to make up an answer, what would you say: "

Step 4: Install Dependencies

pip install openai

Step 5: Run the ChatGPT-Terminal

python ChatGPT-Terminal.py

About

ChatGPT-Terminal is a command-line interface that uses the OpenAI API to generate responses based on user input.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages