isStandardTtsModel (shared/ttsSettings.ts)

deepchat · src/shared/ttsSettings.ts · typescript · Apache-2.0
voice

Utility functions for validating and normalizing TTS model settings.

// Source: https://github.com/ThinkInAIXYZ/deepchat | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
// Provided via justclaw.it.com; keep this notice with the code.
import { ModelType } from './model'

export const TTS_RESPONSE_FORMAT_VALUES = ['mp3', 'opus', 'aac', 'flac', 'wav', 'pcm'] as const
export type TtsResponseFormat = (typeof TTS_RESPONSE_FORMAT_VALUES)[number]

export interface TtsSettings {
  voice?: string
  responseFormat?: TtsResponseFormat
  speed?: number
  instructions?: string
}

/**
 * Standard OpenAI-style TTS models that use the /audio/speech endpoint (Pattern A).
 */
export const OPENAI_STANDARD_TTS_MODELS = ['tts-1', 'tts-1-hd', 'gpt-4o-mini-tts'] as const

/**
 * Gemini TTS models that use the generateContent endpoint w

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key