mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-13 13:53:47 +00:00
fixed tokenization issue for long files
This commit is contained in:
1 parent
185a99c9ed
commit
3918b48409
9 files changed
+506
-112
No files matched your search
@@ -44,6 +44,14 @@ public static class ContentStreamSseHandler
|
||||
return sseEvent.Content;
|
||||
|
||||
case ContentStreamPresentationMetadata presentationMetadata:
|
||||
if (!extractImages)
|
||||
{
|
||||
var slideNumber = presentationMetadata.Presentation?.SlideNumber ?? 0;
|
||||
return slideNumber > 0
|
||||
? $"# Slide {slideNumber}\n{sseEvent.Content}"
|
||||
: sseEvent.Content;
|
||||
}
|
||||
|
||||
var slideManager = SLIDE_MANAGERS.GetOrAdd(
|
||||
sseEvent.StreamId!,
|
||||
_ => new()
|
||||
@@ -131,4 +139,4 @@ public static class ContentStreamSseHandler
|
||||
|
||||
return finalContentChunk.Length > 0 ? finalContentChunk.ToString() : null;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user