forgeant docs-test-0
Build LLM-powered agents in C++
Loading...
Searching...
No Matches
forgeant Namespace Reference

Namespaces

namespace  detail
 
namespace  json
 

Classes

class  Agent
 
struct  AgentOptions
 
struct  AgentResult
 
class  AgentRunError
 
class  AnthropicProvider
 
struct  ChatRequest
 
class  Conversation
 
class  CurlHttpClient
 
class  HttpClient
 
struct  HttpResponse
 
class  Json
 
class  LlmProvider
 
struct  LlmResponse
 
struct  Message
 
class  OpenAiProvider
 
struct  ParamSchema
 
struct  ParamSchema< bool >
 
struct  ParamSchema< double >
 
struct  ParamSchema< int >
 
struct  ParamSchema< std::string >
 
struct  ProviderConfig
 
struct  RunOverrides
 
class  Schema
 
class  SchemaBuilder
 
struct  StructuredConfig
 
struct  TextBlock
 
struct  Tool
 
class  ToolRegistry
 
struct  ToolResultBlock
 
struct  ToolUseBlock
 
struct  ToolView
 
struct  Usage
 

Typedefs

using HttpHeaders = std::unordered_map< std::string, std::string >
 
using StreamCallback = std::function< bool(std::string_view)>
 
using ContentBlock = std::variant< TextBlock, ToolUseBlock, ToolResultBlock >
 

Enumerations

enum class  Role : std::uint8_t { system , user , assistant , tool }
 

Functions

Json extract_json_from_response (const LlmResponse &response)
 
template<typename T >
AgentResult< T > structured (LlmProvider &provider, Conversation working, StructuredConfig config={})
 
template<typename Params , typename Func >
Tool make_tool (std::string name, std::string description, Func &&func)
 
void to_json (Json &j, const TextBlock &block)
 
void from_json (const Json &j, TextBlock &block)
 
void to_json (Json &j, const ToolUseBlock &block)
 
void from_json (const Json &j, ToolUseBlock &block)
 
void to_json (Json &j, const ToolResultBlock &block)
 
void from_json (const Json &j, ToolResultBlock &block)
 
void to_json (Json &j, const ContentBlock &block)
 
void from_json (const Json &j, ContentBlock &block)
 
void to_json (Json &j, const Conversation &conv)
 
void from_json (const Json &j, Conversation &conv)
 
void to_json (Json &j, const Message &msg)
 
void from_json (const Json &j, Message &msg)
 
void to_json (Json &j, Role role)
 
void from_json (const Json &j, Role &role)
 
std::string_view version_string () noexcept
 

Variables

constexpr int VERSION_MAJOR = 0
 
constexpr int VERSION_MINOR = 2
 
constexpr int VERSION_PATCH = 0
 

Typedef Documentation

◆ ContentBlock

◆ HttpHeaders

using forgeant::HttpHeaders = typedef std::unordered_map<std::string, std::string>

◆ StreamCallback

using forgeant::StreamCallback = typedef std::function<bool(std::string_view)>

Enumeration Type Documentation

◆ Role

enum class forgeant::Role : std::uint8_t
strong
Enumerator
system 
user 
assistant 
tool 

Function Documentation

◆ extract_json_from_response()

Json forgeant::extract_json_from_response ( const LlmResponse response)

◆ from_json() [1/7]

void forgeant::from_json ( const Json j,
ContentBlock block 
)

◆ from_json() [2/7]

void forgeant::from_json ( const Json j,
Conversation conv 
)

◆ from_json() [3/7]

void forgeant::from_json ( const Json j,
Message msg 
)

◆ from_json() [4/7]

void forgeant::from_json ( const Json j,
Role role 
)

◆ from_json() [5/7]

void forgeant::from_json ( const Json j,
TextBlock block 
)

◆ from_json() [6/7]

void forgeant::from_json ( const Json j,
ToolResultBlock block 
)

◆ from_json() [7/7]

void forgeant::from_json ( const Json j,
ToolUseBlock block 
)

◆ make_tool()

template<typename Params , typename Func >
Tool forgeant::make_tool ( std::string  name,
std::string  description,
Func &&  func 
)

◆ structured()

template<typename T >
AgentResult< T > forgeant::structured ( LlmProvider provider,
Conversation  working,
StructuredConfig  config = {} 
)

◆ to_json() [1/7]

void forgeant::to_json ( Json j,
const ContentBlock block 
)

◆ to_json() [2/7]

void forgeant::to_json ( Json j,
const Conversation conv 
)

◆ to_json() [3/7]

void forgeant::to_json ( Json j,
const Message msg 
)

◆ to_json() [4/7]

void forgeant::to_json ( Json j,
const TextBlock block 
)

◆ to_json() [5/7]

void forgeant::to_json ( Json j,
const ToolResultBlock block 
)

◆ to_json() [6/7]

void forgeant::to_json ( Json j,
const ToolUseBlock block 
)

◆ to_json() [7/7]

void forgeant::to_json ( Json j,
Role  role 
)

◆ version_string()

std::string_view forgeant::version_string ( )
noexcept

Variable Documentation

◆ VERSION_MAJOR

constexpr int forgeant::VERSION_MAJOR = 0
inlineconstexpr

◆ VERSION_MINOR

constexpr int forgeant::VERSION_MINOR = 2
inlineconstexpr

◆ VERSION_PATCH

constexpr int forgeant::VERSION_PATCH = 0
inlineconstexpr