5 overrides of JsonSchema
Microsoft.Extensions.AI.Abstractions (4)
Functions\AIFunctionFactory.cs (2)
478public override JsonElement JsonSchema => jsonSchema; 555public 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; } = JsonElement.Parse(jsonSchema);
52 references to JsonSchema
Microsoft.Extensions.AI (1)
ChatCompletion\OpenTelemetryChatClient.cs (1)
645Parameters = af.JsonSchema,
Microsoft.Extensions.AI.Abstractions (8)
Functions\AIFunctionFactory.cs (5)
48/// <see cref="AIFunctionDeclaration.JsonSchema"/>. There are a few exceptions to this: 129/// <see cref="AIFunctionDeclaration.JsonSchema"/>. There are a few exceptions to this: 206/// <see cref="AIFunctionDeclaration.JsonSchema"/>. There are a few exceptions to this: 294/// <see cref="AIFunctionDeclaration.JsonSchema"/>. There are a few exceptions to this: 384/// <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)
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)
195aiFunction.JsonSchema;
Microsoft.Extensions.AI.Tests (32)
Functions\AIFunctionFactoryTest.cs (32)
71string schema = funcNull.JsonSchema.ToString(); 84schema = funcValue.JsonSchema.ToString(); 93schema = funcInt.JsonSchema.ToString(); 102schema = funcBoth.JsonSchema.ToString(); 205Assert.DoesNotContain("cancellationToken", func.JsonSchema.ToString(), StringComparison.OrdinalIgnoreCase); 371Assert.DoesNotContain("firstParameter", func.JsonSchema.ToString()); 372Assert.Contains("secondParameter", func.JsonSchema.ToString()); 395Assert.Contains("firstParameter", func.JsonSchema.ToString()); 396Assert.Contains("secondParameter", func.JsonSchema.ToString()); 432Assert.Contains("myInteger", func.JsonSchema.ToString()); 433Assert.DoesNotContain("services", func.JsonSchema.ToString()); 434Assert.DoesNotContain("arguments", func.JsonSchema.ToString()); 462Assert.Contains("myInteger", func.JsonSchema.ToString()); 463Assert.DoesNotContain("services", func.JsonSchema.ToString()); 464Assert.DoesNotContain("arguments", func.JsonSchema.ToString()); 600Assert.Contains("myInteger", f.JsonSchema.ToString()); 601Assert.DoesNotContain("service", f.JsonSchema.ToString()); 623Assert.Contains("myInteger", f.JsonSchema.ToString()); 624Assert.DoesNotContain("service", f.JsonSchema.ToString()); 647Assert.Contains("myInteger", f.JsonSchema.ToString()); 648Assert.DoesNotContain("service", f.JsonSchema.ToString()); 684Assert.Contains("myInteger", f.JsonSchema.ToString()); 685Assert.DoesNotContain("service", f.JsonSchema.ToString()); 1021AssertExtensions.EqualJsonValues(expectedSchema, f.JsonSchema); 1054AssertExtensions.EqualJsonValues(expectedSchema, f.JsonSchema); 1079Assert.Equal("""{"type":"integer"}""", f.JsonSchema.ToString()); 1085Assert.Equal(default, f.JsonSchema); 1262Assert.Contains("firstNumber", tool.JsonSchema.ToString()); 1263Assert.Contains("secondNumber", tool.JsonSchema.ToString()); 1326JsonElement schema = func.JsonSchema; 1366JsonElement schema = func.JsonSchema; 1446JsonElement schema = func.JsonSchema;