@modelfusion/serpapi-tool
TypeScript icon, indicating that this package has built-in type declarations

0.11.0 • Public • Published

SerpAPI WebSearch Tool for ModelFusion

SerpAPI is a service that provides search results from Google, Bing, and other search engines. Currently only the Google search is supported as a tool.

Requirements

Setup

  1. Sign up at SerpAPI and get an API key.

  2. Install the SerpAPI tools for ModelFusion:

    npm i @modelfusion/serpapi-tool
    
  3. Add your SERPAPI_API_KEY to your environment variables or .env file.

Usage

Creating a SerpAPI Google Search Tool

import { SerpapiGoogleWebSearchTool } from "@modelfusion/serpapi-tool";

const websearchTool = new SerpapiGoogleWebSearchTool({
  name: "websearch",
  description: "Search the web.",
  num: 3,
});

You can then use the tool with runTool or executeTool:

const result = await executeTool(websearchTool, {
  query: "modelfusion",
});

Package Sidebar

Install

npm i @modelfusion/serpapi-tool

Weekly Downloads

5

Version

0.11.0

License

MIT

Unpacked Size

9.35 kB

Total Files

9

Last publish

Collaborators

  • lgrammel