1 write to Schema
Microsoft.Extensions.AI.Abstractions (1)
ChatCompletion\ChatResponseFormatJson.cs (1)
30Schema = schema;
30 references to Schema
Microsoft.Extensions.AI (3)
ChatCompletion\ChatClientStructuredOutputExtensions.cs (3)
153Debug.Assert(responseFormat.Schema is not null, "ForJsonSchema should always populate Schema"); 154var schema = responseFormat.Schema!.Value; 193{{responseFormat.Schema}}
Microsoft.Extensions.AI.Abstractions (5)
ChatCompletion\ChatResponseFormatJson.cs (1)
46private string DebuggerDisplay => Schema?.ToString() ?? "JSON";
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\JsonContext.ChatResponseFormatJson.g.cs (2)
60Getter = static obj => ((global::Microsoft.Extensions.AI.ChatResponseFormatJson)obj).Schema, 128global::System.Text.Json.JsonElement? __value_Schema = ((global::Microsoft.Extensions.AI.ChatResponseFormatJson)value).Schema;
Utilities\AIJsonSchemaTransformCache.cs (2)
47_responseFormatCreateValueCallback = responseFormat => AIJsonUtilities.TransformSchema(responseFormat.Schema!.Value, TransformOptions); 83return responseFormat.Schema is not null
Microsoft.Extensions.AI.Abstractions.Tests (12)
ChatCompletion\ChatResponseFormatTests.cs (10)
38Assert.Null(f.Schema); 47Assert.Equal("{}", JsonSerializer.Serialize(f.Schema, TestJsonSerializerContext.Default.JsonElement)); 70Assert.Null(actual.Schema); 85Assert.Equal("[1,2,3]", JsonSerializer.Serialize(actual.Schema, TestJsonSerializerContext.Default.JsonElement)); 109Assert.NotNull(format.Schema); 110Assert.Equal("""{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"integer"}""", format.Schema.ToString()); 125Assert.NotNull(format.Schema); 126Assert.Contains("\"uri\"", format.Schema.ToString()); 167JsonSerializer.Serialize(format.Schema, AIJsonUtilities.DefaultOptions.GetTypeInfo(typeof(JsonElement)))); 182Assert.NotNull(format.Schema);
Generated\361d1da7f942c932\TestJsonSerializerContext.ChatResponseFormatJson.g.cs (2)
58Getter = static obj => ((global::Microsoft.Extensions.AI.ChatResponseFormatJson)obj).Schema, 126global::System.Text.Json.JsonElement? __value_Schema = ((global::Microsoft.Extensions.AI.ChatResponseFormatJson)value).Schema;
Microsoft.Extensions.AI.Integration.Tests (1)
ChatClientIntegrationTests.cs (1)
1105Assert.Null(responseFormat.Schema);
Microsoft.Extensions.AI.Tests (9)
ChatCompletion\ChatClientStructuredOutputExtensionsTests.cs (7)
37Assert.NotNull(responseFormat.Schema); 63""").RootElement, responseFormat.Schema.Value); 114Assert.Null(responseFormat.Schema); 183""", responseFormat.Schema.ToString()); 227""", responseFormat.Schema.ToString()); 374Assert.NotNull(responseFormat.Schema); 395""").RootElement, responseFormat.Schema.Value);
Generated\361d1da7f942c932\TestJsonSerializerContext.ChatResponseFormatJson.g.cs (2)
58Getter = static obj => ((global::Microsoft.Extensions.AI.ChatResponseFormatJson)obj).Schema, 127global::System.Text.Json.JsonSerializer.Serialize(writer, ((global::Microsoft.Extensions.AI.ChatResponseFormatJson)value).Schema, NullableJsonElement);