chunk_for_translation
Splits subtitle files into cue batches with stable IDs and text so an AI agent can translate them in manageable chunks and preserve timing.
Instructions
Step 1 of translating a subtitle. Returns one batch of cues as JSON: each cue has a stable
id (its 1-based position in the file) and its text (line breaks as \n, tags included).
The server never translates: YOU translate the texts, then call apply_translation with a
mapping {"": ""} covering every id of the file.
Rules for the translation: keep every id; keep formatting tags such as and {\an8} exactly; keep line breaks (\n) where they make sense; keep it about as long as the original (subtitles are read against a clock). The response says how many chunks exist; call again with chunk=2, 3, ... until all are done, then send ONE mapping with all ids.
Args: path: .srt or .vtt file. max_chars: approximate size of a batch in characters of cue text (default 1500, min 200). chunk: which batch to return, starting at 1. encoding: force the input text encoding.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| chunk | No | ||
| encoding | No | ||
| max_chars | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |