ForestHub SDK 0.1.0
C++14 LLM SDK for PC and embedded platforms
Loading...
Searching...
No Matches
foresthub::agent::Agent Class Reference

LLM agent with instructions, tools, and optional response format. More...

#include <agent.hpp>

Public Member Functions

 Agent (std::string name)
 Construct an agent with the given display name.
AgentWithInstructions (std::string instructions)
 Set the system prompt for this agent.
AgentWithResponseFormat (core::ResponseFormat format)
 Set the structured output format.
AgentWithOptions (core::Options options)
 Set generation parameters (temperature, max_tokens, etc.).
AgentWithTools (std::vector< std::shared_ptr< core::Tool > > tools)
 Replace all tools with the given list.
AgentAddTool (std::shared_ptr< core::Tool > tool)
 Append a tool to the agent's tool list.
std::shared_ptr< core::ExternalToolFindExternalTool (const std::string &name) const
 Search for an ExternalTool by name within the agent's tools.
std::shared_ptr< core::ToolAsTool (std::string tool_name, std::string description, const std::shared_ptr< Runner > &runner)
 Convert this agent into a tool that other agents can invoke.
const std::string & name () const
const std::string & instructions () const
const foresthub::Optional< core::ResponseFormat > & response_format () const
const core::Optionsoptions () const
const std::vector< std::shared_ptr< core::Tool > > & tools () const

Detailed Description

LLM agent with instructions, tools, and optional response format.

Member Function Documentation

◆ AsTool()

std::shared_ptr< core::Tool > foresthub::agent::Agent::AsTool ( std::string tool_name,
std::string description,
const std::shared_ptr< Runner > & runner )

Convert this agent into a tool that other agents can invoke.

When called, the tool runs this agent via the given runner.

Parameters
tool_nameTool name visible to the LLM.
descriptionHuman-readable description sent to the LLM.
runnerRunner instance used to execute this agent.
Returns
A Tool wrapping this agent as a callable handoff.

◆ FindExternalTool()

std::shared_ptr< core::ExternalTool > foresthub::agent::Agent::FindExternalTool ( const std::string & name) const

Search for an ExternalTool by name within the agent's tools.

Parameters
nameTool name to search for (exact match).
Returns
Matching tool, or nullptr if not found.

◆ instructions()

const std::string & foresthub::agent::Agent::instructions ( ) const
inline
Returns
System prompt sent to the model.

◆ name()

const std::string & foresthub::agent::Agent::name ( ) const
inline
Returns
Display name for identification.

◆ options()

const core::Options & foresthub::agent::Agent::options ( ) const
inline
Returns
Generation parameters for this agent.

◆ response_format()

const foresthub::Optional< core::ResponseFormat > & foresthub::agent::Agent::response_format ( ) const
inline
Returns
Optional structured output format.

◆ tools()

const std::vector< std::shared_ptr< core::Tool > > & foresthub::agent::Agent::tools ( ) const
inline
Returns
Tools available to this agent.

The documentation for this class was generated from the following file: