Logo
Classes

FunctionAgent

Defined in: packages/workflow/src/agent/function-agent.ts:52

Base interface for workflow agents

Implements

Constructors

Constructor

new FunctionAgent(__namedParameters): FunctionAgent

Defined in: packages/workflow/src/agent/function-agent.ts:60

Parameters

__namedParameters

FunctionAgentParams

Returns

FunctionAgent

Properties

name

readonly name: string

Defined in: packages/workflow/src/agent/function-agent.ts:53

Implementation of

BaseWorkflowAgent.name


systemPrompt

readonly systemPrompt: string

Defined in: packages/workflow/src/agent/function-agent.ts:54

Implementation of

BaseWorkflowAgent.systemPrompt


description

readonly description: string

Defined in: packages/workflow/src/agent/function-agent.ts:55

Implementation of

BaseWorkflowAgent.description


llm

readonly llm: ToolCallLLM

Defined in: packages/workflow/src/agent/function-agent.ts:56

Implementation of

BaseWorkflowAgent.llm


tools

readonly tools: BaseToolWithCall[]

Defined in: packages/workflow/src/agent/function-agent.ts:57

Implementation of

BaseWorkflowAgent.tools


canHandoffTo

readonly canHandoffTo: string[]

Defined in: packages/workflow/src/agent/function-agent.ts:58

Implementation of

BaseWorkflowAgent.canHandoffTo

Methods

takeStep()

takeStep(ctx, llmInput, tools): Promise<AgentOutput>

Defined in: packages/workflow/src/agent/function-agent.ts:112

Take a single step with the agent Using memory directly to get messages instead of requiring them to be passed in

Parameters

ctx

HandlerContext<AgentWorkflowContext>

llmInput

ChatMessage[]

tools

BaseToolWithCall[]

Returns

Promise<AgentOutput>

Implementation of

BaseWorkflowAgent.takeStep


handleToolCallResults()

handleToolCallResults(ctx, results): Promise<void>

Defined in: packages/workflow/src/agent/function-agent.ts:172

Handle results from tool calls

Parameters

ctx

HandlerContext<AgentWorkflowContext>

results

AgentToolCallResult[]

Returns

Promise<void>

Implementation of

BaseWorkflowAgent.handleToolCallResults


finalize()

finalize(ctx, output, memory): Promise<AgentOutput>

Defined in: packages/workflow/src/agent/function-agent.ts:198

Finalize the agent's output

Parameters

ctx

HandlerContext<AgentWorkflowContext>

output

AgentOutput

memory

BaseMemory

Returns

Promise<AgentOutput>

Implementation of

BaseWorkflowAgent.finalize