feat: OpenAI-compatible transcriber provider (#5) #6
@ -130,10 +130,11 @@ 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', `внутренняя ошибка: ${errorText(e)}`);
|
||||
result = fail('temporary', redact(`внутренняя ошибка: ${errorText(e)}`, { apiKey, boundary }));
|
||||
}
|
||||
return result.ok ? result : { ...result, message: redact(result.message, { apiKey, boundary }) };
|
||||
return result;
|
||||
}
|
||||
|
||||
private request(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user