|
Agents 1.4.0
Edge AI Agents SDK
|
Interface for agents. More...
#include <agent.h>
Classes | |
| struct | Options |
| Agent execution options. More... | |
Public Types | |
| enum class | State { READY , RUNNING , WAITING , COMPLETED , FAILED , STOPPED } |
| Agent execution state. More... | |
Public Member Functions | |
| Agent (std::shared_ptr< Context > context) | |
| Constructor. | |
| virtual | ~Agent ()=default |
| Destructor. | |
| virtual void | init ()=0 |
| Initialize the agent. | |
| virtual Task< JsonObject > | run (const std::string &task)=0 |
| Run the agent with a task using coroutines. | |
| virtual void | runAsync (const std::string &task, std::function< void(const JsonObject &)> callback) |
| Run the agent with a callback. | |
| virtual void | stop () |
| Stop the agent. | |
| 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. | |
| virtual void | provideFeedback (const std::string &feedback) |
| Provide human feedback. | |
| virtual Task< std::string > | waitForFeedback (const std::string &message, const JsonObject &context) |
| Wait for feedback using coroutines. | |
Interface for agents.
Agents are LLM-powered systems that can use tools and make decisions to accomplish a task.
|
strong |
Agent execution state.
| agents::Agent::Agent | ( | std::shared_ptr< Context > | context | ) |
Constructor.
| context | The agent context |
| std::shared_ptr< Context > agents::Agent::getContext | ( | ) | const |
Get the agent's context.
| const Options & agents::Agent::getOptions | ( | ) | const |
Get execution options.
| State agents::Agent::getState | ( | ) | const |
Get the agent's current state.
|
pure virtual |
Initialize the agent.
Implemented in agents::ActorAgent, agents::AutonomousAgent, and agents::VoiceAgent.
|
virtual |
Provide human feedback.
| feedback | The feedback to provide |
Reimplemented in agents::ActorAgent, and agents::AutonomousAgent.
|
pure virtual |
Run the agent with a task using coroutines.
| task | The task to run |
Implemented in agents::ActorAgent, and agents::AutonomousAgent.
|
virtual |
Run the agent with a callback.
| task | The task to run |
| callback | The callback to run |
Reimplemented in agents::ActorAgent, and agents::AutonomousAgent.
| void agents::Agent::setOptions | ( | const Options & | options | ) |
Set execution options.
| options | The execution options |
| void agents::Agent::setStatusCallback | ( | std::function< void(const std::string &)> | callback | ) |
|
virtual |
Stop the agent.
Reimplemented in agents::ActorAgent, and agents::AutonomousAgent.
|
inlinevirtual |
Wait for feedback using coroutines.
| message | The message to wait for feedback |
| context | The context to wait for feedback |
Reimplemented in agents::ActorAgent, and agents::AutonomousAgent.