Files
agent-framework/dotnet/src/Microsoft.Agents.AI.Hosting/NoopAgentThreadStore.cs
T
73eb00b37b .NET: API to manage AgentThreads in hosting scenarios (#1520)
* skeleton

* wip

* rename + fix tests

* implement workflow tests

* fix comments

* Update dotnet/src/Microsoft.Agents.AI.Hosting/HostApplicationBuilderWorkflowExtensions.cs

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

* fixes

* proto

* fix worfklow build logic

* build it / no reflection / no generics / extensions on aiagent

* rollback + new overload on workflow builder

* address PR comments

* fix build

* take from main

* correct based on latest API

* apply suggestion

* address PR comments x1

* address PR comments 2

* renames

* *With*

* refactor api a bit

* refactor + merge main + apply suggestions

---------

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

26 lines
920 B
C#

// Copyright (c) Microsoft. All rights reserved.
using System.Threading;
using System.Threading.Tasks;
namespace Microsoft.Agents.AI.Hosting;
/// <summary>
/// This store implementation does not have any store under the hood and operates with empty threads.
/// It is the "noop" store, and could be used if you are keeping the thread contents on the client side for example.
/// </summary>
public sealed class NoopAgentThreadStore : AgentThreadStore
{
/// <inheritdoc/>
public override ValueTask SaveThreadAsync(AIAgent agent, string conversationId, AgentThread thread, CancellationToken cancellationToken = default)
{
return new ValueTask();
}
/// <inheritdoc/>
public override ValueTask<AgentThread> GetThreadAsync(AIAgent agent, string conversationId, CancellationToken cancellationToken = default)
{
return new ValueTask<AgentThread>(agent.GetNewThread());
}
}