Skip to content

Generative AI Career Track - Class 1 , Lessons 1 - 4

Notifications You must be signed in to change notification settings

skillcrush/chatbot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

Setting up to run scripts using the openai API with Python.

The script will be run in a virtual environment. Start by creating a virtual environment:

On a Mac: python3 -m venv openai-env

On Windows: python -m venv openai-env


After creating the virtual environment, you need to activate it:

On a Mac: source openai-env/bin/activate

On Windows: source openai-env/Scripts/activate


Once the virtual environment is activated, the beginning of your terminal prompt should display **(openai-env)**.
Install the OpenAI API library by running (in both a Mac and Windows):

pip install --upgrade openai

You'll see an openai-env folder has been added to the directory with all of the installed dependencies.


To run your code, in the command line run (change the file name if necessary):

On a Mac: python3 chatbot.py

On Windows: python chatbot.py


When finished, close the virtual environment by running:

deactivate

About

Generative AI Career Track - Class 1 , Lessons 1 - 4

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages