Agents 1.4.0
Edge AI Agents SDK
Loading...
Searching...
No Matches
agents::tools::WebSearchTool Class Reference

Web Search Tool with LLM-powered summarization. More...

#include <web_search_tool.h>

Inheritance diagram for agents::tools::WebSearchTool:
agents::Tool

Public Member Functions

 WebSearchTool (std::shared_ptr< LLMInterface > llm)
 Construct a new Web Search Tool.
ToolResult execute (const JsonObject &params) const override
 Execute the web search.
const std::string & getName () const
 Get the name of the tool.
const std::string & getDescription () const
 Get the description of the tool.
const ParameterMapgetParameters () const
 Get the parameters of the tool.
const JsonObjectgetSchema () const
 Get the schema of the tool.
void addParameter (const Parameter &param)
 Add a parameter to the tool.
void addParametersFromJson (const JsonObject &params)
 Add tool parameters from json definition.
void setCallback (ToolCallback callback)
 Set the execution callback.
bool validateParameters (const JsonObject &params) const
 Validate parameters against schema.

Detailed Description

Web Search Tool with LLM-powered summarization.

This tool performs web searches and returns structured results. The LLM is used to generate natural, contextual summaries of search results.

Constructor & Destructor Documentation

◆ WebSearchTool()

agents::tools::WebSearchTool::WebSearchTool ( std::shared_ptr< LLMInterface > llm)
explicit

Construct a new Web Search Tool.

Parameters
llmShared pointer to LLM interface for generating summaries

Member Function Documentation

◆ addParameter()

void agents::Tool::addParameter ( const Parameter & param)
inherited

Add a parameter to the tool.

Parameters
paramThe parameter to add

◆ addParametersFromJson()

void agents::Tool::addParametersFromJson ( const JsonObject & params)
inherited

Add tool parameters from json definition.

Parameters
paramsThe parameters to add

◆ execute()

ToolResult agents::tools::WebSearchTool::execute ( const JsonObject & params) const
overridevirtual

Execute the web search.

Reimplemented from agents::Tool.

◆ getDescription()

const std::string & agents::Tool::getDescription ( ) const
inherited

Get the description of the tool.

Returns
The description of the tool

◆ getName()

const std::string & agents::Tool::getName ( ) const
inherited

Get the name of the tool.

Returns
The name of the tool

◆ getParameters()

const ParameterMap & agents::Tool::getParameters ( ) const
inherited

Get the parameters of the tool.

Returns
The parameters of the tool

◆ getSchema()

const JsonObject & agents::Tool::getSchema ( ) const
inherited

Get the schema of the tool.

Returns
The schema of the tool

◆ setCallback()

void agents::Tool::setCallback ( ToolCallback callback)
inherited

Set the execution callback.

Parameters
callbackThe callback to set

◆ validateParameters()

bool agents::Tool::validateParameters ( const JsonObject & params) const
inherited

Validate parameters against schema.

Parameters
paramsThe parameters to validate
Returns
true of valid, otherwise false