3 overrides of JsonSchema
Microsoft.Extensions.AI.Abstractions (2)
Functions\AIFunctionFactory.cs (1)
543public override JsonElement JsonSchema => FunctionDescriptor.JsonSchema;
Functions\DelegatingAIFunction.cs (1)
41public override JsonElement JsonSchema => InnerFunction.JsonSchema;
Microsoft.Extensions.AI.Integration.Tests (1)
ChatClientIntegrationTests.cs (1)
512public override JsonElement JsonSchema { get; } = JsonSerializer.Deserialize<JsonElement>(jsonSchema, AIJsonUtilities.DefaultOptions);
37 references to JsonSchema
Microsoft.Extensions.AI.Abstractions (7)
Functions\AIFunctionFactory.cs (5)
52/// <see cref="AIFunction.JsonSchema"/>. There are a few exceptions to this: 134/// <see cref="AIFunction.JsonSchema"/>. There are a few exceptions to this: 215/// <see cref="AIFunction.JsonSchema"/>. There are a few exceptions to this: 307/// <see cref="AIFunction.JsonSchema"/>. There are a few exceptions to this: 401/// <see cref="AIFunction.JsonSchema"/>. There are a few exceptions to this:
Functions\DelegatingAIFunction.cs (1)
41public override JsonElement JsonSchema => InnerFunction.JsonSchema;
Utilities\AIJsonSchemaTransformCache.cs (1)
46_functionSchemaCreateValueCallback = function => AIJsonUtilities.TransformSchema(function.JsonSchema, TransformOptions);
Microsoft.Extensions.AI.Abstractions.Tests (6)
Functions\DelegatingAIFunctionTests.cs (3)
29Assert.Equal(expected.JsonSchema, actual.JsonSchema); 74Assert.Equal(inner.JsonSchema, actual.JsonSchema);
Utilities\AIJsonUtilitiesTests.cs (3)
275AssertDeepEquals(resolvedSchema, func.JsonSchema); 335AssertDeepEquals(expected, func.JsonSchema); 347JsonElement schemaParameters = func.JsonSchema.GetProperty("properties");
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)
210aiFunction.JsonSchema;
Microsoft.Extensions.AI.OpenAI.Tests (1)
OpenAIResponseClientTests.cs (1)
485var tool = JsonSerializer.Deserialize<OpenAIChatClientTests.ChatToolJson>(aiFunction.JsonSchema)!;
Microsoft.Extensions.AI.Tests (19)
Functions\AIFunctionFactoryTest.cs (19)
157Assert.DoesNotContain("cancellationToken", func.JsonSchema.ToString(), StringComparison.OrdinalIgnoreCase); 290Assert.DoesNotContain("firstParameter", func.JsonSchema.ToString()); 291Assert.Contains("secondParameter", func.JsonSchema.ToString()); 314Assert.Contains("firstParameter", func.JsonSchema.ToString()); 315Assert.Contains("secondParameter", func.JsonSchema.ToString()); 351Assert.Contains("myInteger", func.JsonSchema.ToString()); 352Assert.DoesNotContain("services", func.JsonSchema.ToString()); 353Assert.DoesNotContain("arguments", func.JsonSchema.ToString()); 381Assert.Contains("myInteger", func.JsonSchema.ToString()); 382Assert.DoesNotContain("services", func.JsonSchema.ToString()); 383Assert.DoesNotContain("arguments", func.JsonSchema.ToString()); 519Assert.Contains("myInteger", f.JsonSchema.ToString()); 520Assert.DoesNotContain("service", f.JsonSchema.ToString()); 542Assert.Contains("myInteger", f.JsonSchema.ToString()); 543Assert.DoesNotContain("service", f.JsonSchema.ToString()); 566Assert.Contains("myInteger", f.JsonSchema.ToString()); 567Assert.DoesNotContain("service", f.JsonSchema.ToString()); 603Assert.Contains("myInteger", f.JsonSchema.ToString()); 604Assert.DoesNotContain("service", f.JsonSchema.ToString());