跳至主要內容

WatsonX 音訊轉錄

概觀

屬性詳細資料
說明使用 Whisper 模型進行語音轉文字的 WatsonX 音訊轉錄
LiteLLM 上的提供者路由watsonx/
支援的操作/v1/audio/transcriptions
提供者文件連結IBM WatsonX.ai ↗

快速開始

LiteLLM SDK

transcription.py
import litellm

response = litellm.transcription(
model="watsonx/whisper-large-v3-turbo",
file=open("audio.mp3", "rb"),
api_base="https://us-south.ml.cloud.ibm.com",
api_key="your-api-key",
project_id="your-project-id"
)
print(response.text)

LiteLLM Proxy

config.yaml
model_list:
- model_name: whisper-large-v3-turbo
litellm_params:
model: watsonx/whisper-large-v3-turbo
api_key: os.environ/WATSONX_APIKEY
api_base: os.environ/WATSONX_URL
project_id: os.environ/WATSONX_PROJECT_ID
Request
curl http://localhost:4000/v1/audio/transcriptions \
-H "Authorization: Bearer sk-1234" \
-F file="@audio.mp3" \
-F model="whisper-large-v3-turbo"

支援的參數

參數型別說明
modelstring模型 ID(例如:watsonx/whisper-large-v3-turbo
file檔案要轉錄的音訊檔案
languagestring語言代碼(例如:en
promptstring用於引導轉錄的選用提示詞
temperaturefloat採樣溫度(0-1)
response_formatstringjsontextsrtverbose_jsonvtt
🚅
LiteLLM Enterprise
為正式環境打造的 SSO/SAML、稽核記錄、支出追蹤、多團隊管理與防護欄。
深入瞭解 →