Skip to content

A programming framework for agentic AI

enable dotnet build in PR check and Add namespace back in .proto (#384)

Xiaoyun Zhang09ceef4b4ad2
diff --git a/.github/workflows/dotnet-build-test-packages.yml b/.github/workflows/dotnet-build-test-packages.yml
index 42ea6554e..4467680d2 100644
--- a/.github/workflows/dotnet-build-test-packages.yml
+++ b/.github/workflows/dotnet-build-test-packages.yml
@@ -2,6 +2,12 @@ name: '[AGNext nuget] Build and test'
on:
workflow_call:
+ push:
+ branches:
+ - main
+ pull_request:
+ branches:
+ - main
jobs:
build:
diff --git a/dotnet/src/Microsoft.AI.Agents.Worker.Client/AgentBase.cs b/dotnet/src/Microsoft.AI.Agents.Worker.Client/AgentBase.cs
index 3e9fdbd8f..1884c5284 100644
--- a/dotnet/src/Microsoft.AI.Agents.Worker.Client/AgentBase.cs
+++ b/dotnet/src/Microsoft.AI.Agents.Worker.Client/AgentBase.cs
@@ -80,12 +80,12 @@ public abstract class AgentBase
{
case Message.MessageOneofCase.Event:
{
- var activity = ExtractActivity(msg.Event.Type, msg.Event.Metadata);
+ var activity = ExtractActivity(msg.Event.DataType, msg.Event.Metadata);
await InvokeWithActivityAsync(
static ((AgentBase Agent, Event Item) state) => state.Agent.HandleEvent(state.Item),
(this, msg.Event),
activity,
- msg.Event.Type).ConfigureAwait(false);
+ msg.Event.DataType).ConfigureAwait(false);
}
break;
case Message.MessageOneofCase.Request:
@@ -175,8 +175,8 @@ public abstract class AgentBase
protected async ValueTask PublishEvent(Event item)
{
- var activity = s_source.StartActivity($"PublishEvent '{item.Type}'", ActivityKind.Client, Activity.Current?.Context ?? default);
- activity?.SetTag("peer.service", $"{item.Type}/{item.Namespace}");
+ var activity = s_source.StartActivity($"PublishEvent '{item.DataType}'", ActivityKind.Client, Activity.Current?.Context ?? default);
+ activity?.SetTag("peer.service", $"{item.DataType}/{item.Namespace}");
var completion = new TaskCompletionSource<RpcResponse>(TaskCreationOptions.RunContinuationsAsynchronously);
Context.DistributedContextPropagator.Inject(activity, item.Metadata, static (carrier, key, value) => ((IDictionary<string, string>)carrier!)[key] = value);
@@ -187,7 +187,7 @@ public abstract class AgentBase
},
(this, item, completion),
activity,
- item.Type).ConfigureAwait(false);
+ item.DataType).ConfigureAwait(false);
}
protected virtual Task<RpcResponse> HandleRequest(RpcRequest request) => Task.FromResult(new RpcResponse { Error = "Not implemented" });
diff --git a/dotnet/src/Shared/RpcEventExtensions.cs b/dotnet/src/Shared/RpcEventExtensions.cs
index 330a14970..1c539db49 100644
--- a/dotnet/src/Shared/RpcEventExtensions.cs
+++ b/dotnet/src/Shared/RpcEventExtensions.cs
@@ -11,7 +11,7 @@ public static class RpcEventExtensions
var result = new RpcEvent
{
Namespace = input.Namespace,
- Type = input.Type,
+ DataType = input.Type,
};
if (input.Data is not null)
@@ -26,7 +26,7 @@ public static class RpcEventExtensions
{
var result = new Event
{
- Type = input.Type,
+ Type = input.DataType,
Subject = input.Namespace,
Namespace = input.Namespace,
Data = []
diff --git a/protos/agent_worker.proto b/protos/agent_worker.proto
index 9dd8f6996..b01e2f59b 100644
--- a/protos/agent_worker.proto
+++ b/protos/agent_worker.proto
@@ -24,11 +24,12 @@ message RpcResponse {
}
message Event {
- string topic_type = 1;
- string topic_source = 2;
- string data_type = 3;
- string data = 4;
- map<string, string> metadata = 5;
+ string namespace = 1;
+ string topic_type = 2;
+ string topic_source = 3;
+ string data_type = 4;
+ string data = 5;
+ map<string, string> metadata = 6;
}
message RegisterAgentType {