From 145c62dadec1c94128b26140775a8a0328249486 Mon Sep 17 00:00:00 2001 From: Thorsten Sommer Date: Tue, 30 Dec 2025 18:23:03 +0100 Subject: [PATCH] Fixed chat loading with images attached --- app/MindWork AI Studio/Chat/FileAttachment.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/MindWork AI Studio/Chat/FileAttachment.cs b/app/MindWork AI Studio/Chat/FileAttachment.cs index cf4b81fe..9d25526c 100644 --- a/app/MindWork AI Studio/Chat/FileAttachment.cs +++ b/app/MindWork AI Studio/Chat/FileAttachment.cs @@ -1,3 +1,5 @@ +using System.Text.Json.Serialization; + using AIStudio.Tools.Rust; namespace AIStudio.Chat; @@ -9,6 +11,9 @@ namespace AIStudio.Chat; /// The name of the file, including extension. /// The full path to the file, including the filename and extension. /// The size of the file in bytes. +[JsonPolymorphic(TypeDiscriminatorPropertyName = "$type")] +[JsonDerivedType(typeof(FileAttachment), typeDiscriminator: "file")] +[JsonDerivedType(typeof(FileAttachmentImage), typeDiscriminator: "image")] public record FileAttachment(FileAttachmentType Type, string FileName, string FilePath, long FileSizeBytes) { ///