mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-07-27 21:22:57 +00:00
Simplify stream ID handling in file data retrieval
This commit is contained in:
parent
bb37e4070a
commit
a17f39d28e
@ -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);
|
||||
}
|
||||
}
|
@ -5,8 +5,9 @@ namespace AIStudio.Tools.Services;
|
||||
|
||||
public sealed partial class RustService
|
||||
{
|
||||
public async Task<string> ReadArbitraryFileData(string path, string streamId, int maxChunks)
|
||||
public async Task<string> 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);
|
||||
|
Loading…
Reference in New Issue
Block a user