Mocks (no API key)
Example: examples/node-cli
Mocks share the same event contract as live providers, so the UI is written once.
import { createMockAudioLLM, createMockRuntime, createVoiceSession,} from '@ottervoice/core';
const runtime = createMockRuntime();const session = createVoiceSession({ mode: 'half_duplex', runtime, providers: { audioLlm: createMockAudioLLM({ inputTranscripts: ['Hello Otter'], reply: () => 'Hello! How can I help?', }), },});
session.on('asr_partial', ({ text }) => console.log('user:', text));session.on('assistant_text_delta', ({ text }) => console.log('assistant:', text));
await session.start();
runtime.audioInput.emitChunk({ data: new ArrayBuffer(8), timestamp: Date.now(), durationMs: 800,});bun run demo# same as bun run examples/node-cli/index.tsProduction only replaces runtime and providers. Session wiring stays the same.