@@ -12,7 +12,7 @@ namespace OpenAI.Chat
1212{
1313 public partial class ChatCompletionMessageListDatum : IJsonModel < ChatCompletionMessageListDatum >
1414 {
15- internal ChatCompletionMessageListDatum ( ) : this ( null , null , null , null , null , null , null , default , null )
15+ internal ChatCompletionMessageListDatum ( ) : this ( null , null , null , null , null , null , default , null , null )
1616 {
1717 }
1818
@@ -65,6 +65,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit
6565 }
6666 writer . WriteEndArray ( ) ;
6767 }
68+ // Plugin customization: remove options.Format != "W" check
6869 if ( Optional . IsCollectionDefined ( Annotations ) && _additionalBinaryDataProperties ? . ContainsKey ( "annotations" ) != true )
6970 {
7071 writer . WritePropertyName ( "annotations"u8 ) ;
@@ -80,11 +81,6 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit
8081 writer . WritePropertyName ( "function_call"u8 ) ;
8182 writer . WriteObjectValue ( FunctionCall , options ) ;
8283 }
83- if ( Optional . IsDefined ( Audio ) && _additionalBinaryDataProperties ? . ContainsKey ( "audio" ) != true )
84- {
85- writer . WritePropertyName ( "audio"u8 ) ;
86- writer . WriteObjectValue ( Audio , options ) ;
87- }
8884 if ( _additionalBinaryDataProperties ? . ContainsKey ( "id" ) != true )
8985 {
9086 writer . WritePropertyName ( "id"u8 ) ;
@@ -95,6 +91,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit
9591 writer . WritePropertyName ( "role"u8 ) ;
9692 writer . WriteStringValue ( Role . ToSerialString ( ) ) ;
9793 }
94+ if ( Optional . IsDefined ( OutputAudio ) && _additionalBinaryDataProperties ? . ContainsKey ( "audio" ) != true )
95+ {
96+ writer . WritePropertyName ( "audio"u8 ) ;
97+ writer . WriteObjectValue ( OutputAudio , options ) ;
98+ }
9899 // Plugin customization: remove options.Format != "W" check
99100 if ( _additionalBinaryDataProperties != null )
100101 {
@@ -139,11 +140,11 @@ internal static ChatCompletionMessageListDatum DeserializeChatCompletionMessageL
139140 string content = default ;
140141 string refusal = default ;
141142 IReadOnlyList < ChatToolCall > toolCalls = default ;
142- IList < ChatMessageAnnotation > annotations = default ;
143+ IReadOnlyList < ChatMessageAnnotation > annotations = default ;
143144 InternalChatCompletionResponseMessageFunctionCall functionCall = default ;
144- ChatOutputAudio audio = default ;
145145 string id = default ;
146146 ChatMessageRole role = default ;
147+ ChatOutputAudio outputAudio = default ;
147148 IDictionary < string , BinaryData > additionalBinaryDataProperties = new ChangeTrackingDictionary < string , BinaryData > ( ) ;
148149 foreach ( var prop in element . EnumerateObject ( ) )
149150 {
@@ -204,16 +205,6 @@ internal static ChatCompletionMessageListDatum DeserializeChatCompletionMessageL
204205 functionCall = InternalChatCompletionResponseMessageFunctionCall . DeserializeInternalChatCompletionResponseMessageFunctionCall ( prop . Value , options ) ;
205206 continue ;
206207 }
207- if ( prop . NameEquals ( "audio"u8 ) )
208- {
209- if ( prop . Value . ValueKind == JsonValueKind . Null )
210- {
211- audio = null ;
212- continue ;
213- }
214- audio = ChatOutputAudio . DeserializeChatOutputAudio ( prop . Value , options ) ;
215- continue ;
216- }
217208 if ( prop . NameEquals ( "id"u8 ) )
218209 {
219210 id = prop . Value . GetString ( ) ;
@@ -224,6 +215,16 @@ internal static ChatCompletionMessageListDatum DeserializeChatCompletionMessageL
224215 role = prop . Value . GetString ( ) . ToChatMessageRole ( ) ;
225216 continue ;
226217 }
218+ if ( prop . NameEquals ( "audio"u8 ) )
219+ {
220+ if ( prop . Value . ValueKind == JsonValueKind . Null )
221+ {
222+ outputAudio = null ;
223+ continue ;
224+ }
225+ outputAudio = ChatOutputAudio . DeserializeChatOutputAudio ( prop . Value , options ) ;
226+ continue ;
227+ }
227228 // Plugin customization: remove options.Format != "W" check
228229 additionalBinaryDataProperties . Add ( prop . Name , BinaryData . FromString ( prop . Value . GetRawText ( ) ) ) ;
229230 }
@@ -233,9 +234,9 @@ internal static ChatCompletionMessageListDatum DeserializeChatCompletionMessageL
233234 toolCalls ?? new ChangeTrackingList < ChatToolCall > ( ) ,
234235 annotations ?? new ChangeTrackingList < ChatMessageAnnotation > ( ) ,
235236 functionCall ,
236- audio ,
237237 id ,
238238 role ,
239+ outputAudio ,
239240 additionalBinaryDataProperties ) ;
240241 }
241242
0 commit comments