Used to check for browser translation.
用于检测浏览器翻译。
ブラウザの翻訳を検出する

orchestrator


Classes#

OrchestratorAgent<I, O>#

Orchestrator Agent Class

This Agent is responsible for:

  1. Generating an execution plan based on the objective
  2. Breaking down the plan into steps and tasks
  3. Coordinating the execution of steps and tasks
  4. Synthesizing the final result

Workflow:

  • Receives input objective
  • Uses planner to create execution plan
  • Executes tasks and steps according to the plan
  • Synthesizes final result through completer

Extends#

Type Parameters#

Type Parameter

Default type

I extends `Message`

`Message`

O extends `Message`

`Message`

Indexable#

[key: symbol]: () => string | () => Promise<void>

Constructors#

Constructor#

new OrchestratorAgent<I, O>(options): OrchestratorAgent<I, O>

Creates an OrchestratorAgent instance

Parameters#

Parameter

Type

Description

options

OrchestratorAgentOptions<I, O>

Configuration options for the Orchestrator Agent

Returns#

OrchestratorAgent<I, O>

Overrides#

`Agent`.`constructor`

Properties#

tag#

tag: string = "OrchestratorAgent"

Overrides#

`Agent`.`tag`

inputKey#

inputKey: string

maxIterations?#

optional maxIterations: number

Maximum number of iterations Prevents infinite execution loops

tasksConcurrency?#

optional tasksConcurrency: number

Number of concurrent tasks Controls how many tasks can be executed simultaneously

Methods#

from()#

static from<I, O>(options): OrchestratorAgent<I, O>

Factory method to create an OrchestratorAgent instance

Type Parameters#

Type Parameter

I extends `Message`

O extends `Message`

Parameters#

Parameter

Type

Description

options

OrchestratorAgentOptions<I, O>

Configuration options for the Orchestrator Agent

Returns#

OrchestratorAgent<I, O>

A new OrchestratorAgent instance

process()#

process(input, options): Promise<O>

Process input and execute the orchestrator workflow

Workflow:

  1. Extract the objective
  2. Loop until plan completion or maximum iterations: a. Generate/update execution plan b. If plan is complete, synthesize result c. Otherwise, execute steps in the plan
Parameters#

Parameter

Type

Description

input

I

Input message containing the objective

options

`AgentInvokeOptions`

Agent invocation options

Returns#

Promise<O>

Processing result

Overrides#

`Agent`.`process`

Interfaces#

OrchestratorAgentOptions<I, O>#

Configuration options for the Orchestrator Agent

Extends#

Type Parameters#

Type Parameter

Default type

I extends `Message`

`Message`

O extends `Message`

`Message`

Properties#

Property

Type

Description

maxIterations?

number

Maximum number of iterations to prevent infinite loops Default: 30

tasksConcurrency?

number

Number of concurrent tasks Default: 5

inputKey

string

-