Coder Social home page Coder Social logo

tobiasbueschel / search-gpt Goto Github PK

View Code? Open in Web Editor NEW
160.0 7.0 18.0 1.26 MB

๐ŸŒณ Connecting ChatGPT with the Internet

Home Page: https://www.npmjs.com/package/search-gpt

License: MIT License

JavaScript 100.00%
chat-gpt chatgpt google-search chatbot

search-gpt's Introduction


SearchGPT

SearchGPT

Connecting ChatGPT with the Internet



You want to try ChatGPT with Internet connectivity so that you can ask about events beyond 2021, but don't have access to AI-enabled Bing and don't want to wait for Google's Bard? SearchGPT gives you this functionality today - it crawls the Internet for information and then feeds it back to ChatGPT.

SearchGPT Demo

Usage

The easiest way to get started with search-gpt is to run the following:

export OPENAI_API_KEY=<REPLACE>
export GOOGLE_SEARCH_API_KEY=<REPLACE>
export GOOGLE_SEARCH_ID=<REPLACE>

npx search-gpt

Alternatively, you can also run:

npm install --global search-gpt

# Run SearchGPT with this command
searchgpt

Ensure you have your own Google Search API key, Programmable Search Engine and OpenAI API key before running the CLI.

Once the CLI starts, it will prompt you to enter a question. Simply type in your query, and the AI assistant will search the web and generate a response.

How it works

This is a proof of concept and is far from a proper implementation (e.g., Microsoft's Prometheus Model) - I wanted to experiment how easy it could be to crawl certain search engines and then feed these results into a large language model (LLM) such as GPT 3.5. Apart from querying Google Search, one could also think about integrating other APIs to crawl data and then feed it into the LLM.

flowchart LR
  A[User enters question] --> B[Search Google]
  A --> C[Search Twitter, not implemented yet]
  A --> D[Search other engines]
  B --> E[Search results handed to ChatGPT]
  E --> F[ChatGPT uses this context to provide an answer]

Please note: the current implementation feeds Google Search results to gpt-3.5-turbo and does not include previous messages in subsequent queries to avoid surpassing the token limit.

License

This project is licensed under the MIT license.

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.