0.10.0 • Published 1 year ago

@modelfusion/google-custom-search-tool v0.10.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Google Custom Search Tool for ModelFusion

Google Custom Search lets you create programmable search engines that are limited to a subset of the web (e.g. a domain or a set of domains) and access the results via an API.

Requirements

Setup

  1. Create a Google Custom Search Engine.
  2. Record the Search Engine ID.
  3. Get an API Key. You will need to create a Google Cloud Platform project and enable the Custom Search API.
  4. Install the Google custom search tool for ModelFusion:

    npm i @modelfusion/google-custom-search-tool
  5. Add GOOGLE_CUSTOM_SEARCH_API_KEY with your API key to your environment variables or .env file.

Usage

Creating a Custom Google Search Tool

import { GoogleCustomSearchTool } from "@modelfusion/google-custom-search-tool";

const searchWikipedia = new GoogleCustomSearchTool({
  name: "search_wikipedia",
  description: "Search Wikipedia pages using a query",
  searchEngineId: "76fe2b5e95a3e4215", // replace with your search engine id
  maxResults: 5,
});

You can then use the tool with runTool or executeTool:

const result = await executeTool(searchWikipedia, {
  query: "Pablo Picasso",
});
0.10.0

1 year ago

0.9.0

2 years ago

0.8.0

2 years ago

0.7.0

2 years ago

0.6.0

2 years ago

0.5.0

2 years ago

0.4.0

2 years ago

0.3.0

2 years ago

0.2.0

2 years ago

0.1.0

2 years ago