Refactored file attachments (#608)
Build and Release / Read metadata (push) Has been cancelled
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-apple-darwin, osx-arm64, macos-latest, aarch64-apple-darwin, dmg updater) (push) Has been cancelled
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-pc-windows-msvc.exe, win-arm64, windows-latest, aarch64-pc-windows-msvc, nsis updater) (push) Has been cancelled
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) Has been cancelled
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-apple-darwin, osx-x64, macos-latest, x86_64-apple-darwin, dmg updater) (push) Has been cancelled
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) Has been cancelled
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) Has been cancelled
Build and Release / Prepare & create release (push) Has been cancelled
Build and Release / Publish release (push) Has been cancelled

This commit is contained in:
Thorsten Sommer authored and GitHub committed 2025-12-28 16:50:36 +01:00
1 parent 4be5002088
commit ed4c7d215a
26 files changed
+188 -76

No files matched your search

@@ -185,7 +185,7 @@ public partial class DocumentAnalysisAssistant : AssistantBaseCore<SettingsDialo
private string policyOutputRules = string.Empty;
#warning Use deferred content for document analysis
private string deferredContent = string.Empty;
private HashSet<string> loadedDocumentPaths = [];
private HashSet<FileAttachment> loadedDocumentPaths = [];
private bool IsNoPolicySelectedOrProtected => this.selectedPolicy is null || this.selectedPolicy.IsProtected;
@@ -330,13 +330,19 @@ public partial class DocumentAnalysisAssistant : AssistantBaseCore<SettingsDialo
var documentSections = new List<string>();
var count = 1;
foreach (var documentPath in this.loadedDocumentPaths)
foreach (var fileAttachment in this.loadedDocumentPaths)
{
var fileContent = await this.RustService.ReadArbitraryFileData(documentPath, int.MaxValue);
if (fileAttachment.IsForbidden)
{
this.Logger.LogWarning($"Skipping forbidden file: '{fileAttachment.FilePath}'.");
continue;
}
var fileContent = await this.RustService.ReadArbitraryFileData(fileAttachment.FilePath, int.MaxValue);
documentSections.Add($"""
## DOCUMENT {count}:
File path: {documentPath}
File path: {fileAttachment.FilePath}
Content:
```
{fileContent}