mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-11-23 06:13:48 +00:00
Added context compression (#1198)
Co-authored-by: Thorsten Sommer <SommerEngineering@users.noreply.github.com>
This commit is contained in:
1 parent
28b88580a9
commit
8a4a26503b
54 files changed
+4582
-56
No files matched your search
@@ -72,6 +72,23 @@ public sealed class WorkspaceChatCopyTests
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void AClonedChatKeepsItsIdButSharesNoMessageWithTheOriginal()
|
||||
{
|
||||
var original = new ChatThread { ChatId = Guid.NewGuid(), Name = "Step chat" };
|
||||
original.Blocks.Add(new ContentBlock { ContentType = ContentType.TEXT, Role = ChatRole.USER, Content = new ContentText { Text = "First question" } });
|
||||
|
||||
var clone = WorkspaceBehaviour.CloneChat(original);
|
||||
clone.Blocks.Clear();
|
||||
|
||||
using (Assert.EnterMultipleScope())
|
||||
{
|
||||
Assert.That(clone.ChatId, Is.EqualTo(original.ChatId), "An embedded chat replaces its conversation by a compressed clone under the same ID.");
|
||||
Assert.That(clone.Name, Is.EqualTo("Step chat"));
|
||||
Assert.That(original.Blocks, Has.Count.EqualTo(1), "Until the compressed clone is stored, the original has to stay as it is.");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Writes a transcript where a temporary chat keeps its transcripts.
|
||||
/// </summary>
|
||||
|
||||
Reference in new issue
Block a user