livekit-plugins-sarvam: support Sarvam keyterms for STT biasing

未关闭
#7,682 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@15054538509 已经在做这个了。

开始于 2026年10月9日。

  • #7683 来自 @15054538509 —— 未关闭
  • #7686 来自 @icebear02 —— 已关闭,未合并

评估

难度
3/5
预计耗时
1-2 天
新手友好度
18/100
Issue 类型
功能
描述清晰度
描述清楚
活跃度
活跃
技术栈
python

调研方向

Start with the SarvamSTT and SarvamStreamingSTT constructors and update_options(), and with how MODEL_CONFIGS gates supports_prompt by model. Check open pull request #7683 first, since it likely already covers this work. Done means keyterms is validated against the 50-term and 64-character limits, sent on the streaming WebSocket connect and in the REST request, and only applied to saaras:v4.

由索引模型根据 Issue 内容生成。

描述

Feature Type: Would make my life easier

Feature Description

Add keyterms support to livekit-plugins-sarvam STT, so callers can bias Sarvam's recognition toward names and domain terms (brands, products, people, places).

Sarvam's API now accepts a keyterms parameter on speech-to-text: a JSON list of strings, up to 50 distinct terms of at most 64 characters each, one term per list item. It is supported on saaras:v4 across REST, Batch, and both WebSocket endpoints (/speech-to-text/ws and /speech-to-text-realtime/ws). Keyterms bias recognition but do not guarantee that a term appears. For streaming, they are fixed when the connection opens and apply to the whole session.

Reference: https://docs.sarvam.ai/api/api-guides-tutorials/speech-to-text/how-to/keyterms

The plugin cannot pass this today:

  • SarvamSTT / SarvamStreamingSTT have no keyterms argument.
  • The existing prompt option is a free-text prompt for saaras translate (see #6606), not a term list, so it cannot stand in for keyterms.
  • I checked livekit-plugins-sarvam 1.6.7 and the latest 1.8.5 wheel. Neither contains keyterm or hotword.

Requested behavior:

  1. A keyterms: list[str] | None option on the STT constructor and update_options(), validated against the 50-term and 64-character limits.
  2. Sent as the keyterms query parameter on the streaming WebSocket connect (URL-encoded, one per item) and as a field in the REST/batch request.
  3. Only applied for models that support it (saaras:v4), consistent with how MODEL_CONFIGS handles supports_prompt.

Workarounds / Alternatives

We are currently unable to use keyterms through the plugin. The options we see are a raw WebSocket client that adds the query parameter ourselves, or patching the plugin locally. Both leave us maintaining Sarvam-specific transport code that the plugin should own.

Additional Context

  • Sarvam pricing does not list a separate charge for keyterms. The docs list per-hour speech-to-text rates only.
  • Related: #6606 (closed) covers supports_prompt for saaras:v3 on the same endpoint.
主要语言
Python
星标
14.6k
派生
3.9k
平均合并
2 天 23 小时
30 天内合并 PR
258

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

livekit/agents 的其他 Issue

查看 livekit/agents 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。