Agents 0.0.2
Edge AI Agents SDK
|
Actor-based agent implementation. More...
#include <actor_agent.h>
Public Types | |
enum class | State { READY , RUNNING , WAITING , COMPLETED , FAILED , STOPPED } |
Agent execution state. More... | |
Public Member Functions | |
ActorAgent (std::shared_ptr< AgentContext > context) | |
Constructor with agent context. | |
virtual | ~ActorAgent () |
Destructor. | |
void | init () override |
Initialize the agent. | |
Task< JsonObject > | run (const String &task) override |
Run the agent with a task using coroutines. | |
void | stop () override |
Stop the agent. | |
void | provideFeedback (const String &feedback) override |
Provide human feedback. | |
void | setSystemPrompt (const String &system_prompt) |
Set the system prompt for the agent. | |
String | getSystemPrompt () const |
Get the current system prompt. | |
Task< String > | waitForFeedback (const String &message, const JsonObject &context) override |
Wait for feedback using coroutines. | |
void | runAsync (const String &task, std::function< void(const JsonObject &)> callback) |
Run the agent with a callback. | |
std::shared_ptr< AgentContext > | getContext () const |
Get the agent's context. | |
State | getState () const |
Get the agent's current state. | |
void | setOptions (const Options &options) |
Set execution options. | |
const Options & | getOptions () const |
Get execution options. | |
void | setStatusCallback (std::function< void(const String &)> callback) |
Set a callback for status updates. | |
Actor-based agent implementation.
This class implements a flexible agent that can operate autonomously, use tools, and achieve complex tasks.
|
stronginherited |
Agent execution state.
agents::ActorAgent::ActorAgent | ( | std::shared_ptr< AgentContext > | context | ) |
Constructor with agent context.
context | The agent context |
|
inherited |
Get the agent's context.
|
inherited |
Get execution options.
|
inherited |
Get the agent's current state.
String agents::ActorAgent::getSystemPrompt | ( | ) | const |
Get the current system prompt.
|
overridevirtual |
Initialize the agent.
Implements agents::Agent.
|
overridevirtual |
Provide human feedback.
feedback | The feedback to provide |
Reimplemented from agents::Agent.
|
overridevirtual |
Run the agent with a task using coroutines.
task | The task to run |
Implements agents::Agent.
|
inherited |
Run the agent with a callback.
task | The task to run |
callback | The callback to run |
|
inherited |
Set execution options.
options | The execution options |
|
inherited |
Set a callback for status updates.
callback | The callback to set |
void agents::ActorAgent::setSystemPrompt | ( | const String & | system_prompt | ) |
Set the system prompt for the agent.
system_prompt | The system prompt to set |
|
overridevirtual |
Stop the agent.
Reimplemented from agents::Agent.
|
overridevirtual |
Wait for feedback using coroutines.
message | The message to wait for feedback |
context | The context to wait for feedback |
Reimplemented from agents::Agent.