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: Fix for #2820 Avoid unnecessary conversion of strings to Unicode encoding #4327

Merged
merged 8 commits into from
Dec 20, 2023

Conversation

yuezhishun
Copy link
Contributor

Fixes #2820

Motivation and Context

This PR resolves an issue where search results containing UTF-8 characters were automatically converted to Unicode, adversely affecting readability and resulting in token wastage.

Description

This is the second submission addressing feedback from the initial review. Changes have been made to explicitly use UnsafeRelaxedJsonEscaping for all serialization cases, as suggested by @stephentoub. Please review the modifications and provide further feedback. Thank you!

Contribution Checklist

Unverified

This user has not yet uploaded their public signing key.
…consistent encoding

Fixes microsoft#2820
@yuezhishun yuezhishun requested a review from a team as a code owner December 16, 2023 17:46
@shawncal shawncal added the .NET Issue or Pull requests regarding .NET code label Dec 16, 2023
yuezhishun and others added 3 commits December 17, 2023 03:24

Unverified

This user has not yet uploaded their public signing key.
…, deemed safe as the JSON isn't used for security-sensitive operations. Added a warning in SearchAsync about potential risks.

Unverified

This user has not yet uploaded their public signing key.

Unverified

This user has not yet uploaded their public signing key.

Unverified

This user has not yet uploaded their public signing key.

Unverified

This user has not yet uploaded their public signing key.
@RogerBarreto
Copy link
Member

@yuezhishun , please follow the license agreement change and we can merge it.

@yuezhishun
Copy link
Contributor Author

yuezhishun commented Dec 19, 2023

@yuezhishun请阅读以下贡献者许可协议(CLA)。如果您同意 CLA,请回复以下信息。

@microsoft-github-policy-service agree [company="{your company}"]

选项:

  • (默认 - 未指定公司)我对我提交的内容拥有知识产权的唯一所有权,并且我不会在为我的雇主工作的过程中提交内容。
@microsoft-github-policy-service agree
  • (当公司提供时)我在为我的雇主工作的过程中提交意见(或者我的雇主根据合同或适用法律对我提交的意见拥有知识产权)。我已获得雇主的许可,可以代表我的雇主提交意见并签订本协议。通过在下面签名,定义的术语“您”包括我和我的雇主。
@microsoft-github-policy-service agree company="Microsoft"

贡献者许可协议

@microsoft-github-policy-service agree

@RogerBarreto RogerBarreto added this pull request to the merge queue Dec 20, 2023
Merged via the queue into microsoft:main with commit 6f0a283 Dec 20, 2023
Bryan-Roe pushed a commit to Bryan-Roe-ai/semantic-kernel that referenced this pull request Oct 6, 2024
…to Unicode encoding (microsoft#4327)

Fixes microsoft#2820
### Motivation and Context
This PR resolves an issue where search results containing UTF-8
characters were automatically converted to Unicode, adversely affecting
readability and resulting in token wastage.
<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
  1. Why is this change required?
  2. What problem does it solve?
  3. What scenario does it contribute to?
  4. If it fixes an open issue, please link to the issue here.
-->

### Description
[ This is the second submission addressing feedback from the initial
review.](microsoft#4128) Changes
have been made to explicitly use `UnsafeRelaxedJsonEscaping` for all
serialization cases, as suggested by @stephentoub. Please review the
modifications and provide further feedback. Thank you!
<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->

### Contribution Checklist

<!-- Before submitting this PR, please make sure: -->

- [x] The code builds clean without any errors or warnings
- [x] The PR follows the [SK Contribution
Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
and the [pre-submission formatting
script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts)
raises no violations
- [x] All unit tests pass, and I have added new tests where possible
- [x] I didn't break anyone 😄

---------

Co-authored-by: SergeyMenshykh <68852919+SergeyMenshykh@users.noreply.github.com>
Co-authored-by: Roger Barreto <19890735+RogerBarreto@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
.NET Issue or Pull requests regarding .NET code
Projects
None yet
6 participants