Round 3 of cleanup (#186)

- Enable warnings as errors
- Make the remaining src projects NativeAOT compatible
- Use Throw helpers
This commit is contained in:
Stephen Toub
2025-07-20 23:07:50 -04:00
committed by GitHub
parent ccd7a44ec7
commit 6c12b2c0f8
36 changed files with 223 additions and 182 deletions
@@ -609,7 +609,7 @@ internal static class OpenAIClientExtensions2
// Roundtrip the schema through the ToolJson model type to remove extra properties
// and force missing ones into existence, then return the serialized UTF8 bytes as BinaryData.
var tool = JsonSerializer.Deserialize(jsonSchema, OpenAIJsonContext.Default.ToolJson)!;
var tool = jsonSchema.Deserialize(OpenAIJsonContext.Default.ToolJson)!;
var functionParameters = BinaryData.FromBytes(JsonSerializer.SerializeToUtf8Bytes(tool, OpenAIJsonContext.Default.ToolJson));
return functionParameters;