deepgram / deepgram-python-sdk

Official Python SDK for Deepgram's automated speech recognition APIs.
https://developers.deepgram.com
MIT License
235 stars 63 forks source link

Passing keywords parameter fails to url encode #1

Closed jhorman closed 3 years ago

jhorman commented 3 years ago

What's happening that seems wrong?

Pass keywords parameter as a list of strings.

        response = await dg_client.transcription.prerecorded(
            source,
            {
                "punctuate": True,
                "diarize": True,
                "numerals": True,
                "utterances": True,
                "keywords": [
                    "10-Q",
                    "non-GAAP",
                    "GAAP",
                    "CRM",
ValueError: not enough values to unpack (expected 2, got 1)

The data looks like

[('keywords', '10-Q')]
[('keywords', 'non-GAAP')]

and it should look like

('keywords', '10-Q')
('keywords', 'non-GAAP')

So an extra array is ending up around each item.

michaeljolley commented 3 years ago

Thanks for reporting that @jhorman! @frumsdotxyz can you take a look at this?

frumsdotxyz commented 3 years ago

Fixed in v0.1.12 - thanks for the report!

jhorman commented 3 years ago

Great thx. I will say, using this sdk, I am getting a 500, message='Internal Server Error' error trying to use keywords, now that your fix is in.

https://api.deepgram.com/v1/listen?punctuate=true&diarize=true&numerals=true&utterances=true&keywords=test&keywords=test2

frumsdotxyz commented 3 years ago

My sincere apologies for the wait - it turned out that this was an issue with keywords containing spaces in Console itself, not the SDK, which haas now been fixed.