Files
agent-framework/dotnet/src/Microsoft.Agents.AI.Abstractions/Features/ConversationIdAgentFeature.cs
T
9d86adfcb2 .NET: Update AgentFeatureCollections with feedback (#2379)
* Update AgentFeatureCollections with feedback

* Address feedback.

* Fix issue with sample.

* Change generic type restriction to notnull

* Remove revision

* Update dotnet/src/Microsoft.Agents.AI.Abstractions/Features/AgentFeatureCollectionExtensions.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Add revision back again and improve some formatting.

* Remove virtual from revision.

* Add overloads taking type as param and add unit tests.

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-11-24 10:57:49 +00:00

30 lines
1019 B
C#

// Copyright (c) Microsoft. All rights reserved.
using Microsoft.Shared.Diagnostics;
namespace Microsoft.Agents.AI;
/// <summary>
/// An agent feature that allows providing a conversation identifier.
/// </summary>
/// <remarks>
/// This feature allows a user to provide a specific identifier for chat history when stored in the underlying AI service.
/// </remarks>
public class ConversationIdAgentFeature
{
/// <summary>
/// Initializes a new instance of the <see cref="ConversationIdAgentFeature"/> class with the specified thread
/// identifier.
/// </summary>
/// <param name="conversationId">The unique identifier of the thread required by the underlying AI service. Cannot be <see langword="null"/> or empty.</param>
public ConversationIdAgentFeature(string conversationId)
{
this.ConversationId = Throw.IfNullOrWhitespace(conversationId);
}
/// <summary>
/// Gets the conversation identifier.
/// </summary>
public string ConversationId { get; }
}