Add provider-backed dictation mode (#1327)

This commit is contained in:
SSU-WEI HUANG
2026-08-03 06:05:58 +08:00
committed by GitHub
parent abf9cb02a5
commit 9d07857570
22 changed files with 934 additions and 43 deletions
+12
View File
@@ -115,4 +115,16 @@ describe('ApiClient error mapping', () => {
})
expect(new Headers(init?.headers).get('content-type')).toBe('application/json')
})
it('lets fetch set the multipart boundary for transcription uploads', async () => {
fetchMock.mockResolvedValueOnce(new Response(JSON.stringify({ text: 'hello' }), { status: 200 }))
const api = new ApiClient('test-token')
const file = new File(['audio'], 'speech.webm', { type: 'audio/webm' })
await api.transcribeVoice({ file, provider: 'openai', mode: 'standard' })
const [, init] = fetchMock.mock.calls[0] ?? []
expect(init?.body).toBeInstanceOf(FormData)
expect(new Headers(init?.headers).has('content-type')).toBe(false)
})
})