-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
.Net: Replace stj-schema-mapper source code with M.E.AI schema generation #9807
base: main
Are you sure you want to change the base?
.Net: Replace stj-schema-mapper source code with M.E.AI schema generation #9807
Conversation
@@ -22,16 +22,20 @@ namespace Microsoft.SemanticKernel; | |||
internal static class KernelJsonSchemaBuilder |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't remove this class to minimize churn, but at this point it seems reasonable to bake in this factory into KernelJsonSchema
(and perhaps make it public).
@@ -15,12 +14,12 @@ namespace SemanticKernel.Connectors.OpenAI.UnitTests.Core; | |||
/// </summary> | |||
public sealed class OpenAIJsonSchemaTransformerTests | |||
{ | |||
private static readonly JsonSchemaMapperConfiguration s_jsonSchemaMapperConfiguration = new() | |||
private static readonly AIJsonSchemaCreateOptions s_jsonSchemaCreateOptions = new() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These unit test are testing implementation detail that has now been removed. I'll fix the failing build but will otherwise leave these as-is since they're testing the same configuration as the one being passed to the core client.
@@ -95,8 +95,8 @@ public void ItCanConvertToFunctionDefinitionsWithParameterTypesAndReturnParamete | |||
{ "type": "object", | |||
"required": ["param1", "param2"], | |||
"properties": { | |||
"param1": { "type": "string", "description": "String param 1" }, | |||
"param2": { "type": "integer", "description": "Int param 2" } } } | |||
"param1": { "description": "String param 1", "type": "string" }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes in the assertion reflect the fact that the new component inserts the description
keyword at the start of the schema object. This reflects convention from JSON schema even though they are equivalent -- property order isn't significant in JSON.
Replaces the source copied implementation from https://github.com/eiriktsarpalis/stj-schema-mapper with the equivalent component now made available through Microsoft.Extensions.AI.Abstractions.
cc @RogerBarreto @stephentoub @SergeyMenshykh