mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-07-28 01:02:56 +00:00
renamed pptx-images dictionary
This commit is contained in:
parent
3c40348fb4
commit
ef30a2edd1
@ -5,7 +5,7 @@ namespace AIStudio.Tools;
|
|||||||
|
|
||||||
public static class ContentStreamSseHandler
|
public static class ContentStreamSseHandler
|
||||||
{
|
{
|
||||||
private static readonly ConcurrentDictionary<string, List<ContentStreamPptxImageData>> PPTX_IMAGES = new();
|
private static readonly ConcurrentDictionary<string, List<ContentStreamPptxImageData>> CHUNKED_IMAGES = new();
|
||||||
private static readonly ConcurrentDictionary<string, int> CURRENT_SLIDE_NUMBERS = new();
|
private static readonly ConcurrentDictionary<string, int> CURRENT_SLIDE_NUMBERS = new();
|
||||||
|
|
||||||
public static string ProcessEvent(ContentStreamSseEvent? sseEvent, bool extractImages = true)
|
public static string ProcessEvent(ContentStreamSseEvent? sseEvent, bool extractImages = true)
|
||||||
@ -89,7 +89,7 @@ public static class ContentStreamSseHandler
|
|||||||
IsEnd = isEnd,
|
IsEnd = isEnd,
|
||||||
};
|
};
|
||||||
|
|
||||||
PPTX_IMAGES.AddOrUpdate(
|
CHUNKED_IMAGES.AddOrUpdate(
|
||||||
imageId,
|
imageId,
|
||||||
_ => [imageSegment],
|
_ => [imageSegment],
|
||||||
(_, existingList) =>
|
(_, existingList) =>
|
||||||
@ -104,7 +104,7 @@ public static class ContentStreamSseHandler
|
|||||||
|
|
||||||
private static string BuildImage(string id)
|
private static string BuildImage(string id)
|
||||||
{
|
{
|
||||||
if (!PPTX_IMAGES.TryGetValue(id, out var imageSegments))
|
if (!CHUNKED_IMAGES.TryGetValue(id, out var imageSegments))
|
||||||
return string.Empty;
|
return string.Empty;
|
||||||
|
|
||||||
var sortedSegments = imageSegments
|
var sortedSegments = imageSegments
|
||||||
@ -115,7 +115,7 @@ public static class ContentStreamSseHandler
|
|||||||
.Where(item => item.Content != null)
|
.Where(item => item.Content != null)
|
||||||
.Select(item => item.Content));
|
.Select(item => item.Content));
|
||||||
|
|
||||||
PPTX_IMAGES.Remove(id, out _);
|
CHUNKED_IMAGES.Remove(id, out _);
|
||||||
return base64Image;
|
return base64Image;
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user