mirror of
https://github.com/microsoft/autogen.git
synced 2025-11-01 10:19:46 +00:00
enable dotnet build in PR check and Add namespace back in .proto (#384)
* enable dotnet build for PR check * add namespace back --------- Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
This commit is contained in:
parent
63000e5424
commit
09ceef4b4a
@ -2,6 +2,12 @@ name: '[AGNext nuget] Build and test'
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
@ -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" });
|
||||
|
||||
@ -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 = []
|
||||
|
||||
@ -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 {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user