Skip to content

horacio-gaido/chatgpt_api.py

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

ChatGPT API in Python

This project is an example of how to use the OpenAI API to create a chatbot using the GPT-3.5 Turbo model. The application is written in Python and utilizes the OpenAI, Typer, and Rich libraries. The creator of this code is MoureDev. The following is the link of the tutorial and the author's contacts: https://moure.dev/

Crea una APP con PYTHON y CHATGPT desde cero: https://www.youtube.com/watch?v=b8COygWdvmw

Installation

To install the necessary libraries, run the following command:

pip install openai typer[all] rich

Creating a Python Virtual Environment

Windows

  1. Open the command prompt by typing "cmd" in the search bar and pressing Enter.
  2. Navigate to the directory where you want to create your virtual environment using the cd command.
  3. Type the following command to create a virtual environment with the name "myenv":
python -m venv myenv
  1. Activate the virtual environment by running the activate script:
myenv\Scripts\activate

You can now install packages and run Python scripts within the virtual environment. To exit the virtual environment, simply type:

deactivate

Mac

  1. Open the Terminal application.
  2. Navigate to the directory where you want to create your virtual environment using the cd command.
  3. Type the following command to create a virtual environment with the name "myenv":
python3 -m venv myenv
  1. Activate the virtual environment by running the activate script:
source myenv/bin/activate

You can now install packages and run Python scripts within the virtual environment. To exit the virtual environment, simply type:

deactivate

The application will prompt you for input and respond with generated text based on the GPT-3.5 model. Use the exit command to quit the application or new to start a new conversation.

Useful links

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages