Skip to content

Commit

Permalink
use the protos from the agents package
Browse files Browse the repository at this point in the history
  • Loading branch information
rysweet committed Feb 13, 2025
1 parent f52e436 commit 6a90016
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,8 @@
using Microsoft.AutoGen.Core;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using ConversationClosed = Microsoft.AutoGen.Agents.ConversationClosed;
using NewMessageReceived = Microsoft.AutoGen.Agents.NewMessageReceived;
using Shutdown = Microsoft.AutoGen.Agents.Shutdown;

namespace Microsoft.AutoGen.Integration.Tests.AppHosts.HelloAgentTests;
namespace Samples;

[TypeSubscription("HelloTopic")]
public class HelloAgent(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@
</ItemGroup>

<ItemGroup>
<Protobuf Include="..\protos\agent_events.proto" Link="protos\agent_events.proto" />
<!--Protobuf Include="..\protos\agent_events.proto" Link="protos\agent_events.proto" /-->
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Program.cs

using Microsoft.AutoGen.Agents;
using Microsoft.AutoGen.Contracts;
using Microsoft.AutoGen.Core;
using Microsoft.AutoGen.Core.Grpc;
using Microsoft.AutoGen.Integration.Tests.AppHosts.HelloAgentTests;

using Samples;

var appBuilder = new AgentsAppBuilder(); // Create app builder
// if we are using distributed, we need the AGENT_HOST var defined and then we will use the grpc runtime
Expand All @@ -22,5 +23,6 @@
var app = await appBuilder.BuildAsync(); // Build the app
// Create a custom message type from proto and define message
var message = new NewMessageReceived { Message = "Hello World!" };
await app.PublishMessageAsync(message, new TopicId("HelloTopic", "HelloAgents/dotnet")).ConfigureAwait(false); // Publish custom message (handler has been set in HelloAgent)
//await app.PublishMessageAsync(message, new TopicId("HelloTopic", "HelloAgents/dotnet")).ConfigureAwait(false); // Publish custom message (handler has been set in HelloAgent)
await app.PublishMessageAsync(message, new TopicId("HelloTopic")).ConfigureAwait(false); // Publish custom message (handler has been set in HelloAgent)
await app.WaitForShutdownAsync().ConfigureAwait(false); // Wait for shutdown from agent

0 comments on commit 6a90016

Please sign in to comment.