TwelveLabs Pegasus 1.2 - Amazon Bedrock

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

TwelveLabs Pegasus 1.2

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

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

  • プロバイダー — TwelveLabs

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

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

  • 入力モダリティ — 動画

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

  • 最大ビデオサイズ — 1 時間の長さのビデオ (< 2GB ファイルサイズ)

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

次の表に、TwelveLabs Pegasus 1.2モデルの入力パラメータを示します。

TwelveLabs Pegasus 1.2 リクエストパラメータ
フィールド Type 必須 説明
inputPrompt 文字列 はい ビデオを分析するプロンプトを表示します。最大: 2000 トークン。
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 いいえ 生成するトークンの最大数。最大: 4096。

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" }