5 overrides of JsonSchema
Microsoft.Extensions.AI.Abstractions (4)
Functions\AIFunctionFactory.cs (2)
508public override JsonElement JsonSchema => jsonSchema; 585public 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)
521public override JsonElement JsonSchema { get; } = JsonSerializer.Deserialize<JsonElement>(jsonSchema, AIJsonUtilities.DefaultOptions);
50 references to JsonSchema
Microsoft.Extensions.AI (1)
ChatCompletion\OpenTelemetryChatClient.cs (1)
466Parameters = af.JsonSchema,
Microsoft.Extensions.AI.Abstractions (8)
Functions\AIFunctionFactory.cs (5)
48/// <see cref="AIFunctionDeclaration.JsonSchema"/>. There are a few exceptions to this: 135/// <see cref="AIFunctionDeclaration.JsonSchema"/>. There are a few exceptions to this: 218/// <see cref="AIFunctionDeclaration.JsonSchema"/>. There are a few exceptions to this: 312/// <see cref="AIFunctionDeclaration.JsonSchema"/>. There are a few exceptions to this: 408/// <see cref="AIFunctionDeclaration.JsonSchema"/>. There are a few exceptions to this:
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)
290AssertDeepEquals(resolvedSchema, func.JsonSchema); 350AssertDeepEquals(expected, func.JsonSchema); 362JsonElement schemaParameters = func.JsonSchema.GetProperty("properties"); 423AssertDeepEquals(expectedSchema.RootElement, func.JsonSchema);
Microsoft.Extensions.AI.AzureAIInference.Tests (1)
AzureAIInferenceChatClientTests.cs (1)
623var tool = JsonSerializer.Deserialize<AzureAIChatToolJson>(aiFunction.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)
185aiFunction.JsonSchema;
Microsoft.Extensions.AI.Tests (29)
Functions\AIFunctionFactoryTest.cs (29)
70string schema = funcNull.JsonSchema.ToString(); 83schema = funcValue.JsonSchema.ToString(); 92schema = funcInt.JsonSchema.ToString(); 101schema = funcBoth.JsonSchema.ToString(); 204Assert.DoesNotContain("cancellationToken", func.JsonSchema.ToString(), StringComparison.OrdinalIgnoreCase); 370Assert.DoesNotContain("firstParameter", func.JsonSchema.ToString()); 371Assert.Contains("secondParameter", func.JsonSchema.ToString()); 394Assert.Contains("firstParameter", func.JsonSchema.ToString()); 395Assert.Contains("secondParameter", func.JsonSchema.ToString()); 431Assert.Contains("myInteger", func.JsonSchema.ToString()); 432Assert.DoesNotContain("services", func.JsonSchema.ToString()); 433Assert.DoesNotContain("arguments", func.JsonSchema.ToString()); 461Assert.Contains("myInteger", func.JsonSchema.ToString()); 462Assert.DoesNotContain("services", func.JsonSchema.ToString()); 463Assert.DoesNotContain("arguments", func.JsonSchema.ToString()); 599Assert.Contains("myInteger", f.JsonSchema.ToString()); 600Assert.DoesNotContain("service", f.JsonSchema.ToString()); 622Assert.Contains("myInteger", f.JsonSchema.ToString()); 623Assert.DoesNotContain("service", f.JsonSchema.ToString()); 646Assert.Contains("myInteger", f.JsonSchema.ToString()); 647Assert.DoesNotContain("service", f.JsonSchema.ToString()); 683Assert.Contains("myInteger", f.JsonSchema.ToString()); 684Assert.DoesNotContain("service", f.JsonSchema.ToString()); 1020AssertExtensions.EqualJsonValues(expectedSchema, f.JsonSchema); 1053AssertExtensions.EqualJsonValues(expectedSchema, f.JsonSchema); 1078Assert.Equal("""{"type":"integer"}""", f.JsonSchema.ToString()); 1084Assert.Equal(default, f.JsonSchema); 1261Assert.Contains("firstNumber", tool.JsonSchema.ToString()); 1262Assert.Contains("secondNumber", tool.JsonSchema.ToString());