---
url: >-
  https://adk.nht.io/api/@nhtio/adk/batteries/generation/transformers_js/types/type-aliases/CreateTransformersJsGenerationProcessor.md
description: >-
  Factory for lazily creating the Janus chat/image processor. Defaults to a
  dynamic import of `@huggingface/transformers` +
  `AutoProcessor.from_pretrained(model, …)`; override to inject a pre-built
  processor or a test double.
---

# Type Alias: CreateTransformersJsGenerationProcessor

```ts
type CreateTransformersJsGenerationProcessor = (input: {
  model: string;
  onInitProgress?: TransformersJsGenerationProgressCallback;
}) => Promise<TransformersJsGenerationProcessor>;
```

Defined in: [src/batteries/generation/transformers\_js/types.ts:155](https://github.com/NHTIO/ADK/blob/v1.20261103.0/src/src/batteries/generation/transformers_js/types.ts#L155)

Factory for lazily creating the Janus chat/image processor. Defaults to a dynamic import of
`@huggingface/transformers` + `AutoProcessor.from_pretrained(model, …)`; override to inject a
pre-built processor or a test double.

## Parameters

| Parameter               | Type                                                                                                                                   |
| ----------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| `input`                 | { `model`: `string`; `onInitProgress?`: [`TransformersJsGenerationProgressCallback`](TransformersJsGenerationProgressCallback.md); } |
| `input.model`           | `string`                                                                                                                               |
| `input.onInitProgress?` | [`TransformersJsGenerationProgressCallback`](TransformersJsGenerationProgressCallback.md)                                              |

## Returns

`Promise`<[`TransformersJsGenerationProcessor`](../interfaces/TransformersJsGenerationProcessor.md)>
