Closed bensalilijames closed 1 year ago
This is a really good explanation and suggestion. We have a PR in-progress to revert those changes, and I am planning on a change for the v3 SDK to change it to a pattern that i've personally got a lot more enjoyment from using
const { ws, error } = deepgram.transcription.live({...etc});
and
const { result, error } = deepgram.transcription.preRecorded({...etc});
closed by #142
What is the current behavior?
deepgram.transcription.live
returns 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. exportingLiveTranscription
andErrorResponse
from this package, and thereby adding support for:Thank you! 😃