SearchWebTool class

Performs a web search and returns a summary of the top results.

In production, wire up a real search API (SerpAPI, Brave Search, DuckDuckGo Instant Answers, etc.). In testing/offline mode set mockResults to return canned answers.

Inheritance

Constructors

SearchWebTool({String? apiKey, String searchEngineUrl = 'https://api.duckduckgo.com/', List<Map<String, String>>? mockResults, Client? client, ConsciousnessLogger? logger})

Properties

apiKey → String?
final
description → String
One-sentence description included in the system prompt.
no setteroverride
hashCode → int
The hash code for this object.
no setterinherited
inputSchema → Map<String, String>
Schema of expected input keys and their descriptions.
no setteroverride
isIdempotent → bool
Whether this tool can safely be retried on failure.
no setterinherited
name → String
Unique snake_case name the LLM uses to invoke this tool.
no setteroverride
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
searchEngineUrl → String
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
run(Map<String, dynamic> input) → Future<ToolResult>
Executes the tool with the given input map.
override
toString() → String
A string representation of this object.
inherited
validate(Map<String, dynamic> input) → String?
Validates the input map against inputSchema.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited