Enabled sending document analysis sessions with attachments in the chat (#627)
Build and Release / Read metadata (push) Waiting to run
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-apple-darwin, osx-arm64, macos-latest, aarch64-apple-darwin, dmg updater) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-pc-windows-msvc.exe, win-arm64, windows-latest, aarch64-pc-windows-msvc, nsis updater) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-unknown-linux-gnu, linux-arm64, ubuntu-22.04-arm, aarch64-unknown-linux-gnu, appimage deb updater) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-apple-darwin, osx-x64, macos-latest, x86_64-apple-darwin, dmg updater) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-pc-windows-msvc.exe, win-x64, windows-latest, x86_64-pc-windows-msvc, nsis updater) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-unknown-linux-gnu, linux-x64, ubuntu-22.04, x86_64-unknown-linux-gnu, appimage deb updater) (push) Blocked by required conditions
Build and Release / Prepare & create release (push) Blocked by required conditions
Build and Release / Publish release (push) Blocked by required conditions

Co-authored-by: Thorsten Sommer <mail@tsommer.org>
This commit is contained in:
Sabrina-devopsandtsommer authored and GitHub committed 2026-01-18 19:52:19 +01:00
1 parent 3abc2bf0f1
commit 85af3ed651
7 files changed
+171 -30

No files matched your search

@@ -118,10 +118,47 @@ 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 null || this.chatThread.Blocks.Count < 2)
{
return new ChatThread
{
SystemPrompt = SystemPrompts.DEFAULT
};
}
return new ChatThread
{
ChatId = Guid.NewGuid(),
Name = string.Format(T("{0} - Document Analysis Session"), this.selectedPolicy?.PolicyName ?? T("Empty")),
SystemPrompt = SystemPrompts.DEFAULT,
Blocks =
[
// Replace the first "user block" (here, it was/is the block generated by the assistant) with a new one
// that includes the loaded document paths and a standard message about the previous analysis session:
new ContentBlock
{
Time = this.chatThread.Blocks.First().Time,
Role = ChatRole.USER,
HideFromUser = false,
ContentType = ContentType.TEXT,
Content = new ContentText
{
Text = this.T("The result of your previous document analysis session."),
FileAttachments = this.loadedDocumentPaths.ToList(),
}
},
// Then, append the last block of the current chat thread
// (which is expected to be the AI response):
this.chatThread.Blocks.Last(),
]
};
}
}
protected override void ResetForm()
{