Agents 0.0.2
Edge AI Agents SDK
Loading...
Searching...
No Matches
web_search_tool.h
1#ifndef AGENTS_CPP_TOOLS_WEB_SEARCH_TOOL_H
2#define AGENTS_CPP_TOOLS_WEB_SEARCH_TOOL_H
3
4#include <agents-cpp/tool.h>
5#include <string>
6#include <memory>
7
8namespace agents {
9namespace tools {
10
14class WebSearchTool : public Tool {
15public:
20
26 ToolResult execute(const JsonObject& params) const override;
27
28private:
32 void setupParameters();
33
39 ToolResult performWebSearch(const String& query) const;
40
46 ToolResult performDuckDuckGoSearch(const String& query) const;
47
48 // For future SerpApi integration
54 ToolResult performSerpApiSearch(const String& query) const;
55
56 // Security validation
62 bool isDangerousQuery(const String& query) const;
63};
64
65} // namespace tools
66} // namespace agents
67
68#endif // AGENTS_CPP_TOOLS_WEB_SEARCH_TOOL_H
Tool(const String &name, const String &description)
Constructor.
ToolResult execute(const JsonObject &params) const override
Execute the Web Search Tool.
WebSearchTool()
Construct a new Web Search Tool object.
Tools Namespace.
Definition file_tool.h:15
Framework Namespace.
Definition agent.h:18
nlohmann::json JsonObject
JSON object type.
Definition types.h:39
std::string String
String type.
Definition types.h:27
Result of a tool execution.
Definition tool.h:22