GithubHelp home page GithubHelp logo

searchgpt's Introduction

SearchGPT

Bringing the Internet, and Chat AI one step closer

What is SearchGPT?

SearchGPT is a library for using OpenAI's GPT-3 Language Model & Google Search to power a Question-Answering Chatbot similar to that of Bing's assistant that can do external research as needed to help answer questions

How can I try it?

Option 1: Visit the hosted demo @ searchgpt.perrysahnow.com

Option 2: Open in Colab

Option 3:

  1. Clone SearchGPT's git Repo
  2. Using Python 3.9
  3. Setup a python venv (May vary based on your system / IDE)
  4. Run pip install -r requirements.txt (Make sure you install chrome!)
  5. Open examples
  6. Run py cli.py

How does the API Work?

ChatBot

The main API is a ChatBot class of which you can create an instance, and ask questions An example of creating a bot named "Steve" who thought he was voice activated would be the following:

bot = ChatBot("Steven", type="Voice activated search assist chatbot", commands=[SearchCommand()])
bot.ask("What's the weather like right now?")

Commands

Commands help the bot perform actions. two example command are the SearchCommand used for searching google, or the FollowUP command inside the cli.py UI used for asking secondary questions when needed

An example for a fictional home assistant controller would be:

class LightsCommand(Command):
    def getName(cls):
        return "Lights"

    def getDescription(cls):
        return """
           If the user has asked to turn out the lights in a specific room (which must be decided on beforehand, possibly with a followup), use the "[Lights] Off RoomName" Command
           It will always be followed by a "[Lights Response]" command either containing "Success", or an encountered error while disabling lights
           """

    def execute(self, chatbot, data, question):
        if data.split(" ")[0] == "Off":
            # Turn off lights
            return "Success"
        return "Failure, invalid command"

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.