BaseWorkflowAgent
Defined in: .build/typescript/packages/workflow/src/agent/base.ts:20
Base interface for workflow agents
Properties
Section titled “Properties”
readonlyname:string
Defined in: .build/typescript/packages/workflow/src/agent/base.ts:21
systemPrompt
Section titled “systemPrompt”
readonlysystemPrompt:string
Defined in: .build/typescript/packages/workflow/src/agent/base.ts:22
description
Section titled “description”
readonlydescription:string
Defined in: .build/typescript/packages/workflow/src/agent/base.ts:23
readonlytools:BaseToolWithCall[]
Defined in: .build/typescript/packages/workflow/src/agent/base.ts:24
readonlyllm:LLM
Defined in: .build/typescript/packages/workflow/src/agent/base.ts:25
canHandoffTo
Section titled “canHandoffTo”
readonlycanHandoffTo:string[]
Defined in: .build/typescript/packages/workflow/src/agent/base.ts:26
Methods
Section titled “Methods”getStructuredOutput()
Section titled “getStructuredOutput()”getStructuredOutput(
responseFormat,response):Promise<JSONObject>
Defined in: .build/typescript/packages/workflow/src/agent/base.ts:31
Take the final response and convert it to a structured output
Parameters
Section titled “Parameters”responseFormat
Section titled “responseFormat”ZodSchema
response
Section titled “response”ChatMessage
Returns
Section titled “Returns”Promise<JSONObject>
takeStep()
Section titled “takeStep()”takeStep(
ctx,state,llmInput,tools):Promise<AgentOutput>
Defined in: .build/typescript/packages/workflow/src/agent/base.ts:40
Take a single step with the agent Using memory directly to get messages instead of requiring them to be passed in
Parameters
Section titled “Parameters”WorkflowContext
llmInput
Section titled “llmInput”ChatMessage[]
BaseToolWithCall[]
Returns
Section titled “Returns”Promise<AgentOutput>
handleToolCallResults()
Section titled “handleToolCallResults()”handleToolCallResults(
state,results):Promise<void>
Defined in: .build/typescript/packages/workflow/src/agent/base.ts:50
Handle results from tool calls
Parameters
Section titled “Parameters”results
Section titled “results”Returns
Section titled “Returns”Promise<void>
finalize()
Section titled “finalize()”finalize(
state,output):Promise<AgentOutput>
Defined in: .build/typescript/packages/workflow/src/agent/base.ts:58
Finalize the agent’s output
Parameters
Section titled “Parameters”output
Section titled “output”Returns
Section titled “Returns”Promise<AgentOutput>