mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
754dfb2c9d
* .NET: Add TTLs to durable agent sessions * Remove unnecessary async * PR feedback: clarify UTC * PR feedback: limit minimum signal delay to <= 5 minutes * PR feedback: Fix TTL disablement * Linter: use auto-property * Fix build break from OpenAI SDK change * Updated CHANGELOG.md * PR feedback * Reduce default TTL to 14 days to work around DTS bug
33 lines
1.2 KiB
C#
33 lines
1.2 KiB
C#
// Copyright (c) Microsoft. All rights reserved.
|
|
|
|
using System.Text.Json;
|
|
using System.Text.Json.Serialization;
|
|
|
|
namespace Microsoft.Agents.AI.DurableTask.State;
|
|
|
|
/// <summary>
|
|
/// Represents the data of a durable agent, including its conversation history.
|
|
/// </summary>
|
|
internal sealed class DurableAgentStateData
|
|
{
|
|
/// <summary>
|
|
/// Gets the ordered list of state entries representing the complete conversation history.
|
|
/// This includes both user messages and agent responses in chronological order.
|
|
/// </summary>
|
|
[JsonPropertyName("conversationHistory")]
|
|
public IList<DurableAgentStateEntry> ConversationHistory { get; init; } = [];
|
|
|
|
/// <summary>
|
|
/// Gets or sets the expiration time (UTC) for this agent entity.
|
|
/// If the entity is idle beyond this time, it will be automatically deleted.
|
|
/// </summary>
|
|
[JsonPropertyName("expirationTimeUtc")]
|
|
public DateTime? ExpirationTimeUtc { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets any additional data found during deserialization that does not map to known properties.
|
|
/// </summary>
|
|
[JsonExtensionData]
|
|
public IDictionary<string, JsonElement>? ExtensionData { get; set; }
|
|
}
|