Agents 0.0.2
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< AgentContext > context) | |
Constructor. | |
virtual | ~Agent ()=default |
Destructor. | |
virtual void | init ()=0 |
Initialize the agent. | |
virtual Task< JsonObject > | run (const String &task)=0 |
Run the agent with a task using coroutines. | |
void | runAsync (const String &task, std::function< void(const JsonObject &)> callback) |
Run the agent with a callback. | |
virtual void | stop () |
Stop the agent. | |
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. | |
virtual void | provideFeedback (const String &feedback) |
Provide human feedback. | |
virtual Task< String > | waitForFeedback (const 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< AgentContext > | context | ) |
Constructor.
context | The agent context |
std::shared_ptr< AgentContext > 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.
|
virtual |
Provide human feedback.
feedback | The feedback to provide |
|
pure virtual |
Run the agent with a task using coroutines.
task | The task to run |
void agents::Agent::runAsync | ( | const String & | task, |
std::function< void(const JsonObject &)> | callback ) |
Run the agent with a callback.
task | The task to run |
callback | The callback to run |
void agents::Agent::setOptions | ( | const Options & | options | ) |
Set execution options.
options | The execution options |
void agents::Agent::setStatusCallback | ( | std::function< void(const String &)> | callback | ) |
Set a callback for status updates.
callback | The callback to set |
|
inlinevirtual |
Wait for feedback using coroutines.
message | The message to wait for feedback |
context | The context to wait for feedback |