Skip to content

kikitaMoon/OpenAI-API-my-app

 
 

Repository files navigation

Wow Wow Magical Documentary Super Seeker

Summary

My own version of OpenAI API Quickstart - Python example app

This is an example of documentary film seeker that utilizes OpenAI's GPT-3.5 Turbo model to assist users in finding documentary films made by BBC or National Geographic based on their input queries. The app acts as an intelligent assistant that can understand user requests and provides relevant responses in both Chinese and English. This is also for my little boy.

It is based on the App used in the OpenAI API quickstart tutorial. It uses the Flask web framework. Check out the tutorial or follow the instructions below to get set up.

Look

App Screenshot App Screenshot

Environments

  • OS: Mac 12.6.8
  • Python: 3.11.4 / Flask
  • AnaConda: 4.12

Setup

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

  2. Clone this repo or the original.

  3. Navigate into the project directory:

    $ cd openai-quickstart-python
  4. Create a new virtual environment with AnaConda, e.g. named OpenAI. Activate it:

    (base) mhoehn1:~ kikitamoon$ conda activate OpenAI
    (OpenAI) mhoehn1:~ kikitamoon$ conda env list
    # conda environments:
    #
    base                     /Users/kikitamoon/opt/anaconda3
    OpenAI                *  /Users/kikitamoon/opt/anaconda3/envs/OpenAI
  5. Install the requirements:

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

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

    Alternatively, set System Env Varaibles if you're using Windows. to support the code: openai.api_key = os.getenv("OPENAI_API_KEY")

  8. Run the app:

$ flask run

You should now be able to access the app at http:https://localhost:5000! For the full context behind this example app, check out the tutorial.

See the workflow to understand the necessary steps and quickly get started:

workflow image

About

Python example app from the OpenAI API quickstart tutorial of Sharon's version

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages

  • Python 47.0%
  • CSS 35.4%
  • HTML 17.6%