Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing HttpException when using Float url parameters with fractional values #178

Merged
merged 1 commit into from
Jan 24, 2024

Conversation

dhymik
Copy link
Contributor

@dhymik dhymik commented Jan 2, 2024

This fixes #177 ("Specifiying UtteranceSplit parameter with a fractional value causes HttpException")

When calling DeepgramClient.Transcription.Prerecorded.GetTranscriptionAsync(...) with a PrerecordedTranscriptionOptions parameter that contains a PrerecordedTranscriptionOptions.UtteranceSplit value which has a fractiuonal value (i.e. 1.2, 2.5) causes HttpException. Values like 2.0, 1.0 do not cause exception.

The issue is the way the float value is being serialized in Deepgram.Utilities.QueryParameterUtil.GetParameters(...)

A parameter value of 2.2
is serialized into this url parameter: utt_split=2%2c2

I added a "Float" type branch in Deepgram.Utilities.QueryParameterUtil.GetParameters(...) which does not url encode the float value and stringifies it with an invariant culture.

@dvonthenen dvonthenen merged commit 7e2b083 into deepgram:main Jan 24, 2024
3 checks passed
@dvonthenen
Copy link
Contributor

thanks for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Specifiying UtteranceSplit parameter with a fractional value causes HttpException
2 participants