Agents 1.4.0
Edge AI Agents SDK
Loading...
Searching...
No Matches
agents Namespace Reference

Framework Namespace. More...

Namespaces

namespace  llms
 Large Language Models Namespace.
namespace  media
 Media envelope namespace.
namespace  tools
 Tools Namespace.
namespace  workflows
 Worflows Namespace.

Classes

class  Agent
 Interface for agents. More...
class  ActorAgent
 Actor-based agent implementation. More...
class  AutonomousAgent
 An agent that operates autonomously to complete a task. More...
struct  VoiceConfig
 Configuration for the VoicePipeline. More...
class  VoiceAgent
 Voice agent that inherits from AutonomousAgent and adds voice capabilities. More...
class  ConfigLoader
 A utility class to load and access configuration values from .env files. More...
class  Context
 Context for an agent, containing tools, LLM, and memory. More...
class  Task
 Standard C++20 coroutine-based Task implementation. More...
class  Task< void >
 Task specialization for void. More...
class  AsyncGenerator
 AsyncGenerator with a Folly-compatible API: next() returns Task<optional<T>>. More...
class  Executor
 A minimal executor implementation (fire-and-forget). More...
class  HTTPClient
 Thin HTTP Client wrapper for internal use. More...
struct  LLMOptions
 Options for LLM API calls. More...
class  LLMInterface
 Interface for language model providers (OpenAI, Anthropic, Google, Ollama). More...
class  Logger
 Logger utility class that wraps spdlog functionality. More...
class  Memory
 Interface for agent memory storage. More...
struct  AudioFormat
 Audio format specification for live AI sessions. More...
struct  LiveSessionConfig
 Configuration for live AI sessions. More...
class  ILiveClient
 Abstract interface for live real-time AI clients. More...
struct  ToolResult
 Result of a tool execution. More...
struct  ToolError
 A ToolResult that represents a failure. More...
class  Tool
 Interface for tools that an agent can use. More...
class  MCPTool
 Interface for tools that an agent can use. More...
struct  Parameter
 Parameter type for tools and LLM calls. More...
struct  LLMResponse
 Response from an LLM. More...
struct  Message
 Message in a conversation. More...
struct  mcpConfig
 MCP server config. More...
class  Utils
 Utility class providing static helper functions. More...
struct  VoiceCallbacks
 Callbacks for voice events. More...
class  VoicePipeline
 VoicePipeline class for push-to-talk speech-to-text. More...
struct  SttCallbacks
 Callbacks for STT events. More...
struct  SttConfig
 Configuration for the STT Service. More...
class  ISttService
 Interface for the STT Engine. Pure virtual class to enforce ABI boundaries. More...

Typedefs

using ToolCallback = std::function<ToolResult(const JsonObject&)>
 Callback type for tool execution.
using JsonObject = nlohmann::json
 JSON object type.
using JsonArray = nlohmann::json::array_t
 JSON array type.
using ParameterMap = std::map<std::string, Parameter>
 Parameter map type.
using ToolCalls = std::vector<std::pair<std::string, JsonObject>>
 Tool calls type.

Enumerations

enum class  TransportProtocol {
  WEBSOCKET ,
  WEBRTC ,
  HTTP_STREAM ,
  CUSTOM
}
 Transport protocol types for live AI communication. More...
enum class  MemoryType {
  SHORT_TERM ,
  LONG_TERM ,
  WORKING
}
 Memory types. More...

Functions

template<typename T>
blockingWait (Task< T > &&task)
 Helper to run a coroutine and get the result synchronously.
void blockingWait (Task< void > &&task)
 Helper to run a coroutine and get the result synchronously.
template<typename T>
Task< std::vector< T > > collectAllFromGenerator (AsyncGenerator< T > &&generator)
 Helper to collect all results from an AsyncGenerator.
template<typename T>
std::vector< T > collectAll (AsyncGenerator< T > &&generator)
 Helper to run an async generator and collect results.
ExecutorgetExecutor ()
 Get a global executor.
std::shared_ptr< LLMInterfacecreateLLM (const std::string &provider, const std::string &api_key, const std::string &model="")
 Factory function to create a specific LLM provider.
std::shared_ptr< MemorycreateMemory ()
 Create a Memory instance.
std::shared_ptr< ToolcreateTool (const std::string &name, const std::string &description, const std::vector< Parameter > &parameters, ToolCallback callback)
 Create a custom tool with a name, description, parameters, and callback.
std::shared_ptr< ToolcreateMCPTool (const std::string &name, const std::string &description, const std::vector< Parameter > &parameters, const mcpConfig &mcpConfig, ToolCallback callback)
 Create a custom tool with a name, description, parameters, and callback.

Detailed Description

Framework Namespace.

Typedef Documentation

◆ JsonArray

using agents::JsonArray = nlohmann::json::array_t

