|
Agents 1.4.0
Edge AI Agents SDK
|
Abstract base class for workflows. More...
#include <workflow.h>
Public Member Functions | |
| Workflow (std::shared_ptr< Context > context) | |
| Constructor. | |
| ~Workflow ()=default | |
| Destructor. | |
| virtual JsonObject | run (const std::string &input)=0 |
| Run the workflow with a user input and return the result. | |
| virtual void | runAsync (const std::string &input, std::function< void(const JsonObject &)> callback) |
| Run the workflow with a user input asynchronously. | |
| std::shared_ptr< Context > | getContext () const |
| Get the workflow's context. | |
| void | setStepCallback (std::function< void(const std::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< Context > | context | ) |
Constructor.
| context | The context |
| std::shared_ptr< Context > 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, and agents::workflows::RoutingWorkflow.
|
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 std::string &, const JsonObject &)> | callback | ) |
Set a callback for intermediate steps.
| callback | The callback |