コンテンツにスキップ

run

このコンテンツはまだ日本語訳がありません。

function run<TAgent, TContext>(
agent,
input,
options?): Promise<RunResult<TContext, TAgent>>;

Executes an agent workflow with the shared default Runner instance.

Type Parameter Default type

TAgent extends Agent<any, any>

TContext

undefined

Parameter Type Description

agent

TAgent

The entry agent to invoke.

input

| string | AgentInputItem[] | RunState<TContext, TAgent>

A string utterance, structured input items, or a resumed RunState.

options?

NonStreamRunOptions<TContext>

Controls streaming mode, context, session handling, and turn limits.

Promise<RunResult<TContext, TAgent>>

A RunResult when stream is false, otherwise a StreamedRunResult.

function run<TAgent, TContext>(
agent,
input,
options?): Promise<StreamedRunResult<TContext, TAgent>>;

Executes an agent workflow with the shared default Runner instance.

Type Parameter Default type

TAgent extends Agent<any, any>

TContext

undefined

Parameter Type Description

agent

TAgent

The entry agent to invoke.

input

| string | AgentInputItem[] | RunState<TContext, TAgent>

A string utterance, structured input items, or a resumed RunState.

options?

StreamRunOptions<TContext>

Controls streaming mode, context, session handling, and turn limits.

Promise<StreamedRunResult<TContext, TAgent>>

A RunResult when stream is false, otherwise a StreamedRunResult.