NeoGraph 0.10.0
A C++17 Graph Agent Engine Library — LangGraph for C++
Loading...
Searching...
No Matches
tool.h
Go to the documentation of this file.
1
8#pragma once
9
10#include <neograph/api.h>
11#include <neograph/types.h>
12
13#include <asio/awaitable.hpp>
14
15#include <string>
16
17namespace neograph {
18
28class NEOGRAPH_API Tool {
29 public:
30 virtual ~Tool() = default;
31
41 virtual ChatTool get_definition() const = 0;
42
48 virtual std::string execute(const json& arguments) = 0;
49
54 virtual std::string get_name() const = 0;
55};
56
88class NEOGRAPH_API AsyncTool : public Tool {
89 public:
95 virtual asio::awaitable<std::string> execute_async(const json& arguments) = 0;
96
101 std::string execute(const json& arguments) final;
102};
103
104} // namespace neograph
NEOGRAPH_API export/import macro for shared-library builds.
Adapter base class for tools whose work is naturally coroutine-shaped (HTTP fetch,...
Definition tool.h:88
virtual asio::awaitable< std::string > execute_async(const json &arguments)=0
Async work — override this.
std::string execute(const json &arguments) final
Sync facade — drives execute_async on a private io_context.
Abstract base class for tools that agents can call.
Definition tool.h:28
virtual std::string execute(const json &arguments)=0
Execute the tool with the given arguments.
virtual std::string get_name() const =0
Get the tool name.
virtual ChatTool get_definition() const =0
Get the tool definition metadata.
Tool definition metadata sent to the LLM.
Definition types.h:51
Foundation types for NeoGraph: messages, tool calls, and LLM completions.