Skip to content

noamelf/openai-quickstart-python

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenAI and FastAPI - Python example app

This is an example pet name generator app used in the OpenAI API quickstart tutorial. It uses the FastAPI web framework.

Setup

  1. If you don’t have Python installed, install it from here.

  2. Clone this repository.

  3. Navigate into the project directory:

    $ cd openai-quickstart-fastapi
  4. Create a new virtual environment:

    # Linux
    $ 
    
    $ . venv/bin/activate
  5. Install the requirements:

    $ pip install -r requirements.txt
  6. Make a copy of the example environment variables file:

    # Linux
    $ cp .env.example .env
  7. Add your API key to the newly created .env file.

  8. Run the app:

    $ python app.py

    demo

You should now be able to access the app at http:https://localhost:5001!

This repogitory is based on the Flask code at openai-quickstart-python. For the full context behind Flask app, check out the Flask tutorial.

Reference

About

Python example app from the OpenAI API quickstart tutorial

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 78.7%
  • CSS 13.5%
  • HTML 6.8%
  • Procfile 1.0%