View a markdown version of this page

Titan 文本嵌入 V2 - Amazon Bedrock

本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。

Titan 文本嵌入 V2

Amazon logo with curved arrow from A to Z forming a smile. Amazon — Titan Text Embeddings V2

模型詳細資訊

Titan Text Embeddings V2 是 Amazon 的第二代文字內嵌模型,具有可設定的輸出維度並改善擷取任務的準確性。如需模型開發和效能的詳細資訊,請參閱模型/服務卡

  • 模型啟動日期:2024 年 4 月 30 日

  • 模型 EOL 日期:不可早於 4/30/2024

  • 最終使用者授權合約和使用條款:檢視

  • 模型生命週期:作用中

  • 內容視窗:8K 權杖

輸入模式 輸出模式 支援的 APIs 支援的端點
Red circle with white X icon indicating error, cancel, or close action. 音訊Green circle with white checkmark icon. 內嵌Red circle with white X icon indicating error, cancel, or close action. ResponsesGreen circle with white checkmark icon. bedrock-runtime
Red circle with white X icon indicating error, cancel, or close action. 影像Red circle with white X icon indicating error, cancel, or close action. 影像Red circle with white X icon indicating error, cancel, or close action. Chat CompletionsRed circle with white X icon indicating error, cancel, or close action. bedrock-mantle
Red circle with white X icon indicating error, cancel, or close action. 語音Red circle with white X icon indicating error, cancel, or close action. 語音Green circle with white checkmark icon. Invoke
Green circle with white checkmark icon. 文字Red circle with white X icon indicating error, cancel, or close action. 文字Red circle with white X icon indicating error, cancel, or close action. Converse
Red circle with white X icon indicating error, cancel, or close action. 影片Red circle with white X icon indicating error, cancel, or close action. 影片

定價

如需定價,請參閱 Amazon Bedrock 定價頁面。

程式設計存取

使用以下模型 IDs和端點 URLs以程式設計方式存取此模型。如需可用 APIs和端點的詳細資訊,請參閱支援的 APIs支援的端點

端點 模型 ID 區域端點 URL 地理推論 ID 全域推論 ID
bedrock-runtime amazon.titan-embed-text-v2:0 https://bedrock-runtime.{region}.amazonaws.com 不支援 不支援

例如,如果區域是 us-east-1 (維吉尼亞北部),則 bedrock-runtime 端點 URL 將為 "https://bedrock-runtime.us-east-1.amazonaws.com",而 bedrock-mantle 則為 "https://bedrock-mantle.us-east-1.api.aws/v1"。

服務層

Amazon Bedrock 提供多個服務層,以符合您的工作負載需求。Standard pay-per-token存取,無需任何承諾。優先順序透過以時間為基礎的承諾提供更高的輸送量。Flex 為彈性、non-time-sensitive的工作負載提供低成本存取。預留提供專用輸送量,並承諾可預測工作負載的期限。如需詳細資訊,請參閱 服務方案

標準 優先順序 Flex 預留
Green circle with white checkmark icon. Red circle with white X icon indicating error, cancel, or close action. Red circle with white X icon indicating error, cancel, or close action. Red circle with white X icon indicating error, cancel, or close action.

區域可用性

區域可用性一目了然

Bedrock 提供三種推論選項:為嚴格合規,區域內將請求保留在單一 區域內,地理 (美國、歐洲等) 內區域間的地理跨區域路由可提高輸送量,同時遵守資料駐留,而全球跨區域路由則可在無駐留限制的情況下,在全球任何地方提供最大輸送量。如需詳細資訊,請參閱 依模型的區域可用性頁面。

