Skip to content
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: Allow custom serialization options to be passed to TextMemoryPlugin. #7098

Merged
merged 2 commits into from
Jul 4, 2024

Conversation

westey-m
Copy link
Contributor

@westey-m westey-m commented Jul 4, 2024

Motivation and Context

When TextMemoryPlugin gets back multiple results from the memory store during recall, it uses json serialization to
turn these multiple results into a single string.
In some cases, this may cause unintended side-affects, e.g. when non-latin script is present in the results, JsonSerializer automatically escapes these characters.
Adding support for passing custom JsonSerializerOptions into the TextMemoryPlugin to customize the serialization behavior.

See #6593

Description

Added optional JsonSerializerOptions to the TextMemoryPlugin constructor.
Added example to demonstrate this scenario.

Contribution Checklist

…o allow non-latin script to be serialized without escaping.
@westey-m westey-m requested a review from a team as a code owner July 4, 2024 13:59
@markwallace-microsoft markwallace-microsoft added .NET Issue or Pull requests regarding .NET code documentation labels Jul 4, 2024
@github-actions github-actions bot changed the title Allow custom serialization options to be passed to TextMemoryPlugin. .Net: Allow custom serialization options to be passed to TextMemoryPlugin. Jul 4, 2024
@westey-m westey-m added this pull request to the merge queue Jul 4, 2024
Merged via the queue into microsoft:main with commit c8fa30b Jul 4, 2024
15 checks passed
@westey-m westey-m deleted the text-memory-plugin-encoding-fix branch July 4, 2024 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation .NET Issue or Pull requests regarding .NET code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants