mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-17 07:38:00 +00:00
Localize the messages of failed indexing attempts
This commit is contained in:
7 files changed
+66
-10
No files matched your search
@@ -267,8 +267,12 @@ public sealed partial class RustService
|
||||
{
|
||||
await foreach (var segment in this.StreamArbitraryFileDataCore(path, false, true, embeddingProvider.TokenizerPath, token))
|
||||
{
|
||||
//
|
||||
// Carries a code so callers can classify it: the file itself is fine, the answer of
|
||||
// the runtime was not, which makes this worth another attempt.
|
||||
//
|
||||
if (segment.TokenCount is null)
|
||||
throw new InvalidOperationException($"Rust did not return a token count for an extracted segment from '{path}' using provider '{embeddingProvider.Name}'.");
|
||||
throw new FileExtractionException(FileExtractionErrorCode.INVALID_RESPONSE, $"Rust did not return a token count for an extracted segment from '{path}' using provider '{embeddingProvider.Name}'.");
|
||||
|
||||
yield return new(segment.Content, segment.TokenCount.Value);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user