Add the possibility to send document analysis sessions to the chat, with attachment.

This commit is contained in:
hart_s3 2026-01-14 14:51:12 +01:00
parent eb39d130b9
commit b479cfe0c5

View File

@ -118,10 +118,40 @@ public partial class DocumentAnalysisAssistant : AssistantBaseCore<SettingsDialo
protected override bool SubmitDisabled => (this.IsNoPolicySelected || this.loadedDocumentPaths.Count==0);
protected override ChatThread ConvertToChatThread => (this.chatThread ?? new()) with
protected override ChatThread ConvertToChatThread
{
SystemPrompt = SystemPrompts.DEFAULT,
};
get
{
if (this.chatThread is not null)
{
var convertThread = new ChatThread();
convertThread = convertThread with
{
SystemPrompt = SystemPrompts.DEFAULT,
Blocks =
[
new ContentBlock()
{
Role = ChatRole.USER,
HideFromUser = false,
ContentType = ContentType.TEXT,
Content = new ContentText()
{
Text = this.T("Your previous document from the Document Analysis Assistant."),
FileAttachments = this.loadedDocumentPaths.ToList(),
}
},
this.chatThread.Blocks.Last(),
]
};
return convertThread;
}
return new ChatThread
{
SystemPrompt = SystemPrompts.DEFAULT
};
}
}
protected override void ResetForm()
{