# Class ExpertFactoryAdapter

Wrapper to adapt ExpertFactory to IExpertFactory interface.

#### Implements

- WorkflowExpertFactory

- Defined in packages/nexus-agents/src/workflows/step-executor.ts:45

##### Index

### Constructors

constructor

### Methods

createForRole

## Constructors

### constructor

- new ExpertFactoryAdapter(
  factory: {
  create: (
  config: ExpertConfig,
  options?: CreateExpertOptions,
  ) => Result<Expert, FactoryError>;
  createBuiltIn: (
  type: BuiltInExpertType,
  options?: CreateExpertOptions,
  ) => Result<Expert, FactoryError>;
  createMany: (
  configs: ExpertConfig[],
  options?: CreateExpertOptions,
  ) => Result<Expert[], FactoryError>;
  createAllBuiltIn: (
  options?: CreateExpertOptions,
  ) => Result<Expert[], FactoryError>;
  validate: (config: unknown) => Result<ExpertConfig, FactoryError>;
  getBuiltInConfig: (
  type: BuiltInExpertType,
  ) => Result<ExpertConfig, FactoryError>;
  createFromICTM: (
  ictm: ICTMConfig,
  subtaskId: string,
  options?: CreateExpertOptions,
  ) => Result<Expert, FactoryError>;
  },
  ): ExpertFactoryAdapter

  #### Parameters

  - factory: {
    create: (
    config: ExpertConfig,
    options?: CreateExpertOptions,
    ) => Result<Expert, FactoryError>;
    createBuiltIn: (
    type: BuiltInExpertType,
    options?: CreateExpertOptions,
    ) => Result<Expert, FactoryError>;
    createMany: (
    configs: ExpertConfig[],
    options?: CreateExpertOptions,
    ) => Result<Expert[], FactoryError>;
    createAllBuiltIn: (
    options?: CreateExpertOptions,
    ) => Result<Expert[], FactoryError>;
    validate: (config: unknown) => Result<ExpertConfig, FactoryError>;
    getBuiltInConfig: (
    type: BuiltInExpertType,
    ) => Result<ExpertConfig, FactoryError>;
    createFromICTM: (
    ictm: ICTMConfig,
    subtaskId: string,
    options?: CreateExpertOptions,
    ) => Result<Expert, FactoryError>;
    }

    - ##### `Readonly` create: (
      config: ExpertConfig,
      options?: CreateExpertOptions,
      ) => Result<Expert, FactoryError>

    - ##### `Readonly` createBuiltIn: (
      type: BuiltInExpertType,
      options?: CreateExpertOptions,
      ) => Result<Expert, FactoryError>

    - ##### `Readonly` createMany: (
      configs: ExpertConfig[],
      options?: CreateExpertOptions,
      ) => Result<Expert[], FactoryError>

    - ##### `Readonly` createAllBuiltIn: (options?: CreateExpertOptions) => Result<Expert[], FactoryError>

    - ##### `Readonly` validate: (config: unknown) => Result<ExpertConfig, FactoryError>

    - ##### `Readonly` getBuiltInConfig: (type: BuiltInExpertType) => Result<ExpertConfig, FactoryError>

    - ##### createFromICTM: (
      ictm: ICTMConfig,
      subtaskId: string,
      options?: CreateExpertOptions,
      ) => Result<Expert, FactoryError>

  #### Returns ExpertFactoryAdapter

  - Defined in packages/nexus-agents/src/workflows/step-executor.ts:48

## Methods

### createForRole

- createForRole(role: AgentRole): Result<Expert, Error>

  #### Parameters

  - role: AgentRole

  #### Returns Result<Expert, Error>

  Implementation of WorkflowExpertFactory.createForRole

  - Defined in packages/nexus-agents/src/workflows/step-executor.ts:52