mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
d3f0c33180
* Checkpoint * Checkpoint * Stable * Strategies * Updated * Encoding * Formatting * Cleanup * Formatting * Tests * Tuning * Update tests * Test update * Remove working solution * Add sample to solution * Sample readyme * Experimental * Format * Formatting * Encoding * Support IChatReducer * Sample output formatting * Initial plan * Replace CompactingChatClient with MessageCompactionContextProvider Co-authored-by: crickman <66376200+crickman@users.noreply.github.com> * Boundary condition * Fix encoding * Fix cast * Test coverage * Namespace * Improvements * Efficiency * Cleanup * Detect service managed conversation * Fix namespace * Fix merge * Fix test expectation * Update dotnet/src/Microsoft.Agents.AI.Abstractions/InMemoryChatHistoryProvider.cs Co-authored-by: westey <164392973+westey-m@users.noreply.github.com> * Address PR comments (x1) * Update comment * Update comments * Clean-up * Format output * Sync sample comment * Fix condition * Adjust data-flow * Address comments (x2) * Direct compaction * Fix summarization content * Argument check / fix count calculation * Minor follow-up * Diagnostics * Minor updates * Fix state test * Fix sliding window perf * Stable state keys * Increase size computation * Formatting * Add README.md for Agent_Step18_CompactionPipeline sample (#4574) * Sample comments * Updated * Update dotnet/src/Microsoft.Agents.AI/Compaction/MessageIndex.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update dotnet/tests/Microsoft.Agents.AI.UnitTests/Compaction/CompactionProviderTests.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update dotnet/src/Microsoft.Agents.AI/Compaction/MessageIndex.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Address copilot comments * Fix namespace * Comments / convensions * Prefix `MessageGroup` and `MessageIndex` * Fix sliding window * Update dotnet/src/Microsoft.Agents.AI/Compaction/SummarizationCompactionStrategy.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update dotnet/src/Microsoft.Agents.AI.Abstractions/InMemoryChatHistoryProvider.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Python alignment * Fix merge * Fix equality, readme, and sample * Readme update and ToolResult fix * Update dotnet/src/Microsoft.Agents.AI/Compaction/SummarizationCompactionStrategy.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update dotnet/samples/02-agents/Agents/Agent_Step18_CompactionPipeline/README.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Simplify readme * Update dotnet/samples/02-agents/Agents/Agent_Step18_CompactionPipeline/README.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Remove example * Remove unused --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: westey <164392973+westey-m@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
56 lines
2.0 KiB
C#
56 lines
2.0 KiB
C#
// Copyright (c) Microsoft. All rights reserved.
|
|
|
|
using System.Diagnostics.CodeAnalysis;
|
|
using Microsoft.Shared.DiagnosticIds;
|
|
|
|
namespace Microsoft.Agents.AI.Compaction;
|
|
|
|
/// <summary>
|
|
/// Identifies the kind of a <see cref="CompactionMessageGroup"/>.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Message groups are used to classify logically related messages that must be kept together
|
|
/// during compaction operations. For example, an assistant message containing tool calls
|
|
/// and its corresponding tool result messages form an atomic <see cref="ToolCall"/> group.
|
|
/// </remarks>
|
|
[Experimental(DiagnosticIds.Experiments.AgentsAIExperiments)]
|
|
public enum CompactionGroupKind
|
|
{
|
|
/// <summary>
|
|
/// A system message group containing one or more system messages.
|
|
/// </summary>
|
|
System,
|
|
|
|
/// <summary>
|
|
/// A user message group containing a single user message.
|
|
/// </summary>
|
|
User,
|
|
|
|
/// <summary>
|
|
/// An assistant message group containing a single assistant text response (no tool calls).
|
|
/// </summary>
|
|
AssistantText,
|
|
|
|
/// <summary>
|
|
/// An atomic tool call group containing an assistant message with tool calls
|
|
/// followed by the corresponding tool result messages.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// This group must be treated as an atomic unit during compaction. Removing the assistant
|
|
/// message without its tool results (or vice versa) will cause LLM API errors.
|
|
/// </remarks>
|
|
ToolCall,
|
|
|
|
#pragma warning disable IDE0001 // Simplify Names
|
|
/// <summary>
|
|
/// A summary message group produced by a compaction strategy (e.g., <c>SummarizationCompactionStrategy</c>).
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Summary groups replace previously compacted messages with a condensed representation.
|
|
/// They are identified by the <see cref="CompactionMessageGroup.SummaryPropertyKey"/> metadata entry
|
|
/// on the underlying <see cref="Microsoft.Extensions.AI.ChatMessage"/>.
|
|
/// </remarks>
|
|
#pragma warning restore IDE0001 // Simplify Names
|
|
Summary,
|
|
}
|