跳转到内容

FunctionAgent

定义于:.build/typescript/packages/workflow/src/agent/function-agent.ts:110

工作流智能体的基础接口

new FunctionAgent(__namedParameters): FunctionAgent

定义于:.build/typescript/packages/workflow/src/agent/function-agent.ts:118

FunctionAgentParams

FunctionAgent

readonly 名称: string

定义于:.build/typescript/packages/workflow/src/agent/function-agent.ts:111

BaseWorkflowAgent.name


readonly systemPrompt: string

定义于:.build/typescript/packages/workflow/src/agent/function-agent.ts:112

BaseWorkflowAgent.systemPrompt


readonly 描述: string

定义于:.build/typescript/packages/workflow/src/agent/function-agent.ts:113

BaseWorkflowAgent.description


readonly llm: ToolCallLLM

定义于:.build/typescript/packages/workflow/src/agent/function-agent.ts:114

BaseWorkflowAgent.llm


readonly 工具: BaseToolWithCall[]

定义于:.build/typescript/packages/workflow/src/agent/function-agent.ts:115

BaseWorkflowAgent.tools


readonly 可转交给: string[]

定义于:.build/typescript/packages/workflow/src/agent/function-agent.ts:116

BaseWorkflowAgent.canHandoffTo

getStructuredOutput(responseFormat, response): Promise<any>

定义于:.build/typescript/packages/workflow/src/agent/function-agent.ts:139

获取最终响应并将其转换为结构化输出

ZodSchema

ChatMessage

Promise<any>

BaseWorkflowAgent.getStructuredOutput


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

定义于:.build/typescript/packages/workflow/src/agent/function-agent.ts:181

使用智能体执行单步操作 直接使用内存获取消息,无需传入消息

WorkflowContext

AgentWorkflowState

ChatMessage[]

BaseToolWithCall[]

Promise<AgentOutput>

BaseWorkflowAgent.takeStep


handleToolCallResults(state, results): Promise<void>

定义于:.build/typescript/packages/workflow/src/agent/function-agent.ts:242

处理工具调用的结果

AgentWorkflowState

AgentToolCallResult[]

Promise<void>

BaseWorkflowAgent.handleToolCallResults


finalize(state, output): Promise<AgentOutput>

定义于:.build/typescript/packages/workflow/src/agent/function-agent.ts:268

完成智能体的输出

AgentWorkflowState

AgentOutput

Promise<AgentOutput>

BaseWorkflowAgent.finalize


static fromWorkflowStep(__namedParameters): FunctionAgent

定义于:.build/typescript/packages/workflow/src/agent/function-agent.ts:339

创建一个FunctionAgent来处理工作流中的一个步骤。

StepHandlerParams

FunctionAgent

一个新的FunctionAgent实例