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

[Bug]: Unexpected field as JSON String instead of number #5158

Open
4 tasks done
jpalvarezl opened this issue Nov 20, 2024 · 0 comments
Open
4 tasks done

[Bug]: Unexpected field as JSON String instead of number #5158

jpalvarezl opened this issue Nov 20, 2024 · 0 comments
Labels
bug Something isn't working needs-area

Comments

@jpalvarezl
Copy link
Member

Describe the bug

While generating the client library for the Azure OpenAI Realtime Audio client library, I noticed that the fields prefix_padding_ms and silence_duration_ms are serialized as JSON Strings, but the service actually expects a JSON number, failing the request.

The TSP definition for the model in question can be found here: https://github.com/joseharriaga/openai-in-typespec/blob/0cd29e191a157fe4356fed68707a2c43a5f728be/.typespec/realtime/custom.tsp#L106-L115

We are fully aware that we might not be using duration correctly. So this could very well be a spec definition issue from our side.

Reproduction

  • Re-add the @Generated annotation to the fields prefixPaddingMs and silenceDurationMs in RealtimeServerVadTurnDetection class as well as to the toJson method.
  • The member variables should now be generated as Java Duration types
  • toJson will try to serialize these as String using jsonWriter.writeStringField

Checklist

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs-area
Projects
None yet
Development

No branches or pull requests

1 participant