@@ -41,24 +41,24 @@ public class ToolJsonConverter : global::System.Text.Json.Serialization.JsonConv
4141 }
4242
4343 readerCopy = reader ;
44- global ::tryAGI . OpenAI . WebSearchPreviewTool ? webSearchPreview = default ;
44+ global ::tryAGI . OpenAI . ComputerUsePreviewTool ? computerUsePreview = default ;
4545 try
4646 {
47- var typeInfo = typeInfoResolver . GetTypeInfo ( typeof ( global ::tryAGI . OpenAI . WebSearchPreviewTool ) , options ) as global ::System . Text . Json . Serialization . Metadata . JsonTypeInfo < global ::tryAGI . OpenAI . WebSearchPreviewTool > ??
48- throw new global ::System . InvalidOperationException ( $ "Cannot get type info for { typeof ( global ::tryAGI . OpenAI . WebSearchPreviewTool ) . Name } ") ;
49- webSearchPreview = global ::System . Text . Json . JsonSerializer . Deserialize ( ref readerCopy , typeInfo ) ;
47+ var typeInfo = typeInfoResolver . GetTypeInfo ( typeof ( global ::tryAGI . OpenAI . ComputerUsePreviewTool ) , options ) as global ::System . Text . Json . Serialization . Metadata . JsonTypeInfo < global ::tryAGI . OpenAI . ComputerUsePreviewTool > ??
48+ throw new global ::System . InvalidOperationException ( $ "Cannot get type info for { typeof ( global ::tryAGI . OpenAI . ComputerUsePreviewTool ) . Name } ") ;
49+ computerUsePreview = global ::System . Text . Json . JsonSerializer . Deserialize ( ref readerCopy , typeInfo ) ;
5050 }
5151 catch ( global ::System . Text . Json . JsonException )
5252 {
5353 }
5454
5555 readerCopy = reader ;
56- global ::tryAGI . OpenAI . ComputerUsePreviewTool ? computerUsePreview = default ;
56+ global ::tryAGI . OpenAI . WebSearchTool ? webSearch = default ;
5757 try
5858 {
59- var typeInfo = typeInfoResolver . GetTypeInfo ( typeof ( global ::tryAGI . OpenAI . ComputerUsePreviewTool ) , options ) as global ::System . Text . Json . Serialization . Metadata . JsonTypeInfo < global ::tryAGI . OpenAI . ComputerUsePreviewTool > ??
60- throw new global ::System . InvalidOperationException ( $ "Cannot get type info for { typeof ( global ::tryAGI . OpenAI . ComputerUsePreviewTool ) . Name } ") ;
61- computerUsePreview = global ::System . Text . Json . JsonSerializer . Deserialize ( ref readerCopy , typeInfo ) ;
59+ var typeInfo = typeInfoResolver . GetTypeInfo ( typeof ( global ::tryAGI . OpenAI . WebSearchTool ) , options ) as global ::System . Text . Json . Serialization . Metadata . JsonTypeInfo < global ::tryAGI . OpenAI . WebSearchTool > ??
60+ throw new global ::System . InvalidOperationException ( $ "Cannot get type info for { typeof ( global ::tryAGI . OpenAI . WebSearchTool ) . Name } ") ;
61+ webSearch = global ::System . Text . Json . JsonSerializer . Deserialize ( ref readerCopy , typeInfo ) ;
6262 }
6363 catch ( global ::System . Text . Json . JsonException )
6464 {
@@ -124,16 +124,29 @@ public class ToolJsonConverter : global::System.Text.Json.Serialization.JsonConv
124124 {
125125 }
126126
127+ readerCopy = reader ;
128+ global ::tryAGI . OpenAI . WebSearchPreviewTool ? webSearchPreview = default ;
129+ try
130+ {
131+ var typeInfo = typeInfoResolver . GetTypeInfo ( typeof ( global ::tryAGI . OpenAI . WebSearchPreviewTool ) , options ) as global ::System . Text . Json . Serialization . Metadata . JsonTypeInfo < global ::tryAGI . OpenAI . WebSearchPreviewTool > ??
132+ throw new global ::System . InvalidOperationException ( $ "Cannot get type info for { typeof ( global ::tryAGI . OpenAI . WebSearchPreviewTool ) . Name } ") ;
133+ webSearchPreview = global ::System . Text . Json . JsonSerializer . Deserialize ( ref readerCopy , typeInfo ) ;
134+ }
135+ catch ( global ::System . Text . Json . JsonException )
136+ {
137+ }
138+
127139 var result = new global ::tryAGI . OpenAI . Tool (
128140 function ,
129141 fileSearch ,
130- webSearchPreview ,
131142 computerUsePreview ,
143+ webSearch ,
132144 mCP ,
133145 codeInterpreter ,
134146 imageGen ,
135147 localShell ,
136- custom
148+ custom ,
149+ webSearchPreview
137150 ) ;
138151
139152 if ( function != null )
@@ -148,18 +161,18 @@ public class ToolJsonConverter : global::System.Text.Json.Serialization.JsonConv
148161 throw new global ::System . InvalidOperationException ( $ "Cannot get type info for { typeof ( global ::tryAGI . OpenAI . FileSearchTool ) . Name } ") ;
149162 _ = global ::System . Text . Json . JsonSerializer . Deserialize ( ref reader , typeInfo ) ;
150163 }
151- else if ( webSearchPreview != null )
152- {
153- var typeInfo = typeInfoResolver . GetTypeInfo ( typeof ( global ::tryAGI . OpenAI . WebSearchPreviewTool ) , options ) as global ::System . Text . Json . Serialization . Metadata . JsonTypeInfo < global ::tryAGI . OpenAI . WebSearchPreviewTool > ??
154- throw new global ::System . InvalidOperationException ( $ "Cannot get type info for { typeof ( global ::tryAGI . OpenAI . WebSearchPreviewTool ) . Name } ") ;
155- _ = global ::System . Text . Json . JsonSerializer . Deserialize ( ref reader , typeInfo ) ;
156- }
157164 else if ( computerUsePreview != null )
158165 {
159166 var typeInfo = typeInfoResolver . GetTypeInfo ( typeof ( global ::tryAGI . OpenAI . ComputerUsePreviewTool ) , options ) as global ::System . Text . Json . Serialization . Metadata . JsonTypeInfo < global ::tryAGI . OpenAI . ComputerUsePreviewTool > ??
160167 throw new global ::System . InvalidOperationException ( $ "Cannot get type info for { typeof ( global ::tryAGI . OpenAI . ComputerUsePreviewTool ) . Name } ") ;
161168 _ = global ::System . Text . Json . JsonSerializer . Deserialize ( ref reader , typeInfo ) ;
162169 }
170+ else if ( webSearch != null )
171+ {
172+ var typeInfo = typeInfoResolver . GetTypeInfo ( typeof ( global ::tryAGI . OpenAI . WebSearchTool ) , options ) as global ::System . Text . Json . Serialization . Metadata . JsonTypeInfo < global ::tryAGI . OpenAI . WebSearchTool > ??
173+ throw new global ::System . InvalidOperationException ( $ "Cannot get type info for { typeof ( global ::tryAGI . OpenAI . WebSearchTool ) . Name } ") ;
174+ _ = global ::System . Text . Json . JsonSerializer . Deserialize ( ref reader , typeInfo ) ;
175+ }
163176 else if ( mCP != null )
164177 {
165178 var typeInfo = typeInfoResolver . GetTypeInfo ( typeof ( global ::tryAGI . OpenAI . MCPTool ) , options ) as global ::System . Text . Json . Serialization . Metadata . JsonTypeInfo < global ::tryAGI . OpenAI . MCPTool > ??
@@ -190,6 +203,12 @@ public class ToolJsonConverter : global::System.Text.Json.Serialization.JsonConv
190203 throw new global ::System . InvalidOperationException ( $ "Cannot get type info for { typeof ( global ::tryAGI . OpenAI . CustomTool ) . Name } ") ;
191204 _ = global ::System . Text . Json . JsonSerializer . Deserialize ( ref reader , typeInfo ) ;
192205 }
206+ else if ( webSearchPreview != null )
207+ {
208+ var typeInfo = typeInfoResolver . GetTypeInfo ( typeof ( global ::tryAGI . OpenAI . WebSearchPreviewTool ) , options ) as global ::System . Text . Json . Serialization . Metadata . JsonTypeInfo < global ::tryAGI . OpenAI . WebSearchPreviewTool > ??
209+ throw new global ::System . InvalidOperationException ( $ "Cannot get type info for { typeof ( global ::tryAGI . OpenAI . WebSearchPreviewTool ) . Name } ") ;
210+ _ = global ::System . Text . Json . JsonSerializer . Deserialize ( ref reader , typeInfo ) ;
211+ }
193212
194213 return result ;
195214 }
@@ -215,18 +234,18 @@ public override void Write(
215234 throw new global ::System . InvalidOperationException ( $ "Cannot get type info for { typeof ( global ::tryAGI . OpenAI . FileSearchTool ) . Name } ") ;
216235 global ::System . Text . Json . JsonSerializer . Serialize ( writer , value . FileSearch , typeInfo ) ;
217236 }
218- else if ( value . IsWebSearchPreview )
219- {
220- var typeInfo = typeInfoResolver . GetTypeInfo ( typeof ( global ::tryAGI . OpenAI . WebSearchPreviewTool ) , options ) as global ::System . Text . Json . Serialization . Metadata . JsonTypeInfo < global ::tryAGI . OpenAI . WebSearchPreviewTool ? > ??
221- throw new global ::System . InvalidOperationException ( $ "Cannot get type info for { typeof ( global ::tryAGI . OpenAI . WebSearchPreviewTool ) . Name } ") ;
222- global ::System . Text . Json . JsonSerializer . Serialize ( writer , value . WebSearchPreview , typeInfo ) ;
223- }
224237 else if ( value . IsComputerUsePreview )
225238 {
226239 var typeInfo = typeInfoResolver . GetTypeInfo ( typeof ( global ::tryAGI . OpenAI . ComputerUsePreviewTool ) , options ) as global ::System . Text . Json . Serialization . Metadata . JsonTypeInfo < global ::tryAGI . OpenAI . ComputerUsePreviewTool ? > ??
227240 throw new global ::System . InvalidOperationException ( $ "Cannot get type info for { typeof ( global ::tryAGI . OpenAI . ComputerUsePreviewTool ) . Name } ") ;
228241 global ::System . Text . Json . JsonSerializer . Serialize ( writer , value . ComputerUsePreview , typeInfo ) ;
229242 }
243+ else if ( value . IsWebSearch )
244+ {
245+ var typeInfo = typeInfoResolver . GetTypeInfo ( typeof ( global ::tryAGI . OpenAI . WebSearchTool ) , options ) as global ::System . Text . Json . Serialization . Metadata . JsonTypeInfo < global ::tryAGI . OpenAI . WebSearchTool ? > ??
246+ throw new global ::System . InvalidOperationException ( $ "Cannot get type info for { typeof ( global ::tryAGI . OpenAI . WebSearchTool ) . Name } ") ;
247+ global ::System . Text . Json . JsonSerializer . Serialize ( writer , value . WebSearch , typeInfo ) ;
248+ }
230249 else if ( value . IsMCP )
231250 {
232251 var typeInfo = typeInfoResolver . GetTypeInfo ( typeof ( global ::tryAGI . OpenAI . MCPTool ) , options ) as global ::System . Text . Json . Serialization . Metadata . JsonTypeInfo < global ::tryAGI . OpenAI . MCPTool ? > ??
@@ -257,6 +276,12 @@ public override void Write(
257276 throw new global ::System . InvalidOperationException ( $ "Cannot get type info for { typeof ( global ::tryAGI . OpenAI . CustomTool ) . Name } ") ;
258277 global ::System . Text . Json . JsonSerializer . Serialize ( writer , value . Custom , typeInfo ) ;
259278 }
279+ else if ( value . IsWebSearchPreview )
280+ {
281+ var typeInfo = typeInfoResolver . GetTypeInfo ( typeof ( global ::tryAGI . OpenAI . WebSearchPreviewTool ) , options ) as global ::System . Text . Json . Serialization . Metadata . JsonTypeInfo < global ::tryAGI . OpenAI . WebSearchPreviewTool ? > ??
282+ throw new global ::System . InvalidOperationException ( $ "Cannot get type info for { typeof ( global ::tryAGI . OpenAI . WebSearchPreviewTool ) . Name } ") ;
283+ global ::System . Text . Json . JsonSerializer . Serialize ( writer , value . WebSearchPreview , typeInfo ) ;
284+ }
260285 }
261286 }
262287}
0 commit comments