Agents 0.0.2
Edge AI Agents SDK
Loading...
Searching...
No Matches
shell_command_tool.h
1
10#pragma once
11
12#include <agents-cpp/tool.h>
13
14namespace agents {
15namespace tools {
16
20class ShellCommandTool : public Tool {
21public:
26
32 ToolResult execute(const JsonObject& params) const override;
33
35protected:
39 void setupParameters();
40
46 bool validateCommand(const String& command) const;
47
53 bool isDangerousCommand(const String& command) const;
54
60 int executeCommand(const String& command) const;
61
68 ToolResult formatCommandResult(const String& command, int exitCode) const;
70};
71
72} // namespace tools
73} // namespace agents
Tool(const String &name, const String &description)
Constructor.
ToolResult execute(const JsonObject &params) const override
Execute the Shell Command Tool.
ShellCommandTool()
Construct a new Shell Command 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