From d917a788ae4437b8679551cab2f87e9a8f852a94 Mon Sep 17 00:00:00 2001 From: Brian Yin Date: Mon, 27 Apr 2026 13:30:09 +0800 Subject: [PATCH] chore(openai): remove STT.withGroq constructor Port of livekit/agents#5555. Groq has its own dedicated plugin, so the OpenAI plugin no longer ships a Groq STT shortcut. - Remove `STT.withGroq` static constructor from `plugins/openai/src/stt.ts` - Drop the now-unused `GroqAudioModels` type from `plugins/openai/src/models.ts` - Drop the `GroqAudioModels` import from `stt.ts` --- plugins/openai/src/models.ts | 5 ----- plugins/openai/src/stt.ts | 31 +------------------------------ 2 files changed, 1 insertion(+), 35 deletions(-) diff --git a/plugins/openai/src/models.ts b/plugins/openai/src/models.ts index dee2fe8a7..0fa066e33 100644 --- a/plugins/openai/src/models.ts +++ b/plugins/openai/src/models.ts @@ -112,11 +112,6 @@ export type GroqChatModels = | 'gemma-7b-it' | 'gemma2-9b-it'; -export type GroqAudioModels = - | 'whisper-large-v3' - | 'distil-whisper-large-v3-en' - | 'whisper-large-v3-turbo'; - export type DeepSeekChatModels = 'deepseek-coder' | 'deepseek-chat'; export type TogetherChatModels = diff --git a/plugins/openai/src/stt.ts b/plugins/openai/src/stt.ts index 14c7a3779..099c6a315 100644 --- a/plugins/openai/src/stt.ts +++ b/plugins/openai/src/stt.ts @@ -4,7 +4,7 @@ import { type AudioBuffer, mergeFrames, normalizeLanguage, stt } from '@livekit/agents'; import type { AudioFrame } from '@livekit/rtc-node'; import { OpenAI } from 'openai'; -import type { GroqAudioModels, WhisperModels } from './models.js'; +import type { WhisperModels } from './models.js'; export interface STTOptions { apiKey?: string; @@ -68,35 +68,6 @@ export class STT extends stt.STT { }); } - /** - * Create a new instance of Groq STT. - * - * @remarks - * `apiKey` must be set to your Groq API key, either using the argument or by setting the - * `GROQ_API_KEY` environment variable. - */ - static withGroq( - opts: Partial<{ - model: string | GroqAudioModels; - apiKey?: string; - baseURL?: string; - client: OpenAI; - language: string; - detectLanguage: boolean; - }> = {}, - ): STT { - opts.apiKey = opts.apiKey || process.env.GROQ_API_KEY; - if (opts.apiKey === undefined) { - throw new Error('Groq API key is required, whether as an argument or as $GROQ_API_KEY'); - } - - return new STT({ - model: 'whisper-large-v3-turbo', - baseURL: 'https://api.groq.com/openai/v1', - ...opts, - }); - } - /** * Create a new instance of OVHcloud AI Endpoints STT. *