What is the current behavior?
deepgram.transcription.live returns a LiveTranscription | ErrorResponse, which makes it a bit unergonomic to use in TypeScript, because you have to explicitly cast the result to LiveTranscription:
const transcriber = deepgram.transcription.live({
model: "nova",
// other options...
}) as LiveTranscription;
Since it can never be ErrorResponse (see implementation here, which can only return a new instance of LiveTranscription) would you consider reverting this change to how it was pre 2.0.0, where it just returns LiveTranscription?
If it's important to keep ErrorResponse, would you be able to suggest a way to safely use the return value, e.g. exporting LiveTranscription and ErrorResponse from this package, and thereby adding support for:
if (transcriber instanceof LiveTranscription) {
// happy
} else if (transcriber instanceof ErrorResponse) {
// not happy
}
Thank you! 😃
What is the current behavior?
deepgram.transcription.livereturns aLiveTranscription | ErrorResponse, which makes it a bit unergonomic to use in TypeScript, because you have to explicitly cast the result toLiveTranscription:Since it can never be
ErrorResponse(see implementation here, which can only return a new instance of LiveTranscription) would you consider reverting this change to how it was pre 2.0.0, where it just returnsLiveTranscription?If it's important to keep
ErrorResponse, would you be able to suggest a way to safely use the return value, e.g. exportingLiveTranscriptionandErrorResponsefrom this package, and thereby adding support for:Thank you! 😃