Skip to content

Commit

Permalink
add default sub for agenttype+id
Browse files Browse the repository at this point in the history
  • Loading branch information
rysweet committed Nov 22, 2024
1 parent 7d47213 commit 1d0b39e
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions dotnet/src/Microsoft.AutoGen/Agents/AgentBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,19 @@ protected AgentBase(
context.AgentInstance = this;
this.EventTypes = eventTypes;
_logger = logger ?? LoggerFactory.Create(builder => { }).CreateLogger<AgentBase>();
var subscriptionRequest = new AddSubscriptionRequest
{
RequestId = Guid.NewGuid().ToString(),
Subscription = new Subscription
{
TypeSubscription = new TypeSubscription
{
AgentType = this.AgentId.Type,
TopicType = this.AgentId.Key
}
}
};
_context.SendMessageAsync(new Message { AddSubscriptionRequest = subscriptionRequest }).AsTask().Wait();
Completion = Start();
}
internal Task Completion { get; }
Expand Down

0 comments on commit 1d0b39e

Please sign in to comment.