- OpenAI-kompatible Transkription + Processor transcription (done/failed/disabled, AiGeneration, Notiz aus Sprachnotiz) - Claude-Lotse (strukturierte Ausgabe, Refusal/Fallback), Datenminimierung, Vorschläge in content.lotse - Vollständigkeitsprüfung (Regeln + KI-Hinweise mit Deep-Link), Einstellungen, KI-Protokoll - Freigabeprinzip: Submit eines Lotse-Entwurfs nur mit Prüfbestätigung (serverseitig) - Migration lotse_address_form (TenantSettings) Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
17 lines
893 B
TypeScript
17 lines
893 B
TypeScript
import type { ProviderMeta, TranscriptionProvider } from "@/server/ai/providers";
|
|
|
|
/** Deterministic transcription provider for tests/demos: fixed text or configured error. */
|
|
export class FakeTranscriptionProvider implements TranscriptionProvider {
|
|
readonly name = "fake";
|
|
readonly model = "fake-whisper-1";
|
|
readonly calls: Array<{ mimeType: string; size: number; language: string }> = [];
|
|
|
|
constructor(private readonly opts: { text?: string; fail?: Error } = {}) {}
|
|
|
|
async transcribe(input: { bytes: Buffer; mimeType: string; language: "de" | "en" }): Promise<{ text: string; meta: ProviderMeta }> {
|
|
this.calls.push({ mimeType: input.mimeType, size: input.bytes.byteLength, language: input.language });
|
|
if (this.opts.fail) throw this.opts.fail;
|
|
return { text: this.opts.text ?? "Heizkörper im Bad getauscht.", meta: { provider: this.name, model: this.model } };
|
|
}
|
|
}
|