ForestHub SDK 0.1.0
C++14 LLM SDK for PC and embedded platforms
Loading...
Searching...
No Matches
handoff.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: AGPL-3.0-only
2// Copyright (c) 2026 ForestHub. All rights reserved.
3// For commercial licensing, visit https://github.com/ForestHubAI/fh-sdk
4
5#ifndef FORESTHUB_AGENT_HANDOFF_HPP
6#define FORESTHUB_AGENT_HANDOFF_HPP
7
10
11#include <memory>
12#include <string>
13#include <utility>
14
19
20namespace foresthub {
21namespace agent {
22
23using json = nlohmann::json;
24
27public:
28 std::shared_ptr<Agent> target_agent;
30
36 Handoff(std::string name, std::string description, std::shared_ptr<Agent> agent,
38 : target_agent(std::move(agent)), model(std::move(model)) {
39 this->name = std::move(name);
40 this->description = std::move(description);
41
42 parameters = json{{"type", "object"}, {"properties", json::object()}};
43 }
44
47};
48
55inline std::shared_ptr<Handoff> NewHandoff(std::string name, std::string description, std::shared_ptr<Agent> agent,
56 core::ModelID model = "") {
57 return std::make_shared<Handoff>(std::move(name), std::move(description), std::move(agent), std::move(model));
58}
59
60} // namespace agent
61} // namespace foresthub
62
63#endif // FORESTHUB_AGENT_HANDOFF_HPP
Agent with instructions, tools, and optional response format.
std::shared_ptr< Agent > target_agent
Agent to switch to when invoked.
Definition handoff.hpp:28
core::ModelID model
Optional model override (empty = use runner default).
Definition handoff.hpp:29
Handoff(std::string name, std::string description, std::shared_ptr< Agent > agent, foresthub::core::ModelID model="")
Construct a handoff tool that transfers control to the given target agent.
Definition handoff.hpp:36
core::ToolType GetToolType() const override
Identifies this tool as a handoff.
Definition handoff.hpp:46
Base implementation of ExternalTool with name, description, and parameters.
Definition tools.hpp:132
std::string description
Human-readable description sent to the LLM.
Definition tools.hpp:135
json parameters
JSON schema defining expected parameters.
Definition tools.hpp:136
std::string name
Tool name sent to the LLM.
Definition tools.hpp:134
Wrapper for nlohmann/json that works around abs macro conflicts.
Model metadata and capability identifiers.
Agent framework: multi-turn execution with tool calling and handoffs.
std::shared_ptr< Handoff > NewHandoff(std::string name, std::string description, std::shared_ptr< Agent > agent, core::ModelID model="")
Create a new Handoff tool.
Definition handoff.hpp:55
ToolType
Type discriminator for Tool subclasses.
Definition tools.hpp:29
@ kHandoff
Agent handoff tool.
Definition tools.hpp:32
std::string ModelID
Unique identifier for an LLM model.
Definition model.hpp:23
Top-level namespace for the ForestHub SDK.
Tool system: ExternalTool, FunctionTool, WebSearch, and tool call types.