First round of cleanup of runtime abstractions (#156)

This commit is contained in:
Stephen Toub
2025-07-10 07:57:51 -04:00
committed by GitHub
parent a233d31813
commit fbf1f10a8a
76 changed files with 1254 additions and 2079 deletions
@@ -5,20 +5,20 @@ using System.Diagnostics.CodeAnalysis;
namespace Microsoft.Extensions.AI.Agents.Runtime.InProcess.Tests;
public class TestSubscription(string topicType, string agentType, string? id = null) : ISubscriptionDefinition
public class TestSubscription(string topicType, ActorType agentType, string? id = null) : ISubscriptionDefinition
{
public string Id { get; } = id ?? Guid.NewGuid().ToString();
public string TopicType { get; } = topicType;
public AgentId MapToAgent(TopicId topic)
public ActorId MapToActor(TopicId topic)
{
if (!this.Matches(topic))
{
throw new InvalidOperationException("TopicId does not match the subscription.");
}
return new AgentId(agentType, topic.Source);
return new ActorId(agentType, topic.Source);
}
public bool Equals(ISubscriptionDefinition? other) => this.Id == other?.Id;