區域 區域內 地理 全域
us-east-1 (維吉尼亞北部)Green circle with white checkmark icon.Red circle with white X icon indicating error, cancel, or close action.Red circle with white X icon indicating error, cancel, or close action.
us-east-2 (俄亥俄)Green circle with white checkmark icon.Red circle with white X icon indicating error, cancel, or close action.Red circle with white X icon indicating error, cancel, or close action.
us-west-2 (奧勒岡)Green circle with white checkmark icon.Red circle with white X icon indicating error, cancel, or close action.Red circle with white X icon indicating error, cancel, or close action.
us-gov-east-1 (GovCloud)Green circle with white checkmark icon.Red circle with white X icon indicating error, cancel, or close action.Red circle with white X icon indicating error, cancel, or close action.
us-gov-west-1 (GovCloud)Green circle with white checkmark icon.Red circle with white X icon indicating error, cancel, or close action.Red circle with white X icon indicating error, cancel, or close action.
ca-central-1 (加拿大)Green circle with white checkmark icon.Red circle with white X icon indicating error, cancel, or close action.Red circle with white X icon indicating error, cancel, or close action.
eu-central-1 (法蘭克福)Green circle with white checkmark icon.Red circle with white X icon indicating error, cancel, or close action.Red circle with white X icon indicating error, cancel, or close action.
eu-central-2 (蘇黎世)Green circle with white checkmark icon.Red circle with white X icon indicating error, cancel, or close action.Red circle with white X icon indicating error, cancel, or close action.
eu-north-1 (斯德哥爾摩)Green circle with white checkmark icon.Red circle with white X icon indicating error, cancel, or close action.Red circle with white X icon indicating error, cancel, or close action.
eu-south-1 (米蘭)Green circle with white checkmark icon.Red circle with white X icon indicating error, cancel, or close action.Red circle with white X icon indicating error, cancel, or close action.
eu-south-2 (西班牙)Green circle with white checkmark icon.Red circle with white X icon indicating error, cancel, or close action.Red circle with white X icon indicating error, cancel, or close action.
eu-west-1 (愛爾蘭)Green circle with white checkmark icon.Red circle with white X icon indicating error, cancel, or close action.Red circle with white X icon indicating error, cancel, or close action.
eu-west-2 (倫敦)Green circle with white checkmark icon.Red circle with white X icon indicating error, cancel, or close action.Red circle with white X icon indicating error, cancel, or close action.
eu-west-3 (巴黎)Green circle with white checkmark icon.Red circle with white X icon indicating error, cancel, or close action.Red circle with white X icon indicating error, cancel, or close action.
ap-northeast-1 (東京)Green circle with white checkmark icon.Red circle with white X icon indicating error, cancel, or close action.Red circle with white X icon indicating error, cancel, or close action.
ap-northeast-2 (首爾)Green circle with white checkmark icon.Red circle with white X icon indicating error, cancel, or close action.Red circle with white X icon indicating error, cancel, or close action.
ap-northeast-3 (大阪)Green circle with white checkmark icon.Red circle with white X icon indicating error, cancel, or close action.Red circle with white X icon indicating error, cancel, or close action.
ap-south-1 (孟買)Green circle with white checkmark icon.Red circle with white X icon indicating error, cancel, or close action.Red circle with white X icon indicating error, cancel, or close action.
ap-south-2 (海德拉巴)Green circle with white checkmark icon.Red circle with white X icon indicating error, cancel, or close action.Red circle with white X icon indicating error, cancel, or close action.
ap-southeast-2 (雪梨)Green circle with white checkmark icon.Red circle with white X icon indicating error, cancel, or close action.Red circle with white X icon indicating error, cancel, or close action.
sa-east-1 (聖保羅)Green circle with white checkmark icon.Red circle with white X icon indicating error, cancel, or close action.Red circle with white X icon indicating error, cancel, or close action.

配額和限制

您的 AWS 帳戶具有預設配額,可維持服務的效能,並確保適當使用 Amazon Bedrock。指派給帳戶的預設配額可能會根據區域因素、付款歷史記錄、詐騙使用量和/或配額增加請求的核准而更新。如需詳細資訊,請參閱 Amazon Bedrock 的配額 文件並查看模型的限制

範例程式碼

步驟 1 - AWS 帳戶:如果您已經有 AWS 帳戶,請略過此步驟。如果您是初次使用 AWS,請註冊 AWS 帳戶

步驟 2 - API 金鑰:前往 Amazon Bedrock 主控台並產生長期 API 金鑰。

步驟 3 - 取得 SDK:若要使用此入門指南,您必須已安裝 Python。然後,根據您使用的 APIs相關軟體。

pip install boto3

步驟 4 - 設定環境變數:設定您的環境以使用 API 金鑰進行身分驗證。

AWS_BEARER_TOKEN_BEDROCK="<provide your Bedrock API key>"

步驟 5 - 執行您的第一個推論請求:將檔案儲存為 bedrock-first-request.py

Invoke API
import json import boto3 client = boto3.client('bedrock-runtime', region_name='us-east-1') response = client.invoke_model( modelId='amazon.titan-embed-text-v2:0', body=json.dumps({ 'inputText': 'What are the different services that you offer?', 'dimensions': 1024, 'normalize': True }) ) print(json.loads(response['body'].read()))