Git Product home page Git Product logo

openai-test-bot's Introduction

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 [email protected]:<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.

openai-test-bot's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.