diff --git a/.dotnet/src/Custom/RealtimeConversation/Internal/InternalRealtimeServerVadTurnDetection.Serialization.cs b/.dotnet/src/Custom/RealtimeConversation/Internal/InternalRealtimeServerVadTurnDetection.Serialization.cs index 98aeaa1b1..83167137f 100644 --- a/.dotnet/src/Custom/RealtimeConversation/Internal/InternalRealtimeServerVadTurnDetection.Serialization.cs +++ b/.dotnet/src/Custom/RealtimeConversation/Internal/InternalRealtimeServerVadTurnDetection.Serialization.cs @@ -12,6 +12,12 @@ namespace OpenAI.RealtimeConversation; [CodeGenSerialization(nameof(SilenceDurationMs), DeserializationValueHook = nameof(DeserializeMillisecondDuration), SerializationValueHook = nameof(SerializeSilenceDurationMs))] internal partial class InternalRealtimeServerVadTurnDetection { + // CUSTOM: Represent millisecond durations as timespans + [CodeGenMember("PrefixPaddingMs")] + public TimeSpan? PrefixPaddingMs { get; set; } + [CodeGenMember("SilenceDurationms")] + public TimeSpan? SilenceDurationMs { get; set; } + private static void DeserializeMillisecondDuration(JsonProperty property, ref TimeSpan? duration) { if (property.Value.ValueKind == JsonValueKind.Number) diff --git a/.dotnet/src/Generated/Models/InternalRealtimeServerVadTurnDetection.cs b/.dotnet/src/Generated/Models/InternalRealtimeServerVadTurnDetection.cs index e0ec40082..5136bd6d8 100644 --- a/.dotnet/src/Generated/Models/InternalRealtimeServerVadTurnDetection.cs +++ b/.dotnet/src/Generated/Models/InternalRealtimeServerVadTurnDetection.cs @@ -22,7 +22,5 @@ internal InternalRealtimeServerVadTurnDetection(ConversationTurnDetectionKind ki } public float? Threshold { get; set; } - public TimeSpan? PrefixPaddingMs { get; set; } - public TimeSpan? SilenceDurationMs { get; set; } } } diff --git a/.openapi3/openapi3-openai.yaml b/.openapi3/openapi3-openai.yaml index 2a86f0794..af215b28f 100644 --- a/.openapi3/openapi3-openai.yaml +++ b/.openapi3/openapi3-openai.yaml @@ -10596,11 +10596,13 @@ components: format: float default: 0.5 prefix_padding_ms: - type: string - format: duration + type: integer + format: int32 + default: 300 silence_duration_ms: - type: string - format: duration + type: integer + format: int32 + default: 200 allOf: - $ref: '#/components/schemas/RealtimeTurnDetection' RealtimeTool: diff --git a/.typespec/realtime/custom.tsp b/.typespec/realtime/custom.tsp index cb2588bea..2b69f2a26 100644 --- a/.typespec/realtime/custom.tsp +++ b/.typespec/realtime/custom.tsp @@ -106,12 +106,8 @@ model RealtimeTurnDetection { model RealtimeServerVadTurnDetection extends RealtimeTurnDetection { type: RealtimeTurnDetectionType.server_vad; threshold?: float32 = 0.5; - - // @encode("milliseconds", int32) - prefix_padding_ms?: duration; // = 300ms - - // @encode("milliseconds", int32) - silence_duration_ms?: duration; // = 200,s + prefix_padding_ms?: int32 = 300; + silence_duration_ms?: int32 = 200; } union RealtimeResponseStatus {