voice - log errors (#208983)

This commit is contained in:
Benjamin Pasero 2024-03-28 09:11:38 +01:00 committed by GitHub
parent c3d8708d13
commit b50ce76b2b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 14 additions and 5 deletions

View file

@ -4404,7 +4404,8 @@ export enum SpeechToTextStatus {
Started = 1,
Recognizing = 2,
Recognized = 3,
Stopped = 4
Stopped = 4,
Error = 5
}
export enum KeywordRecognitionStatus {

View file

@ -147,6 +147,7 @@ export class SpeechService extends Disposable implements ISpeechService {
const sessionStart = Date.now();
let sessionRecognized = false;
let sessionError = false;
let sessionContentLength = 0;
const disposables = new DisposableStore();
@ -164,6 +165,7 @@ export class SpeechService extends Disposable implements ISpeechService {
context: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Context of the session.' };
sessionDuration: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; isMeasurement: true; comment: 'Duration of the session.' };
sessionRecognized: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; isMeasurement: true; comment: 'If speech was recognized.' };
sessionError: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; isMeasurement: true; comment: 'If speech resulted in error.' };
sessionContentLength: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; isMeasurement: true; comment: 'Length of the recognized text.' };
sessionLanguage: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Configured language for the session.' };
};
@ -171,6 +173,7 @@ export class SpeechService extends Disposable implements ISpeechService {
context: string;
sessionDuration: number;
sessionRecognized: boolean;
sessionError: boolean;
sessionContentLength: number;
sessionLanguage: string;
};
@ -178,6 +181,7 @@ export class SpeechService extends Disposable implements ISpeechService {
context,
sessionDuration: Date.now() - sessionStart,
sessionRecognized,
sessionError,
sessionContentLength,
sessionLanguage: language
});
@ -211,6 +215,10 @@ export class SpeechService extends Disposable implements ISpeechService {
case SpeechToTextStatus.Stopped:
onSessionStoppedOrCanceled();
break;
case SpeechToTextStatus.Error:
this.logService.error(`Speech provider error in speech to text session: ${e.text}`);
sessionError = true;
break;
}
}));

View file

@ -26,7 +26,8 @@ export enum SpeechToTextStatus {
Started = 1,
Recognizing = 2,
Recognized = 3,
Stopped = 4
Stopped = 4,
Error = 5
}
export interface ISpeechToTextEvent {

View file

@ -97,7 +97,6 @@ export class TerminalVoiceSession extends Disposable {
}
switch (e.status) {
case SpeechToTextStatus.Started:
// TODO: play start audio cue
if (!this._decoration) {
this._createDecoration();
}
@ -117,7 +116,6 @@ export class TerminalVoiceSession extends Disposable {
}
break;
case SpeechToTextStatus.Stopped:
// TODO: play stop audio cue
this.stop();
break;
}

View file

@ -15,7 +15,8 @@ declare module 'vscode' {
Started = 1,
Recognizing = 2,
Recognized = 3,
Stopped = 4
Stopped = 4,
Error = 5
}
export interface SpeechToTextEvent {