5 overrides of JsonSchema
Microsoft.Extensions.AI.Abstractions (4)
Functions\AIFunctionFactory.cs (2)
527public override JsonElement JsonSchema => jsonSchema; 604public override JsonElement JsonSchema => FunctionDescriptor.JsonSchema;
Functions\DelegatingAIFunction.cs (1)
39public override JsonElement JsonSchema => InnerFunction.JsonSchema;
Functions\DelegatingAIFunctionDeclaration.cs (1)
36public override JsonElement JsonSchema => InnerFunction.JsonSchema;
Microsoft.Extensions.AI.Integration.Tests (1)
ChatClientIntegrationTests.cs (1)
515public override JsonElement JsonSchema { get; } = JsonElement.Parse(jsonSchema);
63 references to JsonSchema
Microsoft.Extensions.AI (1)
Common\OtelMessageParts.cs (1)
106Parameters = includeOptionalProperties ? function.JsonSchema : null,
Microsoft.Extensions.AI.Abstractions (10)
Functions\AIFunctionFactory.cs (6)
35/// automatically derived for both the function's input parameters (exposed via <see cref="AIFunctionDeclaration.JsonSchema"/>) 62/// <see cref="AIFunctionDeclaration.JsonSchema"/>. There are a few exceptions to this: 151/// <see cref="AIFunctionDeclaration.JsonSchema"/>. There are a few exceptions to this: 233/// <see cref="AIFunctionDeclaration.JsonSchema"/>. There are a few exceptions to this: 330/// <see cref="AIFunctionDeclaration.JsonSchema"/>. There are a few exceptions to this: 425/// <see cref="AIFunctionDeclaration.JsonSchema"/>. There are a few exceptions to this:
Functions\AIFunctionFactoryOptions.cs (1)
46/// This setting affects both the <see cref="AIFunctionDeclaration.JsonSchema"/> (input parameters) and
Functions\DelegatingAIFunction.cs (1)
39public override JsonElement JsonSchema => InnerFunction.JsonSchema;
Functions\DelegatingAIFunctionDeclaration.cs (1)
36public override JsonElement JsonSchema => InnerFunction.JsonSchema;
Utilities\AIJsonSchemaTransformCache.cs (1)
46_functionSchemaCreateValueCallback = function => AIJsonUtilities.TransformSchema(function.JsonSchema, TransformOptions);
Microsoft.Extensions.AI.Abstractions.Tests (8)
Functions\ApprovalRequiredAIFunctionTests.cs (1)
26Assert.Equal(inner.JsonSchema, func.JsonSchema);
Functions\DelegatingAIFunctionTests.cs (3)
29Assert.Equal(expected.JsonSchema, actual.JsonSchema); 75Assert.Equal(inner.JsonSchema, actual.JsonSchema);
Utilities\AIJsonUtilitiesTests.cs (4)
296AssertDeepEquals(resolvedSchema, func.JsonSchema); 356AssertDeepEquals(expected, func.JsonSchema); 368JsonElement schemaParameters = func.JsonSchema.GetProperty("properties"); 427AssertDeepEquals(expectedSchema.RootElement, func.JsonSchema);
Microsoft.Extensions.AI.Evaluation.Quality (1)
AIToolExtensions.cs (1)
29["functionSchema"] = JsonNode.Parse(function.JsonSchema.GetRawText()),
Microsoft.Extensions.AI.Integration.Tests (1)
PromptBasedFunctionCallingChatClient.cs (1)
169var toolDescriptorsJson = JsonSerializer.Serialize(tools.OfType<AIFunction>().Select(t => t.JsonSchema), _jsonOptions);
Microsoft.Extensions.AI.OpenAI (1)
OpenAIClientExtensions.cs (1)
245aiFunction.JsonSchema;
Microsoft.Extensions.AI.Tests (41)
Functions\AIFunctionFactoryTest.cs (41)
73string schema = funcNull.JsonSchema.ToString(); 86schema = funcValue.JsonSchema.ToString(); 95schema = funcInt.JsonSchema.ToString(); 104schema = funcBoth.JsonSchema.ToString(); 208Assert.DoesNotContain("cancellationToken", func.JsonSchema.ToString(), StringComparison.OrdinalIgnoreCase); 347Assert.Equal(func.JsonSchema.ToString(), declaration.JsonSchema.ToString()); 348Assert.Contains("my_param", declaration.JsonSchema.ToString()); 377AssertExtensions.EqualJsonValues(expectedSchema, func.JsonSchema); 407Assert.Contains("my_param", func.JsonSchema.ToString()); 408Assert.DoesNotContain("\"myParam\"", func.JsonSchema.ToString()); 422string schema = func.JsonSchema.ToString(); 473JsonElement valueParam = f.JsonSchema.GetProperty("properties").GetProperty("value"); 540Assert.DoesNotContain("firstParameter", func.JsonSchema.ToString()); 541Assert.Contains("secondParameter", func.JsonSchema.ToString()); 577JsonElement schema = AIFunctionFactory.Create(method, target: null, options).JsonSchema; 625Assert.Contains("firstParameter", func.JsonSchema.ToString()); 626Assert.Contains("secondParameter", func.JsonSchema.ToString()); 662Assert.Contains("myInteger", func.JsonSchema.ToString()); 663Assert.DoesNotContain("services", func.JsonSchema.ToString()); 664Assert.DoesNotContain("arguments", func.JsonSchema.ToString()); 692Assert.Contains("myInteger", func.JsonSchema.ToString()); 693Assert.DoesNotContain("services", func.JsonSchema.ToString()); 694Assert.DoesNotContain("arguments", func.JsonSchema.ToString()); 830Assert.Contains("myInteger", f.JsonSchema.ToString()); 831Assert.DoesNotContain("service", f.JsonSchema.ToString()); 853Assert.Contains("myInteger", f.JsonSchema.ToString()); 854Assert.DoesNotContain("service", f.JsonSchema.ToString()); 877Assert.Contains("myInteger", f.JsonSchema.ToString()); 878Assert.DoesNotContain("service", f.JsonSchema.ToString()); 914Assert.Contains("myInteger", f.JsonSchema.ToString()); 915Assert.DoesNotContain("service", f.JsonSchema.ToString()); 1251AssertExtensions.EqualJsonValues(expectedSchema, f.JsonSchema); 1284AssertExtensions.EqualJsonValues(expectedSchema, f.JsonSchema); 1309Assert.Equal("""{"type":"integer"}""", f.JsonSchema.ToString()); 1315Assert.Equal(default, f.JsonSchema); 1492Assert.Contains("firstNumber", tool.JsonSchema.ToString()); 1493Assert.Contains("secondNumber", tool.JsonSchema.ToString()); 1556JsonElement schema = func.JsonSchema; 1596JsonElement schema = func.JsonSchema; 1676JsonElement schema = func.JsonSchema;