feat: OpenAI-compatible transcriber provider (#5) #6

Merged
aep merged 15 commits from feat/5-openai-transcriber into main 2026-10-10 17:43:23 +03:00
Showing only changes of commit 812ace7f3c - Show all commits

View File

@ -130,11 +130,15 @@ export class OpenAiTranscriber implements Transcriber {
apiKey = s.apiKey;
boundary = makeBoundary(this.random);
result = await this.request(s, audio, mime, signal, boundary);
if (!result.ok) result = { ...result, message: redact(result.message, { apiKey, boundary }) };
} catch (e) {
result = fail('temporary', redact(`внутренняя ошибка: ${errorText(e)}`, { apiKey, boundary }));
result = fail('temporary', `внутренняя ошибка: ${errorText(e)}`);
}
if (result.ok) return result;
try {
return { ...result, message: redact(result.message, { apiKey, boundary }) };
} catch {
return { ...result, message: 'внутренняя ошибка' };
}
return result;
}
private request(