-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
base: main
Are you sure you want to change the base?
Conversation
…, Added AudioContent UT's
dotnet/src/SemanticKernel.Abstractions/Contents/BinaryContent.cs
Outdated
Show resolved
Hide resolved
dotnet/src/SemanticKernel.Abstractions/Contents/BinaryContent.cs
Outdated
Show resolved
Hide resolved
dotnet/src/SemanticKernel.Abstractions/Contents/KernelContent.cs
Outdated
Show resolved
Hide resolved
dotnet/src/SemanticKernel.Abstractions/Contents/AudioContent.cs
Outdated
Show resolved
Hide resolved
dotnet/src/SemanticKernel.Abstractions/Contents/BinaryContent.cs
Outdated
Show resolved
Hide resolved
dotnet/src/SemanticKernel.Abstractions/Contents/BinaryContent.cs
Outdated
Show resolved
Hide resolved
dotnet/src/SemanticKernel.Abstractions/Contents/BinaryContent.cs
Outdated
Show resolved
Hide resolved
dotnet/src/SemanticKernel.Abstractions/Contents/BinaryContent.cs
Outdated
Show resolved
Hide resolved
### 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 😄
<Left>lib/netstandard2.0/Microsoft.SemanticKernel.Connectors.OpenAI.dll</Left> | ||
<Right>lib/netstandard2.0/Microsoft.SemanticKernel.Connectors.OpenAI.dll</Right> | ||
<IsBaselineSuppression>true</IsBaselineSuppression> | ||
</Suppression> |
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 need to review this PR and understand the breaking change.
Are there any options that will allow us introduce the new pattern and also avoid the breaking change?
@@ -16,7 +16,7 @@ public sealed class FunctionResultContent : KernelContent | |||
/// The function call ID. | |||
/// </summary> | |||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] | |||
public string? Id { get; } | |||
public string? CallId { get; } |
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.
Why do we need this change?
We should be avoiding breaking changes. So if this name change is critical then we should obsolete the old property.
public sealed class ImageContent : KernelContent | ||
#pragma warning disable SKEXP0010 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. | ||
public class ImageContent : BinaryContent | ||
#pragma warning restore SKEXP0010 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. |
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.
Should this be SKEXP0001
?
Motivation and Context
Resolves #5625
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
.