diff --git a/app/MindWork AI Studio/Chat/ChatThread.cs b/app/MindWork AI Studio/Chat/ChatThread.cs index c04e729f..73548b82 100644 --- a/app/MindWork AI Studio/Chat/ChatThread.cs +++ b/app/MindWork AI Studio/Chat/ChatThread.cs @@ -68,7 +68,7 @@ public sealed record ChatThread /// /// The current system prompt for the chat thread. /// - public string SystemPrompt { get; set; } = string.Empty; + public string SystemPrompt { get; init; } = string.Empty; /// /// The content blocks of the chat thread. @@ -121,9 +121,10 @@ public sealed record ChatThread } } - // We need a way to save the changed system prompt in our chatThread. - // Otherwise, the chatThread will always tell us that it is using the default system prompt. - chatThread.SystemPrompt = systemPromptTextWithChatTemplate; + // We need a way to save the changed system prompt in our chat thread. + // Otherwise, the chat thread will always tell us that it is using the + // default system prompt: + chatThread = chatThread with { SystemPrompt = systemPromptTextWithChatTemplate }; logger.LogInformation(logMessage);