1 write to Schema
Microsoft.Extensions.AI.Abstractions (1)
ChatCompletion\ChatResponseFormatJson.cs (1)
30
Schema
= schema;
23 references to Schema
Microsoft.Extensions.AI (3)
ChatCompletion\ChatClientStructuredOutputExtensions.cs (3)
153
Debug.Assert(responseFormat.
Schema
is not null, "ForJsonSchema should always populate Schema");
154
var schema = responseFormat.
Schema
!.Value;
193
{{responseFormat.
Schema
}}
Microsoft.Extensions.AI.Abstractions (3)
ChatCompletion\ChatResponseFormatJson.cs (1)
46
private string DebuggerDisplay =>
Schema
?.ToString() ?? "JSON";
Utilities\AIJsonSchemaTransformCache.cs (2)
48
_responseFormatCreateValueCallback = responseFormat => AIJsonUtilities.TransformSchema(responseFormat.
Schema
!.Value, TransformOptions);
84
return responseFormat.
Schema
is not null
Microsoft.Extensions.AI.Abstractions.Tests (9)
ChatCompletion\ChatResponseFormatTests.cs (9)
38
Assert.Null(f.
Schema
);
47
Assert.Equal("{}", JsonSerializer.Serialize(f.
Schema
, TestJsonSerializerContext.Default.JsonElement));
70
Assert.Null(actual.
Schema
);
85
Assert.Equal("[1,2,3]", JsonSerializer.Serialize(actual.
Schema
, TestJsonSerializerContext.Default.JsonElement));
109
Assert.NotNull(format.
Schema
);
110
Assert.Equal("""{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"integer"}""", format.
Schema
.ToString());
125
Assert.NotNull(format.
Schema
);
126
Assert.Contains("\"uri\"", format.
Schema
.ToString());
167
JsonSerializer.Serialize(format.
Schema
, AIJsonUtilities.DefaultOptions.GetTypeInfo(typeof(JsonElement))));
Microsoft.Extensions.AI.Integration.Tests (1)
ChatClientIntegrationTests.cs (1)
1105
Assert.Null(responseFormat.
Schema
);
Microsoft.Extensions.AI.Tests (7)
ChatCompletion\ChatClientStructuredOutputExtensionsTests.cs (7)
37
Assert.NotNull(responseFormat.
Schema
);
63
""").RootElement, responseFormat.
Schema
.Value);
114
Assert.Null(responseFormat.
Schema
);
183
""", responseFormat.
Schema
.ToString());
227
""", responseFormat.
Schema
.ToString());
374
Assert.NotNull(responseFormat.
Schema
);
395
""").RootElement, responseFormat.
Schema
.Value);