providerAppLocalAudioSpeech (local-audio/index.ts)

airi · packages/stage-ui/src/libs/providers/providers/local-audio/index.ts · typescript · MIT
voice

Provider module that creates local audio TTS and transcription services using OpenAI APIs.

// Source: https://github.com/moeru-ai/airi | License: MIT | Copyright 2024-PRESENT Neko Ayaka
// Provided via justclaw.it.com; keep this notice with the code.
import type { ComposerTranslation } from 'vue-i18n'

import { isStageTamagotchi } from '@proj-airi/stage-shared'
import { isWebGPUSupported } from '@proj-airi/stage-shared/webgpu'
import { createOpenAI } from '@xsai-ext/providers/create'
import { z } from 'zod'

import { defineProvider } from '../registry'

const localAudioConfigSchema = z.object({
  apiKey: z.string().optional(),
  baseUrl: z.string().optional().default(''),
})

type LocalAudioConfig = z.input<typeof localAudioConfigSchema>

function createLocalAudioConfigSchema(t: ComposerTranslation) {
  return localAudioConfigSchema.extend({
    apiKey: localAudioConfigSchema.sh

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

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

Get a free API key