From a17f39d28e1f4c55ca8cd8616995ee999ffbb552 Mon Sep 17 00:00:00 2001 From: Thorsten Sommer Date: Mon, 30 Jun 2025 20:43:54 +0200 Subject: [PATCH] Simplify stream ID handling in file data retrieval --- app/MindWork AI Studio/Components/ReadFileContent.razor.cs | 3 +-- app/MindWork AI Studio/Tools/Services/RustService.Retrieval.cs | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/MindWork AI Studio/Components/ReadFileContent.razor.cs b/app/MindWork AI Studio/Components/ReadFileContent.razor.cs index f01b8bc8..86bafebe 100644 --- a/app/MindWork AI Studio/Components/ReadFileContent.razor.cs +++ b/app/MindWork AI Studio/Components/ReadFileContent.razor.cs @@ -38,8 +38,7 @@ public partial class ReadFileContent : MSGComponentBase return; } - var streamId = Guid.NewGuid().ToString(); - var fileContent = await this.RustService.ReadArbitraryFileData(selectedFile.SelectedFilePath, streamId, int.MaxValue); + var fileContent = await this.RustService.ReadArbitraryFileData(selectedFile.SelectedFilePath, int.MaxValue); await this.FileContentChanged.InvokeAsync(fileContent); } } \ No newline at end of file diff --git a/app/MindWork AI Studio/Tools/Services/RustService.Retrieval.cs b/app/MindWork AI Studio/Tools/Services/RustService.Retrieval.cs index 7bebdc32..a74525c1 100644 --- a/app/MindWork AI Studio/Tools/Services/RustService.Retrieval.cs +++ b/app/MindWork AI Studio/Tools/Services/RustService.Retrieval.cs @@ -5,8 +5,9 @@ namespace AIStudio.Tools.Services; public sealed partial class RustService { - public async Task ReadArbitraryFileData(string path, string streamId, int maxChunks) + public async Task ReadArbitraryFileData(string path, int maxChunks) { + var streamId = Guid.NewGuid().ToString(); var requestUri = $"/retrieval/fs/extract?path={Uri.EscapeDataString(path)}&stream_id={streamId}"; var request = new HttpRequestMessage(HttpMethod.Get, requestUri); var response = await this.http.SendAsync(request, HttpCompletionOption.ResponseHeadersRead);