# General Translation Platform: EnqueueFilesOptions
URL: https://generaltranslation.com/ja/docs/platform/core/reference/types/enqueue-files-options.mdx
Docs index: https://generaltranslation.com/llms.txt
Description: アップロード済みのファイルを翻訳用キューに登録するためのオプション。EnqueueFilesOptions 型の API リファレンス。

`EnqueueFilesOptions` は、事前にアップロードしたソースファイルを翻訳用キューに登録するために [`enqueueFiles`](/docs/platform/core/reference/gt-class-methods/translation/enqueue-files) に渡す設定型です。

*注: これは 9.0 において [`enqueueFiles`](/docs/platform/core/reference/gt-class-methods/translation/enqueue-files) が受け付けるユーザー向けの型です。*

## 概要 [#overview]

`EnqueueFilesOptions` は、ファイルの一括翻訳における対象ロケールとジョブ設定を定義します。必須なのは `targetLocales` のみで、その他のフィールドはすべて任意です。

```typescript
type EnqueueFilesOptions = {
  sourceLocale?: string;
  targetLocales: string[];
  modelProvider?: string;
  force?: boolean;
  timeout?: number;
};
```

## プロパティ [#properties]

| プロパティ                             | 説明                         | 型       | 任意  |
| --------------------------------- | -------------------------- | ---------- | --- |
| [`sourceLocale`](#sourcelocale)   | ソースロケールを上書きします。            | `string`   | はい  |
| [`targetLocales`](#targetlocales) | 翻訳先のロケールコード。               | `string[]` | いいえ |
| [`modelProvider`](#modelprovider) | 翻訳モデルのプロバイダー。              | `string`   | はい  |
| [`force`](#force)                 | キャッシュされた翻訳を無効にし、再翻訳を強制します。 | `boolean`  | はい  |
| [`timeout`](#timeout)             | リクエストタイムアウト (ミリ秒) 。        | `number`   | はい  |

*注: `requireApproval` は 8.x 専用のオプションで、9.0 には存在しません。*

### `sourceLocale`

**型** `string` · **任意**

このジョブのソースロケールを上書きします。省略した場合は、インスタンスの `sourceLocale` がデフォルトで使用されます。

### `targetLocales`

**型** `string[]` · **必須**

ファイルの翻訳先のロケールコードです。

### `modelProvider`

**型** `string` · **任意**

使用する翻訳モデルのプロバイダー。`ANTHROPIC`、`OPENAI`、`XAI`、`GOOGLE` のいずれかを指定します。小文字の名前を含むそれ以外の値は、fetch の前に拒否されます。プロバイダーの選択は Enterprise plan で利用できます。それ以外のプランでこのオプションを設定すると `403` が返されます。

### `force`

**型** `boolean` · **任意**

キャッシュ済みの翻訳を無効にし、すでに翻訳が存在する場合でもファイルを強制的に再翻訳します。

### `timeout`

**型** `number` · **任意**

リクエストタイムアウト時間 (ミリ秒) 。

## 例 [#example]

```typescript
import { GT } from 'generaltranslation';
import type { EnqueueFilesOptions } from 'generaltranslation/types';

const gt = new GT({
  apiKey: process.env.GT_API_KEY,
  projectId: process.env.GT_PROJECT_ID,
});
// 事前のソースアップロードで返された ID を使用します。
const files = [{ fileId: 'uploaded-file-id', versionId: 'uploaded-version-id' }];

const options: EnqueueFilesOptions = {
  targetLocales: ['es', 'fr', 'de'],
  sourceLocale: 'en',
  modelProvider: 'OPENAI', // Enterprise plan が必要です。
};

const result = await gt.enqueueFiles(files, options);
```

```typescript
// 開発環境 vs 本番環境
const devOptions: EnqueueFilesOptions = {
  targetLocales: ['es'],
};

const prodOptions: EnqueueFilesOptions = {
  targetLocales: ['es', 'fr', 'de', 'ja'],
  modelProvider: 'OPENAI',
  force: true,
};
```

## Sitemap

See the full [sitemap](https://generaltranslation.com/sitemap.md) for all pages.