JSON array type.

Note
This is a JSON array type. It contains the JSON array.

◆ JsonObject

◆ ParameterMap

using agents::ParameterMap = std::map<std::string, Parameter>

Parameter map type.

Note
This is a parameter map type. It contains the string and parameter.

◆ ToolCallback

using agents::ToolCallback = std::function<ToolResult(const JsonObject&)>

Callback type for tool execution.

Note
This is the callback type for tool execution. It is a function that takes a json object and returns a tool result.

◆ ToolCalls

using agents::ToolCalls = std::vector<std::pair<std::string, JsonObject>>

Tool calls type.

Note
This is a tool calls type. It contains the tool name and parameters.

Enumeration Type Documentation

◆ MemoryType

enum class agents::MemoryType
strong

Memory types.

Note
This is a type of memory. It contains the type of memory, the name of the memory, and the content of the memory.
Enumerator
SHORT_TERM 

Short term memory.

LONG_TERM 

Long term memory.

WORKING 

Working memory.

◆ TransportProtocol

enum class agents::TransportProtocol
strong

Transport protocol types for live AI communication.

Different protocols offer different trade-offs in terms of latency, reliability, and browser compatibility.

Enumerator
WEBSOCKET 

WebSocket-based communication (high compatibility, medium latency).

WEBRTC 

WebRTC-based communication (low latency, requires ICE servers).

HTTP_STREAM 

HTTP streaming (fallback option, high latency).

CUSTOM 

Custom protocol implementation.

Function Documentation

◆ blockingWait() [1/2]

template<typename T>
T agents::blockingWait ( Task< T > && task)

Helper to run a coroutine and get the result synchronously.

Template Parameters
TThe type of the result
Parameters
taskThe task to run
Returns
The result of the task
Examples
actor_agent_example.cpp, autonomous_agent_example.cpp, coroutine_example.cpp, multimodal_example.cpp, robotics_object_detection_demo.cpp, simple_agent.cpp, and streaming_chat.cpp.

◆ blockingWait() [2/2]

void agents::blockingWait ( Task< void > && task)
inline

Helper to run a coroutine and get the result synchronously.

Parameters
taskThe task to run

◆ collectAll()

template<typename T>
std::vector< T > agents::collectAll ( AsyncGenerator< T > && generator)

Helper to run an async generator and collect results.

Template Parameters
TThe type of the result
Parameters
generatorThe generator to collect results from
Returns
The results of the generator

◆ collectAllFromGenerator()

template<typename T>
Task< std::vector< T > > agents::collectAllFromGenerator ( AsyncGenerator< T > && generator)

Helper to collect all results from an AsyncGenerator.

Template Parameters
TThe type of the result
Parameters
generatorThe generator to collect results from
Returns
The results of the generator

◆ createLLM()

std::shared_ptr< LLMInterface > agents::createLLM ( const std::string & provider,
const std::string & api_key,
const std::string & model = "" )

Factory function to create a specific LLM provider.

Parameters
providerOne of: "anthropic", "openai", "google", "ollama"
api_keyAPI key for the provider
modelModel to use (provider-specific)
Returns
The LLMInterface
Examples
actor_agent_example.cpp, autonomous_agent_example.cpp, coroutine_example.cpp, evaluator_optimizer_example.cpp, multimodal_example.cpp, orchestrator_example.cpp, parallel_example.cpp, prompt_chain_example.cpp, robotics_object_detection_demo.cpp, routing_example.cpp, simple_agent.cpp, and streaming_chat.cpp.

◆ createMCPTool()

std::shared_ptr< Tool > agents::createMCPTool ( const std::string & name,
const std::string & description,
const std::vector< Parameter > & parameters,
const mcpConfig & mcpConfig,
ToolCallback callback )

Create a custom tool with a name, description, parameters, and callback.

Parameters
nameThe name of the tool
descriptionThe description of the tool
parametersThe parameters of the tool; can be left empty to auto-discover from mcp server
mcpConfigThe mcp client config
callbackThe callback for the tool
Returns
A shared pointer to the tool

◆ createMemory()

std::shared_ptr< Memory > agents::createMemory ( )

Create a Memory instance.

Returns
The Memory instance

◆ createTool()

std::shared_ptr< Tool > agents::createTool ( const std::string & name,
const std::string & description,
const std::vector< Parameter > & parameters,
ToolCallback callback )

Create a custom tool with a name, description, parameters, and callback.

Parameters
nameThe name of the tool
descriptionThe description of the tool
parametersThe parameters of the tool
callbackThe callback for the tool
Returns
A shared pointer to the tool
Examples
actor_agent_example.cpp, and autonomous_agent_example.cpp.

◆ getExecutor()

Executor * agents::getExecutor ( )
inline

Get a global executor.

Returns
Pointer to global executor