Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Expose an
AIJsonUtilities
class in M.E.AI and lower M.E.AI.Abstractions to STJv8 #5513Expose an
AIJsonUtilities
class in M.E.AI and lower M.E.AI.Abstractions to STJv8 #5513Changes from 4 commits
68a9d45
f6e6b98
514f846
aa76abf
1b1752b
fd85775
5ea90ed
b02f38b
40f9ec8
6e51c3d
b9dbf77
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Large diffs are not rendered by default.
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.
Could be a separate change if we decide to do it, but should ToolCallJsonSerializerOptions be made non-nullable like it is on the middleware clients, just defaulting it to the default options?
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.
It's possible, but it would require moving the defaults to
Abstractions
so that clients can reference it.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'm not understanding why this would require any movement. I'm simply suggesting changing:
to
and then here instead of:
it'd just be:
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.
Unless we're trying to avoid exposing this options instance?
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'm just pointing out that unless we expose a default options instance on
Abstractions
users will have to define their own contexts to fill in the default_toolCallOptions
.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 don't understand why. The current code doesn't require that, just substituting JsonContext.Default.Options when the user hasn't supplied their own. I'm simply suggesting moving around where we default back to that.
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 see what you mean. It is appropriate to default to
JsonContext.Default.Options
in the particular locations where it is being done because they're serializing specific types (JsonElement
for FCR andIDictionary<string, object>
for FCC) which are known to be defined in the localJsonContext
. I don't think it would be safe to assume the same thing in other locations whereToolCallJsonSerializerOptions
is being used (e.g. when serializingAdditionalProperties
), so if we wanted to default to something in that case we should be using the global options instead.