DeepSeek cloud speech recognition with automatic selection
带自动选择的 DeepSeek 云端语音识别
Experimental voice input recognized speech only on the Host, so first use required downloading and preparing local models. Users with a DeepSeek credential should dictate without that setup, while users without one keep the local option. DeepSeek publishes speech recognition as `POST /v1/tools/asr`, which accepts the account sign-in and the API key like the other DeepSeek APIs, and [`ctx.deepseekAuth`](../architectur
Source compatibility: Chinese title uses a compatible non-canonical header
English
Problem
Experimental voice input recognized speech only on the Host, so first use required downloading and preparing local models. Users with a DeepSeek credential should dictate without that setup, while users without one keep the local option. DeepSeek publishes speech recognition as POST /v1/tools/asr, which accepts the account sign-in and the API key like the other DeepSeek APIs, and ctx.deepseekAuth owns how DeepSeek consumers authenticate. The voice input decision forbids any fallback that uploads speech after a local failure.
Decision
A separate provider package, speech-to-text-deepseek, registers deepseek-asr with location: 'cloud' and sends each complete WAV recording unchanged to /v1/tools/asr; there is no streaming. It is a ctx.deepseekAuth consumer that accepts both kinds and tries the account sign-in before the API key, because the account deployment is the official one unless a deployment overrides it, while an API key often belongs to a custom endpoint. It is ready while either credential is configured and probes no endpoint: a custom endpoint without /v1/tools/asr fails each recording. The account service and deepseek-auth are unchanged.
speech-to-text gains the auto preference and autoOrder. Selection happens before recording: the first provider that records without preparation wins, otherwise the first that is neither unavailable nor failed, and the Client sends that exact provider id with the recording. A failed recognition never re-routes audio, and signing out during a recording fails that recording rather than switching providers. One saved language serves every provider: a provider that does not list it receives auto. The service detects the language itself, so the cloud provider lists only auto and the menu notes that cloud recognition detects the language.
Users with a credential get cloud recognition by default without an upload prompt; the user agreement and privacy policy disclose processing, the interface names the location in the tooltip, transcription status and bundle details, and the details state the cost and link the speech recognition guide. This includes users of the earlier local default who have a credential: the product chose cloud recognition for them, which revises the voice input decision's requirement that later cloud providers not change where recordings are processed without a choice. The microphone stays visible whenever the plugin is enabled. Signing in uses a new optional Client service, accountSignIn, so the voice UI reuses the account dialog and browser flow.
Alternatives considered
A first-use upload notice was rejected by product because the user agreement covers it. Falling back to cloud recognition after a local failure would violate the existing no-fallback guarantee. The earlier harness.deepseek.com endpoint was rejected because it accepted only the account sign-in and needed the account service to release tokens to a second origin. Probing each credential's endpoint before offering cloud recognition was rejected: a user who configures a custom endpoint owns that choice. An official-origin check in ctx.deepseekAuth was rejected because a custom gateway can serve Search while lacking speech recognition. Retrying a request was rejected because the service has no idempotency key and bills by duration. Calling account.startSignIn from the voice UI would duplicate the sign-in dialog, tab ownership and failure states.
Consequences
The shipped bundle enables the cloud row, and the upgrade guide tells users how to keep local recognition. Outside a conversation the Search and Fetch APIs try the API key first while speech recognition tries the account sign-in first. HTTP 401 invalidates a rejected account sign-in, which signs the account out; when the service rejects an account sign-in it closes the connection before reading a full recording, so that rejection reaches the user as service-unavailable and the sign-in is invalidated by the next request that receives the 401. Verification covers automatic routing and language rules, both credential kinds and their order through the real DeepSeekAuth, status classification, and a real-composition browser sign-in and dictation against a loopback service.
中文
问题
实验性语音输入只在 Host 上识别,首次使用必须下载并准备本地模型。有 DeepSeek 凭据的用户应能免去这一步直接听写,没有凭据的用户仍可使用本地识别。DeepSeek 以 POST /v1/tools/asr 提供语音识别,它与其他 DeepSeek 接口一样接受账号登录和 API Key,而 DeepSeek 使用方如何鉴权由 ctx.deepseekAuth 负责。语音输入决策禁止本地失败后回退上传语音。
决策
独立的 Provider 包 speech-to-text-deepseek 以 location: 'cloud' 注册 deepseek-asr,把每段完整的 WAV 录音原样发送到 /v1/tools/asr,不使用流式识别。它是 ctx.deepseekAuth 的使用方,接受两种凭据,先用账号登录再用 API Key:除非部署另行配置,账号所属的部署就是官方部署,而 API Key 常常对应自定义 endpoint。只要配置了任一种凭据就处于就绪状态,不探测 endpoint:没有 /v1/tools/asr 的自定义 endpoint 会让每次录音失败。账号服务与 deepseek-auth 都不改动。
speech-to-text 新增 auto 偏好和 autoOrder。选择在录音之前进行:第一个无需准备即可录音的 Provider 胜出,否则取第一个既不是 unavailable 也不是 failed 的,Client 随录音发送这个确切的 Provider id。识别失败绝不改投其他 Provider;录音期间退出登录时,该次录音失败,而不是换用其他 Provider。一份保存的语言适用于所有 Provider:未列出该语言的 Provider 收到 auto。服务自行判断语言,因此云端 Provider 只声明 auto,菜单提示云端识别会自动判断语言。
有凭据的用户默认使用云端识别,不弹上传告知;处理方式由用户协议和隐私协议说明,界面在悬停提示、转写状态和 Bundle 详情中标明识别位置,详情还说明费用并链接语音识别指南。这也包括此前使用本地默认值且有凭据的用户:产品为他们选择了云端识别,这修订了语音输入决策中“之后的云端 Provider 不得在用户未选择时改变录音处理位置”的要求。只要插件已启用,麦克风就一直显示。登录使用新的可选 Client 服务 accountSignIn,语音 UI 复用账号的登录弹窗和浏览器流程。
考虑过的方案
产品否决了首次上传告知,因为用户协议已经覆盖。本地失败后回退到云端识别会破坏现有的无回退保证。早先的 harness.deepseek.com 接口被否决,因为它只接受账号登录,并且需要账号服务向第二个 origin 发放 token。在提供云端识别前探测每种凭据的 endpoint 被否决:配置自定义 endpoint 的用户自行负责。在 ctx.deepseekAuth 中检查是否为官方 origin 被否决,因为自定义网关可能支持 Search 却不支持语音识别。重试请求被否决,因为服务没有幂等键且按时长计费。在语音 UI 中直接调用 account.startSignIn 会重复登录弹窗、标签页所有权和失败状态。
影响
发布的 Bundle 启用云端这一行,升级指南说明如何继续使用本地识别。在对话之外,Search 和 Fetch 接口先用 API Key,而语音识别先用账号登录。HTTP 401 会作废被拒绝的账号登录凭据,账号随之退出登录;服务拒绝账号登录凭据时,会在读完整段录音之前断开连接,因此这次拒绝以 service-unavailable 呈现给用户,登录凭据由下一个收到 401 的请求作废。验证覆盖自动路由与语言规则、通过真实 DeepSeekAuth 的两种凭据及其顺序、状态码分类,以及在真实组合中通过浏览器登录并对本机服务听写。