Open
Description
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 fieldsprefixPaddingMs
andsilenceDurationMs
inRealtimeServerVadTurnDetection
class as well as to thetoJson
method. - The member variables should now be generated as Java
Duration
types toJson
will try to serialize these as String usingjsonWriter.writeStringField
Checklist
- Follow our Code of Conduct
- Check that there isn't already an issue that request the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion.
- The provided reproduction is a minimal reproducible example of the bug.