1 write to Schema
Microsoft.Extensions.AI.Abstractions (1)
ChatCompletion\ChatResponseFormatJson.cs (1)
30Schema = schema;
23 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 (3)
ChatCompletion\ChatResponseFormatJson.cs (1)
46private string DebuggerDisplay => Schema?.ToString() ?? "JSON";
Utilities\AIJsonSchemaTransformCache.cs (2)
48_responseFormatCreateValueCallback = responseFormat => AIJsonUtilities.TransformSchema(responseFormat.Schema!.Value, TransformOptions); 84return responseFormat.Schema is not null
Microsoft.Extensions.AI.Abstractions.Tests (9)
ChatCompletion\ChatResponseFormatTests.cs (9)
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))));
Microsoft.Extensions.AI.Integration.Tests (1)
ChatClientIntegrationTests.cs (1)
1105Assert.Null(responseFormat.Schema);
Microsoft.Extensions.AI.Tests (7)
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);