Skip to content

mzbeck/openai-test-bot

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

openai-test-bot

This is a very basic Python bot that uses OpenAI API to query the PyTorch website. You can modify the script to query any other website. This is a very simple example just to get a taste of how easy it is to use OpenAI API. This example is inspired by the OpenAI documentation.

qa-bot-quick-demo.mov

Prerequisites

  • A GitHub Account
  • An Open AI token (can be obtained in your Open AI Account Settings)

How to use

  1. Fork this repo by clicking Fork in the upper-right corner of the home page.

  2. One your computer, open a terminal.

  3. Clone your fork to your computer by running:

    If you are using SSH:

    git clone git@github.com:<path to your fork>.git
    

    If you are using HTTPs:

    git clone https://github.com/<path-to-your-fork>.git
    
  4. Change directory to your fork:

    cd path-to-your-fork
    
  5. Open the script file for editing, for example using vim:

    vi qa-bot-test.py
    
  6. In the script, replace YOUR_API_KEY with the token you have obtained from your OpenAI account.

  7. Save the file:

    :x! 
    
  8. Run the script:

python3 qa-bot-test.py

Response:

What would you like to learn? (type "exit" to quit):
  1. Type your question and receive an answer. For example: How to install PyTorch?
  2. To terminate the bot, type exit.

Troubleshooting

openai.error.RateLimitError: You exceeded your current quota, please check your plan and billing details.

If you see the error above, it means exactly that - you have execeed your current limit and need to either wait or upgrade your account.

About

Open AI test bot

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%