WebSearchTool

org.llm4s.toolapi.builtin.search.WebSearchTool
object WebSearchTool

Tool for web searching using DuckDuckGo's Instant Answer API.

This tool provides quick answers and definitions without requiring an API key. It's best suited for factual queries, definitions, and quick lookups.

Note: This uses DuckDuckGo's free Instant Answer API which provides:

  • Definitions from Wikipedia
  • Quick facts
  • Related topics
  • Disambiguation pages

It does NOT provide full web search results (that would require a paid API).

Attributes

Example
{
import org.llm4s.toolapi.builtin.search._
val searchTool = WebSearchTool.create()
val tools = new ToolRegistry(Seq(searchTool))
agent.run("What is Scala programming language?", tools)

}

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def create(config: WebSearchConfig): ToolFunction[Map[String, Any], WebSearchResult]

Create a web search tool with the given configuration.

Create a web search tool with the given configuration.

Attributes

Concrete fields

val tool: ToolFunction[Map[String, Any], WebSearchResult]

Default web search tool with standard configuration.

Default web search tool with standard configuration.

Attributes