TwelveLabs Pegasus 1.2 - Amazon Bedrock

TwelveLabs Pegasus 1.2

TwelveLabs Pegasus 1.2 モデルは、包括的な動画の理解と分析機能を提供します。動画コンテンツを分析し、テキストによる説明、インサイト、動画に関する質問への回答を生成できます。

この情報を使用して、InvokeModel オペレーションと InvokeModelWithResponseStream (ストリーミング) オペレーションで TwelveLabs モデルに推論呼び出しを実行できます。

  • プロバイダー — TwelveLabs

  • カテゴリ — 動画の理解、コンテンツ分析

  • モデル ID — twelvelabs.pegasus-1-2-v1:0

  • 入力モダリティ — 動画

  • 出力モダリティ — テキスト

  • 最大動画サイズ — 1 時間の長さの動画 (ファイルサイズ 2GB 以下)

TwelveLabs Pegasus 1.2 リクエストパラメータ

TwelveLabs Pegasus 1.2 モデルの入力パラメータは、次の表のとおりです。

TwelveLabs Pegasus 1.2 リクエストパラメータ
フィールド Type 必須 説明
inputPrompt 文字列 あり 動画分析用プロンプト 最大: 2,000 トークン
temperature double なし モデルの温度。出力のランダム性を制御します。デフォルト: 0.2、最低: 0、最大: 1
responseFormat オブジェクト なし ユーザーが構造化出力形式を指定できるようにします。現時点でサポートされているのは、json_schema のみです。
mediaSource オブジェクト あり メディアソースについての説明。base64String または s3Location を提供する必要があります。
mediaSource.base64String 文字列 なし 動画用 Base64 でエンコードされたバイト文字列。最大: 36MB
mediaSource.s3Location.uri 文字列 なし 動画のダウンロード元 S3 URI。最大: 1 時間の長さの動画 (ファイルサイズ 2GB 以下)
mediaSource.s3Location.bucketOwner 文字列 なし バケット所有者の AWS アカウント ID
maxOutputTokens integer なし 生成するトークンの最大数。最大: 4,096

TwelveLabs Pegasus 1.2 レスポンスフィールド

TwelveLabs Pegasus 1.2 モデルの出力フィールドは、次の表のとおりです。

TwelveLabs Pegasus 1.2 レスポンスフィールド
フィールド タイプ 説明
message string モデルの動画分析を含む出力メッセージ
finishReason 文字列 出力が終了した原因を説明する停止理由。有効な値: stop (API が制限に達することなく完全な完了を返しました)、length (生成が max_tokens の制限を超えました)

TwelveLabs Pegasus 1.2 のリクエストとレスポンス

次の例は、さまざまな入力ソースで TwelveLabs Pegasus 1.2 モデルを使用する方法を説明しています。

Request

次の例は、TwelveLabs Pegasus 1.2 モデルのリクエストを説明しています。

base64 でエンコードされた動画の使用:

{ "inputPrompt": "tell me about the video", "mediaSource": { "base64String": "<BASE64 STRING OF VIDEO FILE>" }, "temperature": 0 }

S3 に保存された動画の使用:

{ "inputPrompt": "Tell me about this video", "mediaSource": { "s3Location": { "uri": "s3://path-to-video-object-in-s3", "bucketOwner": "bucket-owner-account-id" } }, "temperature": 0 }

構造化出力形式の使用:

{ "inputPrompt": "Analyze this video and provide a structured summary", "mediaSource": { "s3Location": { "uri": "s3://path-to-video-object-in-s3", "bucketOwner": "bucket-owner-account-id" } }, "temperature": 0.2, "maxOutputTokens": 2048, "responseFormat": { "type": "json_schema", "json_schema": { "name": "video_analysis", "schema": { "type": "object", "properties": { "summary": {"type": "string"}, "key_scenes": {"type": "array", "items": {"type": "string"}}, "duration": {"type": "string"} }, "required": ["summary", "key_scenes"] } } } }
Response

次の例は、TwelveLabs Pegasus 1.2 モデルからのレスポンス形式を説明しています。

標準的なレスポンス:

{ "message": "This video shows a person walking through a park during sunset. The scene includes trees, a walking path, and golden lighting from the setting sun. The person appears to be enjoying a peaceful evening stroll.", "finishReason": "stop" }

構造化された出力のレスポンス:

{ "message": "{\"summary\": \"A peaceful evening walk through a park at sunset\", \"key_scenes\": [\"Person entering the park\", \"Walking along tree-lined path\", \"Sunset lighting through trees\", \"Person sitting on bench\"], \"duration\": \"Approximately 2 minutes\"}", "finishReason": "stop" }

最大トークン数に達した場合のレスポンス:

{ "message": "This video contains multiple scenes showing various activities. The first scene shows...", "finishReason": "length" }