客户服务
人机交互
会议转写
字幕生成
游戏语言
内容质检
语音搜索
# 安装最新版本 pip install zai-sdk # 或指定版本 pip install zai-sdk==0.0.1
import zai print(zai.__version__)
from zai import ZhipuAiClient client = ZhipuAiClient(api_key="") # 请填写您自己的APIKey input_wav_path = "speech.wav" # 你的WAV文件路径 with open(input_wav_path, "rb") as audio_data: response = client.audio.transcriptions.create( model="glm-asr", file=audio_data, stream=True ) for chunk in response: if chunk.type == "transcript.text.delta": print(chunk.delta, end="", flush=True)
Was this page helpful?