chore: pass prev aggregated transcription for better results

This commit is contained in:
haritabh-z01 2025-12-16 23:33:30 +05:30
parent 688a8409ea
commit 85cc7beaf9

View file

@ -31,6 +31,7 @@ export class AmicalCloudProvider implements TranscriptionProvider {
private currentLanguage: string | undefined;
private currentAccessibilityContext: GetAccessibilityContextResult | null =
null;
private currentAggregatedTranscription: string | undefined;
// Configuration
private readonly FRAME_SIZE = 512; // 32ms at 16kHz
@ -65,6 +66,8 @@ export class AmicalCloudProvider implements TranscriptionProvider {
// Store accessibility context for the API request
this.currentAccessibilityContext = context?.accessibilityContext ?? null;
this.currentAggregatedTranscription = context?.aggregatedTranscription;
// Check authentication
if (!(await this.authService.isAuthenticated())) {
throw new Error("Authentication required for cloud transcription");
@ -174,6 +177,7 @@ export class AmicalCloudProvider implements TranscriptionProvider {
body: JSON.stringify({
audioData: Array.from(audioData),
language: this.currentLanguage,
previousTranscription: this.currentAggregatedTranscription,
formatting: {
enabled: enableFormatting,
},