Fixed and improved the system prompt of chats started from assistants (#1172)

This commit is contained in:
Thorsten Sommer authored and GitHub committed 2026-11-06 17:44:58 +01:00
1 parent bbf4dc2231
commit 31862f5ecd
50 files changed
+1112 -107

No files matched your search

+10 -1
View File
@@ -241,6 +241,15 @@ public sealed record ChatThread
/// </summary>
public string SystemPrompt { get; set; } = string.Empty;
/// <summary>
/// Which assistant chose the system prompt of this chat, and how; null when the chat got its prompt elsewhere.
/// </summary>
/// <remarks>
/// Set when a chat continues the conversation of an assistant, see AssistantBase.ChatSystemPrompt, so that
/// the dialog showing the system prompt names the assistant rather than calling it the prompt of this chat.
/// </remarks>
public ChatSystemPromptOrigin? SystemPromptOrigin { get; set; }
/// <summary>
/// The content blocks of the chat thread.
/// </summary>
@@ -414,7 +423,7 @@ public sealed record ChatThread
parts.Add(usesChatTemplate
? new(SystemPromptPartKind.CHAT_TEMPLATE, systemPromptTextWithChatTemplate) { SourceName = chatTemplate.Name }
: new(SystemPromptPartKind.BASE_PROMPT, systemPromptTextWithChatTemplate));
: new(SystemPromptPartKind.BASE_PROMPT, systemPromptTextWithChatTemplate) { Origin = this.SystemPromptOrigin });
//
// Add augmented data, if available: