Skip to content

getHandoff

function getHandoff<TContext, TOutput>(agent): Handoff<TContext, TOutput>

Returns a handoff for the given agent. If the agent is already wrapped into a handoff, it will be returned as is. Otherwise, a new handoff instance will be created.

Type Parameter Description

TContext

The context of the handoff

TOutput extends AgentOutputType

The output type of the handoff

Parameter Type

agent

| Agent<TContext, TOutput> | Handoff<TContext, TOutput>

Handoff<TContext, TOutput>