|
Agents 1.4.0
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< Context > context) | |
| Constructor with agent context. | |
| virtual | ~ActorAgent () |
| Destructor. | |
| void | init () override |
| Initialize the agent. | |
| Task< JsonObject > | run (const std::string &task) override |
| Run the agent with a task using coroutines. | |
| void | stop () override |
| Stop the agent. | |
| void | provideFeedback (const std::string &feedback) override |
| Provide human feedback. | |
| void | setAgentPrompt (const std::string &agent_prompt) |
| Set the agent prompt for the agent. | |
| std::string | getAgentPrompt () const |
| Get the current agent prompt. | |
| Task< std::string > | waitForFeedback (const std::string &message, const JsonObject &context) override |
| Wait for feedback using coroutines. | |
| void | runAsync (const std::string &task, std::function< void(const JsonObject &)> callback) override |
| Run the agent asynchronously with callback. | |
| std::shared_ptr< Context > | 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 std::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< Context > | context | ) |
Constructor with agent context.
| context | The agent context |
| std::string agents::ActorAgent::getAgentPrompt | ( | ) | const |
Get the current agent prompt.
|
inherited |
Get the agent's context.
|
inherited |
Get execution options.
|
inherited |
Get the agent's current state.
|
overridevirtual |
|
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.
|
overridevirtual |
Run the agent asynchronously with callback.
| task | The task to run |
| callback | Callback function to call with result |
Reimplemented from agents::Agent.
| void agents::ActorAgent::setAgentPrompt | ( | const std::string & | agent_prompt | ) |
Set the agent prompt for the agent.
| agent_prompt | The agent prompt to set |
|
inherited |
Set execution options.
| options | The execution options |
|
inherited |
|
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.