FunctionAgent
Defined in: packages/workflow/src/agent/function-agent.ts:104
Base interface for workflow agents
Implements
Constructors
Constructor
new FunctionAgent(
__namedParameters
):FunctionAgent
Defined in: packages/workflow/src/agent/function-agent.ts:112
Parameters
__namedParameters
Returns
FunctionAgent
Properties
name
readonly
name:string
Defined in: packages/workflow/src/agent/function-agent.ts:105
Implementation of
systemPrompt
readonly
systemPrompt:string
Defined in: packages/workflow/src/agent/function-agent.ts:106
Implementation of
BaseWorkflowAgent
.systemPrompt
description
readonly
description:string
Defined in: packages/workflow/src/agent/function-agent.ts:107
Implementation of
llm
readonly
llm:ToolCallLLM
Defined in: packages/workflow/src/agent/function-agent.ts:108
Implementation of
tools
readonly
tools:BaseToolWithCall
[]
Defined in: packages/workflow/src/agent/function-agent.ts:109
Implementation of
canHandoffTo
readonly
canHandoffTo:string
[]
Defined in: packages/workflow/src/agent/function-agent.ts:110
Implementation of
BaseWorkflowAgent
.canHandoffTo
Methods
takeStep()
takeStep(
ctx
,state
,llmInput
,tools
):Promise
<AgentOutput
>
Defined in: packages/workflow/src/agent/function-agent.ts:167
Take a single step with the agent Using memory directly to get messages instead of requiring them to be passed in
Parameters
ctx
WorkflowContext
state
llmInput
ChatMessage
[]
tools
BaseToolWithCall
[]
Returns
Promise
<AgentOutput
>
Implementation of
handleToolCallResults()
handleToolCallResults(
state
,results
):Promise
<void
>
Defined in: packages/workflow/src/agent/function-agent.ts:228
Handle results from tool calls
Parameters
state
results
Returns
Promise
<void
>
Implementation of
BaseWorkflowAgent
.handleToolCallResults
finalize()
finalize(
state
,output
):Promise
<AgentOutput
>
Defined in: packages/workflow/src/agent/function-agent.ts:254
Finalize the agent's output
Parameters
state
output
Returns
Promise
<AgentOutput
>
Implementation of
fromWorkflowStep()
static
fromWorkflowStep(__namedParameters
):FunctionAgent
Defined in: packages/workflow/src/agent/function-agent.ts:325
Create a FunctionAgent to handle a step of the workflow.
Parameters
__namedParameters
Returns
FunctionAgent
A new FunctionAgent instance