Logo
Classes

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

FunctionAgentParams

Returns

FunctionAgent

Properties

name

readonly name: string

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

Implementation of

BaseWorkflowAgent.name


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

BaseWorkflowAgent.description


llm

readonly llm: ToolCallLLM

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

Implementation of

BaseWorkflowAgent.llm


tools

readonly tools: BaseToolWithCall[]

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

Implementation of

BaseWorkflowAgent.tools


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

AgentWorkflowState

llmInput

ChatMessage[]

tools

BaseToolWithCall[]

Returns

Promise<AgentOutput>

Implementation of

BaseWorkflowAgent.takeStep


handleToolCallResults()

handleToolCallResults(state, results): Promise<void>

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

Handle results from tool calls

Parameters

state

AgentWorkflowState

results

AgentToolCallResult[]

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

AgentWorkflowState

output

AgentOutput

Returns

Promise<AgentOutput>

Implementation of

BaseWorkflowAgent.finalize