diff --git a/app/MindWork AI Studio/Provider/OpenAI/ResponsesDeltaStreamLine.cs b/app/MindWork AI Studio/Provider/OpenAI/ResponsesDeltaStreamLine.cs index 5bad9c1b..0c1767d0 100644 --- a/app/MindWork AI Studio/Provider/OpenAI/ResponsesDeltaStreamLine.cs +++ b/app/MindWork AI Studio/Provider/OpenAI/ResponsesDeltaStreamLine.cs @@ -7,15 +7,15 @@ namespace AIStudio.Provider.OpenAI; /// The delta content of the response. public record ResponsesDeltaStreamLine( string Type, - string Delta) : IResponseStreamLine + string? Delta) : IResponseStreamLine { #region Implementation of IResponseStreamLine /// - public bool ContainsContent() => !string.IsNullOrWhiteSpace(this.Delta); + public bool ContainsContent() => this.Delta is not null; /// - public ContentStreamChunk GetContent() => new(this.Delta, this.GetSources()); + public ContentStreamChunk GetContent() => new(this.Delta ?? string.Empty, this.GetSources()); // // Please note that there are multiple options where LLM providers might stream sources: diff --git a/app/MindWork AI Studio/wwwroot/changelog/v26.2.2.md b/app/MindWork AI Studio/wwwroot/changelog/v26.2.2.md index d0f5dc9a..abbe60f4 100644 --- a/app/MindWork AI Studio/wwwroot/changelog/v26.2.2.md +++ b/app/MindWork AI Studio/wwwroot/changelog/v26.2.2.md @@ -7,4 +7,5 @@ - Improved the workspaces experience by using a different color for the delete button to avoid confusion. - Improved the plugins page by adding an action to open the plugin source link. The action opens website URLs in an external browser, supports `mailto:` links for direct email composition. - Fixed an issue where manually saving chats in workspace manual-storage mode could appear unreliable during response streaming. The save button is now disabled while streaming to prevent partial saves. +- Fixed a bug in the Responses API of our OpenAI provider implementation where streamed whitespace chunks were discarded. We thank Oliver Kunc `OliverKunc` for his first contribution in resolving this issue. We appreciate your help, Oliver. - Upgraded dependencies. \ No newline at end of file