Agents 0.0.2
Edge AI Agents SDK
|
Abstract base class for workflows. More...
#include <workflow.h>
Public Member Functions | |
Workflow (std::shared_ptr< AgentContext > context) | |
Constructor. | |
~Workflow ()=default | |
Destructor. | |
virtual JsonObject | run (const String &input)=0 |
Run the workflow with a user input and return the result. | |
virtual void | runAsync (const String &input, std::function< void(const JsonObject &)> callback) |
Run the workflow with a user input asynchronously. | |
std::shared_ptr< AgentContext > | getContext () const |
Get the workflow's context. | |
void | setStepCallback (std::function< void(const String &, const JsonObject &)> callback) |
Set a callback for intermediate steps. | |
void | setMaxSteps (int max_steps) |
Set maximum number of steps. | |
int | getMaxSteps () const |
Get maximum number of steps. | |
Abstract base class for workflows.
A workflow is a pattern for executing a series of LLM operations to accomplish a task.
agents::workflows::Workflow::Workflow | ( | std::shared_ptr< AgentContext > | context | ) |
Constructor.
context | The context |
std::shared_ptr< AgentContext > agents::workflows::Workflow::getContext | ( | ) | const |
Get the workflow's context.
int agents::workflows::Workflow::getMaxSteps | ( | ) | const |
Get maximum number of steps.
|
pure virtual |
Run the workflow with a user input and return the result.
input | The user input |
Implemented in agents::workflows::EvaluatorWorkflow, agents::workflows::OrchestratorWorkflow, agents::workflows::ParallelizationWorkflow, agents::workflows::PromptChainingWorkflow, agents::workflows::RoutingWorkflow, ParallelizationWorkflow, and PromptChainingWorkflow.
|
virtual |
Run the workflow with a user input asynchronously.
input | The user input |
callback | The callback |
void agents::workflows::Workflow::setMaxSteps | ( | int | max_steps | ) |
Set maximum number of steps.
max_steps | The maximum number of steps |
void agents::workflows::Workflow::setStepCallback | ( | std::function< void(const String &, const JsonObject &)> | callback | ) |
Set a callback for intermediate steps.
callback | The callback |