26 instantiations of AIJsonSchemaTransformOptions
Microsoft.Extensions.AI (1)
ChatCompletion\ChatClientStructuredOutputExtensions.cs (1)
29TransformOptions = new AIJsonSchemaTransformOptions
Microsoft.Extensions.AI.Abstractions (1)
Utilities\AIJsonSchemaTransformOptions.cs (1)
49internal static AIJsonSchemaTransformOptions Default { get; } = new();
Microsoft.Extensions.AI.Abstractions.Tests (21)
Utilities\AIJsonSchemaTransformCacheTests.cs (7)
21Assert.Throws<ArgumentException>(() => new AIJsonSchemaTransformCache(transformOptions: new())); 27AIJsonSchemaTransformOptions options = new() { ConvertBooleanSchemas = true }; 35AIJsonSchemaTransformCache cache = new(new() { ConvertBooleanSchemas = true }); 42AIJsonSchemaTransformCache cache = new(new() { ConvertBooleanSchemas = true }); 49AIJsonSchemaTransformCache cache = new(new() { TransformSchemaNode = (_, node) => { node.AsObject().Add("myAwesomeKeyword", 42); return node; } }); 62AIJsonSchemaTransformCache cache = new(new() { TransformSchemaNode = (_, node) => { node.AsObject().Add("myAwesomeKeyword", 42); return node; } }); 77AIJsonSchemaTransformCache cache = new(new() { TransformSchemaNode = (_, node) => { node.AsObject().Add("myAwesomeKeyword", 42); return node; } });
Utilities\AIJsonUtilitiesTests.cs (14)
113AIJsonSchemaTransformOptions transformOptions = new AIJsonSchemaTransformOptions { RequireAllProperties = true }; 203TransformOptions = new() 317TransformOptions = new() 402? new() { TransformOptions = new() { DisallowAdditionalProperties = false } } // Do not append additionalProperties: false to the schema if the type has extension data. 1083AIJsonSchemaTransformOptions options = new() 1117AIJsonSchemaTransformOptions options = new() 1152AIJsonSchemaTransformOptions options = new() 1189AIJsonSchemaTransformOptions options = new() 1216AIJsonSchemaTransformOptions options = new() 1237? new() { TransformOptions = new() { DisallowAdditionalProperties = false } } // Do not append additionalProperties: false to the schema if the type has extension data. 1243AIJsonSchemaTransformOptions transformOptions = new() 1262transformOptions = new() 1294Assert.Throws<ArgumentException>(() => AIJsonUtilities.TransformSchema(schema, transformOptions: new())); 1306AIJsonSchemaTransformOptions transformOptions = new() { ConvertBooleanSchemas = true };
Microsoft.Extensions.AI.AzureAIInference (1)
AzureAIInferenceChatClient.cs (1)
28private static AIJsonSchemaTransformCache SchemaTransformCache { get; } = new(new()
Microsoft.Extensions.AI.Ollama (1)
OllamaChatClient.cs (1)
28private static readonly AIJsonSchemaTransformCache _schemaTransformCache = new(new()
Microsoft.Extensions.AI.OpenAI (1)
OpenAIClientExtensions.cs (1)
43internal static AIJsonSchemaTransformCache StrictSchemaTransformCache { get; } = new(new()
22 references to AIJsonSchemaTransformOptions
Microsoft.Extensions.AI.Abstractions (12)
Utilities\AIJsonSchemaCreateOptions.cs (2)
41/// Gets a <see cref="AIJsonSchemaTransformOptions"/> governing transformations on the JSON schema after it has been generated. 43public AIJsonSchemaTransformOptions? TransformOptions { get; init; }
Utilities\AIJsonSchemaTransformCache.cs (4)
12/// Defines a cache for JSON schemas transformed according to the specified <see cref="AIJsonSchemaTransformOptions"/> policy. 36public AIJsonSchemaTransformCache(AIJsonSchemaTransformOptions transformOptions) 40if (transformOptions == AIJsonSchemaTransformOptions.Default) 53public AIJsonSchemaTransformOptions TransformOptions { get; }
Utilities\AIJsonSchemaTransformContext.cs (1)
14/// This struct is being passed to the user-provided <see cref="AIJsonSchemaTransformOptions.TransformSchemaNode"/>
Utilities\AIJsonSchemaTransformOptions.cs (1)
49internal static AIJsonSchemaTransformOptions Default { get; } = new();
Utilities\AIJsonUtilities.Schema.Transform.cs (4)
23public static JsonElement TransformSchema(JsonElement schema, AIJsonSchemaTransformOptions transformOptions) 27if (transformOptions == AIJsonSchemaTransformOptions.Default) 37private static JsonNode TransformSchema(JsonNode? schema, AIJsonSchemaTransformOptions transformOptions) 43private static JsonNode TransformSchemaCore(JsonNode? schema, AIJsonSchemaTransformOptions transformOptions, List<string>? path)
Microsoft.Extensions.AI.Abstractions.Tests (10)
Utilities\AIJsonSchemaTransformCacheTests.cs (1)
27AIJsonSchemaTransformOptions options = new() { ConvertBooleanSchemas = true };
Utilities\AIJsonUtilitiesTests.cs (9)
112case null when property.PropertyType == typeof(AIJsonSchemaTransformOptions): 113AIJsonSchemaTransformOptions transformOptions = new AIJsonSchemaTransformOptions { RequireAllProperties = true }; 1083AIJsonSchemaTransformOptions options = new() 1117AIJsonSchemaTransformOptions options = new() 1152AIJsonSchemaTransformOptions options = new() 1189AIJsonSchemaTransformOptions options = new() 1216AIJsonSchemaTransformOptions options = new() 1243AIJsonSchemaTransformOptions transformOptions = new() 1306AIJsonSchemaTransformOptions transformOptions = new() { ConvertBooleanSchemas = true };