> ## Documentation Index
> Fetch the complete documentation index at: https://docs.jinba.io/llms.txt
> Use this file to discover all available pages before exploring further.

# VTT パース

> WebVTT 字幕・文字起こしファイルをテキストまたは構造化キューに変換する

## 概要

VTT パースツールは、会議録画ツールや動画プラットフォームが出力する WebVTT（`.vtt`）形式の字幕・文字起こしファイルをパースし、発話テキストのみのプレーンテキスト、またはタイムスタンプ付きの構造化されたキュー配列として返します。文字起こしを要約・翻訳・分析ステップにそのまま渡すことができます。

## 主な機能

* `VTT_PARSE`
  * URL で指定した WebVTT ファイルをパースします。
  * 入力: `file_url`（WebVTT ファイルの URL）と `output_format`（`txt` または `array`。デフォルトは `txt`）。
  * `txt` は、タイムスタンプやマークアップを除いた発話テキストを 1 キュー 1 行で返します（`result.text`）。
  * `array` は構造化されたキュー配列（`result.cues`）を返します。各キューは `index`、任意の `id`、`HH:MM:SS.mmm` 形式の `start`・`end` タイムスタンプ、キューの `text` を持ちます。

## 認証

認証は不要です。ファイル URL を直接指定して動作します。

### 例：会議の文字起こしを要約する

```yaml theme={null}
- id: upload_transcript
  name: upload_transcript
  tool: INPUT_FILE
  input:
    - name: description
      value: "会議録画の文字起こしファイル（.vtt）をアップロードしてください"

- id: parse_transcript
  name: parse_transcript
  tool: VTT_PARSE
  input:
    - name: file_url
      value: "{{steps.upload_transcript.result.url}}"
    - name: output_format
      value: txt

- id: summarize_meeting
  name: summarize_meeting
  tool: OPENAI_INVOKE
  config:
    - name: version
      value: gpt-4
  input:
    - name: prompt
      value: |
        以下の会議の文字起こしを要約してください:
        1. 主な議論のポイント
        2. 決定事項
        3. 担当者付きのアクションアイテム

        ==文字起こし==
        {{steps.parse_transcript.result.text}}
```

### 例：タイムスタンプ付きの構造化キューを取得する

```yaml theme={null}
- id: parse_subtitles
  name: parse_subtitles
  tool: VTT_PARSE
  input:
    - name: file_url
      value: "https://example.com/subtitles.vtt"
    - name: output_format
      value: array
```

`{{steps.parse_subtitles.result.cues}}` の各要素には `index`、`start`、`end`、`text` が含まれるため、後続のステップで録画内の特定の時点を参照できます。

## 注意事項

* 空のキューはスキップされ、残りのキューに対して `index` が 1 から順に割り当てられます。
* `txt` モードでは、キュー内の装飾マークアップは取り除かれ、テキスト内容のみが残ります。
* ファイルのダウンロードに失敗した場合（HTTP ステータスが正常でない場合）は `DownloadError` を、内容が有効な VTT でなくキューを 1 件もパースできない場合は `ParseError` を返します。
