deepgram / deepgram-python-captions

This package is the Python implementation of Deepgram's WebVTT and SRT formatting. Given a transcription, this package can return a valid string to store as WebVTT or SRT caption files.
MIT License
18 stars 1 forks source link

fix: checks response and converts to dict if needed #12

Closed SandraRodgers closed 9 months ago

SandraRodgers commented 9 months ago

I have added logic to check the type of the data that is sent in to the converter. If it isn't a dict, the data will be converted to a dict since the converter expects it to be a dict type:

if not isinstance(dg_response, dict):
            self.response = json.loads(dg_response.to_json())
        else:
            self.response = dg_response