forgeant
docs-test-0
Build LLM-powered agents in C++
Loading...
Searching...
No Matches
registry.hpp
Go to the documentation of this file.
1
#ifndef FORGEANT_TOOL_REGISTRY_HPP
2
#define FORGEANT_TOOL_REGISTRY_HPP
3
4
#include <
forgeant/tool/tool.hpp
>
5
#include <
forgeant/tool/tool_view.hpp
>
6
#include <string>
7
#include <unordered_map>
8
#include <vector>
9
10
namespace
forgeant
{
11
12
class
ToolRegistry
{
13
public
:
14
void
add
(
Tool
tool
);
15
[[
nodiscard
]]
const
Tool
&
get
(
const
std::string& name)
const
;
16
[[
nodiscard
]]
bool
has
(
const
std::string& name)
const
;
17
Json
execute
(
const
std::string& name,
const
Json
&
args
)
const
;
18
[[
nodiscard
]] std::vector<ToolView>
tools
()
const
;
19
[[
nodiscard
]]
size_t
size
()
const
;
20
21
private
:
22
std::unordered_map<std::string, Tool> tools_;
23
};
24
25
}
// namespace forgeant
26
27
#endif
// FORGEANT_TOOL_REGISTRY_HPP
forgeant::Json
Definition
json.hpp:27
forgeant::ToolRegistry
Definition
registry.hpp:12
forgeant::ToolRegistry::execute
Json execute(const std::string &name, const Json &args) const
forgeant::ToolRegistry::get
const Tool & get(const std::string &name) const
forgeant::ToolRegistry::add
void add(Tool tool)
forgeant::ToolRegistry::size
size_t size() const
forgeant::ToolRegistry::tools
std::vector< ToolView > tools() const
forgeant::ToolRegistry::has
bool has(const std::string &name) const
forgeant
Definition
agent.hpp:25
forgeant::Role::tool
@ tool
forgeant::Tool
Definition
tool.hpp:12
tool.hpp
tool_view.hpp
include
forgeant
tool
registry.hpp
Generated by
1.9.8