mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-12-05 00:44:35 +00:00
Improved reading and writing large Office files without copying them into memory (#1243)
This commit is contained in:
1 parent
918572c158
commit
dbe609a9a7
37 files changed
+1161
-471
No files matched your search
@@ -33,7 +33,7 @@ public abstract class TextSegmentFormat : IDocumentSegmentFormat
|
||||
public long TextSizeOf(string path) => new FileInfo(path).Length;
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<IReadOnlyList<DocumentSegment>> ReadAsync(string path, CancellationToken token)
|
||||
public async Task<IReadOnlyList<DocumentSegment>> ReadAsync(string path, ILogger logger, CancellationToken token)
|
||||
{
|
||||
var file = await this.ReadFileAsync(path, token);
|
||||
return this.ReadSegments(file.Text).OrderBy(segment => segment.Start).Select(segment => segment.Segment).ToList();
|
||||
|
||||
Reference in new issue
Block a user