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: Removing dependency on BinaryData class from content classes #5229

Merged

Conversation

SergeyMenshykh
Copy link
Member

@SergeyMenshykh SergeyMenshykh commented Feb 28, 2024

Motivation and Context

Today, SemanticKernel.Abstractions package has unnecessary dependency on System.Memory.Data package which according to this issue #5226 should be removed to minimize number of dependencies and keep only absolutely necessary ones.

Description

This PR replaces the usage of the System.Memory.Data.BinaryData type with ReadonlyMemory in the AudioContent, BinaryContent, and ImageContent classes. It also removes the dependency of SemanticKernel.Abstractions on the System.Memory.Data package.

Contribution Checklist

@SergeyMenshykh SergeyMenshykh added the .NET Issue or Pull requests regarding .NET code label Feb 28, 2024
@SergeyMenshykh SergeyMenshykh self-assigned this Feb 28, 2024
@markwallace-microsoft markwallace-microsoft added kernel Issues or pull requests impacting the core kernel kernel.core labels Feb 28, 2024
@SergeyMenshykh SergeyMenshykh marked this pull request as ready for review February 28, 2024 15:04
@SergeyMenshykh SergeyMenshykh requested a review from a team as a code owner February 28, 2024 15:04
@Krzysztof318
Copy link
Contributor

@SergeyMenshykh So you need also remove BinaryData from imagecontent class.

@SergeyMenshykh
Copy link
Member Author

@SergeyMenshykh So you need also remove BinaryData from imagecontent class.

Right, the plan is to have a PR per type. So, there will be at least two more PRs - one for ImageContent, and the other one for BinaryContent. I updated the PR description to make it clear.

@SergeyMenshykh
Copy link
Member Author

@SergeyMenshykh So you need also remove BinaryData from imagecontent class.

Right, the plan is to have a PR per type. So, there will be at least two more PRs - one for ImageContent, and the other one for BinaryContent. I updated the PR description to make it clear.

Actually, it appears that the PR per class will be too excessive, so I'll push all the changes as one PR.

@SergeyMenshykh SergeyMenshykh marked this pull request as draft February 28, 2024 17:00
2. Dependency on the System.Memory.Data package is removed
@SergeyMenshykh SergeyMenshykh marked this pull request as ready for review February 28, 2024 18:10
@SergeyMenshykh SergeyMenshykh changed the title .Net: [Part1] Removing dependency on BinaryData class from AudioContent class .Net: Removing dependency on BinaryData class from AudioContent class Feb 28, 2024
@SergeyMenshykh SergeyMenshykh changed the title .Net: Removing dependency on BinaryData class from AudioContent class .Net: Removing dependency on BinaryData class from content classes Feb 28, 2024
2. MediaType made optional for ImageContent to align with AudioContent and avaid breaking change
@dmytrostruk dmytrostruk self-requested a review March 4, 2024 11:03
@SergeyMenshykh SergeyMenshykh added this pull request to the merge queue Mar 5, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 5, 2024
@SergeyMenshykh SergeyMenshykh added this pull request to the merge queue Mar 5, 2024
Merged via the queue into microsoft:main with commit fbca7d2 Mar 5, 2024
18 checks passed
@SergeyMenshykh SergeyMenshykh deleted the remove-binarydata-dependency branch March 5, 2024 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kernel.core kernel Issues or pull requests impacting the core kernel .NET Issue or Pull requests regarding .NET code
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

6 participants