AgentWorkflow
Defined in: packages/workflow/src/agent/agent-workflow.ts:111
AgentWorkflow - An event-driven workflow for executing agents with tools
This class provides a simple interface for creating and running agent workflows based on the LlamaIndexTS workflow system. It supports single agent workflows with multiple tools.
Constructors
Constructor
new AgentWorkflow(
__namedParameters
):AgentWorkflow
Defined in: packages/workflow/src/agent/agent-workflow.ts:117
Parameters
__namedParameters
Returns
AgentWorkflow
Methods
addAgent()
addAgent(
agent
):this
Defined in: packages/workflow/src/agent/agent-workflow.ts:216
Adds a new agent to the workflow
Parameters
agent
Returns
this
getAgents()
getAgents():
BaseWorkflowAgent
[]
Defined in: packages/workflow/src/agent/agent-workflow.ts:227
Gets all agents in this workflow
Returns
Array of agents in this workflow
fromTools()
static
fromTools(params
):AgentWorkflow
Defined in: packages/workflow/src/agent/agent-workflow.ts:236
Create a simple workflow with a single agent and specified tools
Parameters
params
Parameters for the single agent workflow
Returns
AgentWorkflow
A new AgentWorkflow instance
run()
run(
userInput
,params?
):WorkflowContext
<AgentInputData
,string
,AgentWorkflowContext
>
Defined in: packages/workflow/src/agent/agent-workflow.ts:560
Parameters
userInput
string
params?
chatHistory?
ChatMessage
[]
context?
Returns
WorkflowContext
<AgentInputData
, string
, AgentWorkflowContext
>