Add "tags" option for Deepgram v1 STT plugin

I created this issue in the Livekit plugins repo and was hoping to raise additional visibility here.

Issue: There is currently no way for the v1 @livekit/agents-plugin-deepgram STT class to pass Deepgram usage tags.

Proposal: Let callers of @livekit/agents-plugin-deepgram’s v1 STT class pass Deepgram usage tags, sent as repeated tag= query parameters on /v1/listen. This would be incredibly helpful to allow implementers to tag STT usage with some granularity.

STTv2 (Flux, /v2/listen) already supports tags. The v1 STT class does not, up to and including 1.9.5. This proposal would bring v1 to parity with v2.

Any opposition to us raising a PR to address this? Let me know any feedback or thoughts. Thanks!

Welcome @Malcolm_Snyder. No opposition here, it is a clean parity fix. The v1 STT class has no tag field today; its options stop at keyterm, redact, keywords and the rest (stt.ts), while Deepgram documents tag as a repeated query parameter on both streaming Nova and Flux, like tag=marketing&tag=legal (tagging). So v1 is the only gap, and it is worth closing.

The plumbing is already in the file, which keeps the PR small. keyterm and language_hint go into the params object and appendSearchParams turns an array into repeated keys, which is exactly the tag=a&tag=b shape Deepgram wants. Add tags?: string[] to STTOptions and feed it through the same params record in both _recognize and SpeechStream.run:

// STTOptions: add `tags?: string[]`
const params = {
  // ...existing: model, language, keyterm, ...
  tag: this.#opts.tags,   // string[] -> repeated: tag=env:prod&tag=team:voice
};
appendSearchParams(streamURL, params);   // already handles arrays as repeated keys

Your issue #2941 is the right tracker. Put the PR against both the REST and streaming paths and it should review quickly.

Am I right to say that Python agents support this (introduced in add supports for tags by ChenghaoMou · Pull Request #1886 · livekit/agents · GitHub ) but your request is for JS agents, which currently do not support it?

Thank you both for the validation and feedback! It is really appreciated.

@darryncampbell That is correct, my request is for JS agents, I meant to specify in my original post.

I have raised a PR in the plugins repo to address this here: feat(deepgram): Support usage tags on v1 STT by snydermb · Pull Request #2965 · livekit/agents-js · GitHub

Thanks, currently trying to work with the engineering teams to make it easier to facilitate conversations about new features like this before the PR gets raised.

You initiated a discussion in both GH issues and this community, which would be the gold standard and helps the team sift-out low-effort submissions.

Makes total sense @darryncampbell - glad to know. What do you think a reasonable timeline expectation on getting this reviewed/merged would be? Not sure what the typical cycle looks like here!

It depends on a lot of factors so I wouldn’t be able to guess at a timeline I’m afraid