跳转到内容

handoff

此内容尚不支持你的语言。

function handoff<TContext, TOutput, TInputType>(agent, config): Handoff<TContext, TOutput>;

Creates a handoff from an agent. Handoffs are automatically created when you pass an agent into the handoffs option of the Agent constructor. Alternatively, you can use this function to create a handoff manually, giving you more control over configuration.

Type Parameter Default type Description

TContext

unknown

The context of the handoff

TOutput extends AgentOutputType

"text"

The output type of the handoff

TInputType extends ToolInputParameters

ToolInputParameters

The input type of the handoff

Parameter Type

agent

Agent<TContext, TOutput>

config

HandoffConfig<TInputType, TContext>

Handoff<TContext, TOutput>