/** * Writes the Whisper initial prompt to ApiCore-Whisper/vocabulary.txt, so the * Python image uses the same word list as the backend (one source: * src/voice/core/voice-vocabulary.ts). Run `npm run export:voice-vocabulary` * after changing the list; voice-vocabulary-export.spec.ts fails until you do. */ import { mkdirSync, writeFileSync } from 'node:fs'; import { dirname, join } from 'node:path'; import { whisperInitialPrompt } from '../src/voice/core/voice-vocabulary'; const target = join(__dirname, '..', '..', 'ApiCore-Whisper', 'vocabulary.txt'); mkdirSync(dirname(target), { recursive: true }); writeFileSync(target, `${whisperInitialPrompt()}\n`, 'utf8'); console.log(`Wrote ${target}`);