-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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 Kernel Contents Graduation #6319
Merged
RogerBarreto
merged 43 commits into
microsoft:main
from
RogerBarreto:adrs/kernel-content
Jun 10, 2024
Merged
.Net Kernel Contents Graduation #6319
RogerBarreto
merged 43 commits into
microsoft:main
from
RogerBarreto:adrs/kernel-content
Jun 10, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…, Added AudioContent UT's
markwallace-microsoft
added
.NET
Issue or Pull requests regarding .NET code
kernel
Issues or pull requests impacting the core kernel
kernel.core
documentation
labels
May 17, 2024
SergeyMenshykh
approved these changes
May 31, 2024
github-merge-queue bot
pushed a commit
that referenced
this pull request
May 31, 2024
### Motivation and Context <!-- 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. --> Fixes: #6443 This is temporary fix before new updates to `ImageContent` class will be in place: #6319 cc: @RogerBarreto ### Description <!-- 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 😄
dotnet/src/SemanticKernel.Abstractions/Contents/FunctionResultContent.cs
Show resolved
Hide resolved
dotnet/src/SemanticKernel.Abstractions/Contents/ImageContent.cs
Outdated
Show resolved
Hide resolved
crickman
approved these changes
Jun 4, 2024
crickman
reviewed
Jun 4, 2024
crickman
reviewed
Jun 4, 2024
dmytrostruk
reviewed
Jun 5, 2024
dotnet/src/Connectors/Connectors.OpenAI/Connectors.OpenAI.csproj
Outdated
Show resolved
Hide resolved
dotnet/src/Connectors/Connectors.OpenAI/Files/OpenAIFileService.cs
Outdated
Show resolved
Hide resolved
dmytrostruk
approved these changes
Jun 6, 2024
dotnet/src/SemanticKernel.Abstractions/SemanticKernel.Abstractions.csproj
Outdated
Show resolved
Hide resolved
…/semantic-kernel into adrs/kernel-content
markwallace-microsoft
approved these changes
Jun 10, 2024
LudoCorporateShark
pushed a commit
to LudoCorporateShark/semantic-kernel
that referenced
this pull request
Aug 25, 2024
### Motivation and Context <!-- 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. --> Fixes: microsoft#6443 This is temporary fix before new updates to `ImageContent` class will be in place: microsoft#6319 cc: @RogerBarreto ### Description <!-- 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 😄
LudoCorporateShark
pushed a commit
to LudoCorporateShark/semantic-kernel
that referenced
this pull request
Aug 25, 2024
### Motivation and Context⚠️ Breaking changes on non-experimental types **ImageContent** Resolves microsoft#5625 Resolves microsoft#5295 For a brief time this changes will keep the content below as experimental. - BinaryContent - AudioContent - ImageContent - FunctionCallContent - FunctionResultContent Changes: ### **BinaryContent** - Removed providers for lazy loading content, simplifying its usage and APIs. - Removed `Stream` constructor to avoid IDisposable resource consumption or bad practices. - Added `Uri` dedicated for Referenced Uri information - Added `DataUri` property which can be set or get dynamically (auto generated if you created the content using byte array with a mime type) Setting a `DataUri` will automatically update the `MimeType` property and add any extra metadata that may be available in the data scheme definition. - Added a required `mimeType` property to the ByteArray constructor, to encourage passing the mimeType when creating BinaryContent directly or from specializations. - Added `Data` property which can be set or get dynamically (auto generated if you created the content using a data uri format) Setting a Data on an existing BinaryContent will also reflect on the getter of `DataUri` for the given content. - Added DataUri and Base64 validation when setting DataUri on the contents. - When using DataUri parameters those merge with the current content metadata. i.e: `data:image/jpeg;parameter1=value1;parameter2=value2;base64,binary==` ###⚠️ **ImageContent** Fixes bugs and inconsistency behavior: - Setting the Data of an image doesn't change the current data uri and vice versa, allowing the sema image content instance to have different binary data to representations. - When an Image could not have DataUri and Uri in the same instance, this limits scenarios where you have the image data but want to have a reference to where that content is from. - Wasn't possible to create an Image from a data uri greater than the size limit of .Net System.Uri type here: [dotnet/runtime#96544. ### **FunctionResultContent** - Update `Id` property to `CallId`.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
documentation
kernel.core
kernel
Issues or pull requests impacting the core kernel
.NET
Issue or Pull requests regarding .NET code
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.
Motivation and Context
Resolves #5625
Resolves #5295
For a brief time this changes will keep the content below as experimental.
Changes:
BinaryContent
Stream
constructor to avoid IDisposable resource consumption or bad practices.Uri
dedicated for Referenced Uri informationDataUri
property which can be set or get dynamically (auto generated if you created thecontent using byte array with a mime type)
Setting a
DataUri
will automatically update theMimeType
property and add any extra metadata that may be available in the data scheme definition.mimeType
property to the ByteArray constructor, to encourage passing the mimeType when creating BinaryContent directly or from specializations.Data
property which can be set or get dynamically (auto generated if you created the content using a data uri format)Setting a Data on an existing BinaryContent will also reflect on the getter of
DataUri
for the given content.i.e:
data:image/jpeg;parameter1=value1;parameter2=value2;base64,binary==
Remove or relax the length limitation of Uri dotnet/runtime#96544.
FunctionResultContent
Id
property toCallId
.