search

module
v0.0.0-...-bab8211 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 25, 2024 License: Apache-2.0

README

Search Tools for GPTScript

This repo contains search tools for GPTScript. We currently support Bing (web and image), Brave (web and image), DuckDuckGo (web only), and Google (web and image).

Web search output is in the following format:

Title: the title of the web page
URL: the link to the web page
Description: a short snippet from the web page

Image search output is in the following format:

Title: the title of the image
Source: the link to the web page where the image came from
Image URL: the link to the image

For usage examples with GPTScript, see the examples directory.

You are responsible for ensuring that your use of these search APIs with GPTScript does not violate the terms of service of the respective search engines.

Usage

Each of the search tools live in their own subdirectory. They can be referenced like github.com/gptscript-ai/search/<tool>. For example, github.com/gptscript-ai/search/duckduckgo references the DuckDuckGo tool. The options are bing, bing-image, brave, brave-image, duckduckgo, google, and google-image.

gptscript --cache=false github.com/gptscript-ai/search/duckduckgo '{"q":"best AI models for function calling"}'

Specific details and instructions for each search engine follow.

Bing

The bing and bing-image tools return search results from the Bing Web Search API.

The credential tool will ask for your API token.

Brave

The brave and brave-image tools return search results from the Brave Search API.

The credential tool will ask for your API token.

DuckDuckGo

The duckduckgo tool returns search results from the DuckDuckGo HTML-only Site.

No API key is required to use this tool.

By default, this tool will make an HTTP request to DuckDuckGo and parse the results. If you do this enough times, it will start to get rate limited. Rate limits can be more easily avoided by using Google Chrome in headless mode. The tool will do this if the GPTSCRIPT_USE_CHROME environment variable is set to true.

Google

The google and google-image tools return search results from the Google Custom Search JSON API.

The credential tool will ask for your search engine ID and your API token.

Directories

Path Synopsis
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL