FunctionAgent
Defined in: packages/workflow/src/agent/function-agent.ts:51
Base interface for workflow agents
Implements
Constructors
Constructor
new FunctionAgent(
__namedParameters
):FunctionAgent
Defined in: packages/workflow/src/agent/function-agent.ts:59
Parameters
__namedParameters
Returns
FunctionAgent
Properties
name
readonly
name:string
Defined in: packages/workflow/src/agent/function-agent.ts:52
Implementation of
systemPrompt
readonly
systemPrompt:string
Defined in: packages/workflow/src/agent/function-agent.ts:53
Implementation of
BaseWorkflowAgent
.systemPrompt
description
readonly
description:string
Defined in: packages/workflow/src/agent/function-agent.ts:54
Implementation of
llm
readonly
llm:ToolCallLLM
Defined in: packages/workflow/src/agent/function-agent.ts:55
Implementation of
tools
readonly
tools:BaseToolWithCall
[]
Defined in: packages/workflow/src/agent/function-agent.ts:56
Implementation of
canHandoffTo
readonly
canHandoffTo:string
[]
Defined in: packages/workflow/src/agent/function-agent.ts:57
Implementation of
BaseWorkflowAgent
.canHandoffTo
Methods
takeStep()
takeStep(
ctx
,state
,llmInput
,tools
):Promise
<AgentOutput
>
Defined in: packages/workflow/src/agent/function-agent.ts:111
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:172
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:198
Finalize the agent's output
Parameters
state
output
Returns
Promise
<AgentOutput
>