Implemented removal of chat messages (#246)

This commit is contained in:
Thorsten Sommer authored and GitHub committed 2025-01-03 18:01:22 +01:00
1 parent 6f5aecd92b
commit 5e445f09fa
6 files changed
+57 -2

No files matched your search

+13
View File
@@ -97,4 +97,17 @@ public sealed record ChatThread
logger.LogInformation(logMessage);
return systemPromptText;
}
/// <summary>
/// Removes a content block from this chat thread.
/// </summary>
/// <param name="content">The content block to remove.</param>
public void Remove(IContent content)
{
var block = this.Blocks.FirstOrDefault(x => x.Content == content);
if(block is null)
return;
this.Blocks.Remove(block);
}
}