diff --git a/dotnet/src/Microsoft.AutoGen/Abstractions/IAgentWorker.cs b/dotnet/src/Microsoft.AutoGen/Abstractions/IAgentWorker.cs index adce9be60c9e..04517cd112dc 100644 --- a/dotnet/src/Microsoft.AutoGen/Abstractions/IAgentWorker.cs +++ b/dotnet/src/Microsoft.AutoGen/Abstractions/IAgentWorker.cs @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // IAgentWorker.cs - namespace Microsoft.AutoGen.Abstractions; public interface IAgentWorker diff --git a/dotnet/src/Microsoft.AutoGen/Abstractions/MessageExtensions.cs b/dotnet/src/Microsoft.AutoGen/Abstractions/MessageExtensions.cs index c686b437bdc3..648b273ca389 100644 --- a/dotnet/src/Microsoft.AutoGen/Abstractions/MessageExtensions.cs +++ b/dotnet/src/Microsoft.AutoGen/Abstractions/MessageExtensions.cs @@ -17,6 +17,7 @@ public static CloudEvent ToCloudEvent(this T message, string source) where T Type = message.Descriptor.FullName, Source = source, Id = Guid.NewGuid().ToString(), + SpecVersion = "1.0", Attributes = { { "datacontenttype", new CloudEvent.Types.CloudEventAttributeValue { CeString = PROTO_DATA_CONTENT_TYPE } } } }; } diff --git a/dotnet/src/Microsoft.AutoGen/Agents/AgentBase.cs b/dotnet/src/Microsoft.AutoGen/Agents/AgentBase.cs index 5ff964070ffd..da3337ab0145 100644 --- a/dotnet/src/Microsoft.AutoGen/Agents/AgentBase.cs +++ b/dotnet/src/Microsoft.AutoGen/Agents/AgentBase.cs @@ -131,7 +131,7 @@ protected internal async Task HandleRpcMessage(Message msg, CancellationToken ca { case Message.MessageOneofCase.CloudEvent: { - var activity = this.ExtractActivity(msg.CloudEvent.Type, msg.CloudEvent.Metadata); + var activity = this.ExtractActivity(msg.CloudEvent.Type, msg.CloudEvent.Attributes); await this.InvokeWithActivityAsync( static ((AgentBase Agent, CloudEvent Item) state, CancellationToken _) => state.Agent.CallHandler(state.Item), (this, msg.CloudEvent), diff --git a/dotnet/src/Microsoft.AutoGen/Agents/AgentBaseExtensions.cs b/dotnet/src/Microsoft.AutoGen/Agents/AgentBaseExtensions.cs index 5d738e5fc383..38098e5dd9d4 100644 --- a/dotnet/src/Microsoft.AutoGen/Agents/AgentBaseExtensions.cs +++ b/dotnet/src/Microsoft.AutoGen/Agents/AgentBaseExtensions.cs @@ -2,6 +2,8 @@ // AgentBaseExtensions.cs using System.Diagnostics; +using Google.Protobuf.Collections; +using static Microsoft.AutoGen.Abstractions.CloudEvent.Types; namespace Microsoft.AutoGen.Agents; @@ -57,6 +59,11 @@ public static class AgentBaseExtensions return activity; } + public static Activity? ExtractActivity(this AgentBase agent, string activityName, MapField metadata) + { + return ExtractActivity(agent, activityName, metadata.ToDictionary(kvp => kvp.Key, kvp => kvp.Value.CeString)); + } + /// /// Invokes a function asynchronously within the context of an . /// diff --git a/dotnet/src/Microsoft.AutoGen/Agents/AgentRuntime.cs b/dotnet/src/Microsoft.AutoGen/Agents/AgentRuntime.cs index c36d456af32e..5cf32e14cba5 100644 --- a/dotnet/src/Microsoft.AutoGen/Agents/AgentRuntime.cs +++ b/dotnet/src/Microsoft.AutoGen/Agents/AgentRuntime.cs @@ -2,8 +2,10 @@ // AgentRuntime.cs using System.Diagnostics; +using Google.Protobuf.Collections; using Microsoft.AutoGen.Abstractions; using Microsoft.Extensions.Logging; +using static Microsoft.AutoGen.Abstractions.CloudEvent.Types; namespace Microsoft.AutoGen.Agents; @@ -28,13 +30,38 @@ internal sealed class AgentRuntime(AgentId agentId, IAgentWorker worker, ILogger out var traceState); return (traceParent, traceState); } + public (string?, string?) GetTraceIdAndState(MapField metadata) + { + DistributedContextPropagator.ExtractTraceIdAndState(metadata, + static (object? carrier, string fieldName, out string? fieldValue, out IEnumerable? fieldValues) => + { + var metadata = (MapField)carrier!; + fieldValues = null; + metadata.TryGetValue(fieldName, out var ceValue); + fieldValue = ceValue?.CeString; + }, + out var traceParent, + out var traceState); + return (traceParent, traceState); + } public void Update(RpcRequest request, Activity? activity = null) { DistributedContextPropagator.Inject(activity, request.Metadata, static (carrier, key, value) => ((IDictionary)carrier!)[key] = value); } public void Update(CloudEvent cloudEvent, Activity? activity = null) { - DistributedContextPropagator.Inject(activity, cloudEvent.Metadata, static (carrier, key, value) => ((IDictionary)carrier!)[key] = value); + DistributedContextPropagator.Inject(activity, cloudEvent.Attributes, static (carrier, key, value) => + { + var mapField = (MapField)carrier!; + if (mapField.TryGetValue(key, out var ceValue)) + { + mapField[key] = new CloudEventAttributeValue { CeString = value }; + } + else + { + mapField.Add(key, new CloudEventAttributeValue { CeString = value }); + } + }); } public async ValueTask SendResponseAsync(RpcRequest request, RpcResponse response, CancellationToken cancellationToken = default) { @@ -73,4 +100,17 @@ public IDictionary ExtractMetadata(IDictionary m return baggage as IDictionary ?? new Dictionary(); } + + public IDictionary ExtractMetadata(MapField metadata) + { + var baggage = DistributedContextPropagator.ExtractBaggage(metadata, static (object? carrier, string fieldName, out string? fieldValue, out IEnumerable? fieldValues) => + { + var metadata = (MapField)carrier!; + fieldValues = null; + metadata.TryGetValue(fieldName, out var ceValue); + fieldValue = ceValue?.CeString; + }); + + return baggage as IDictionary ?? new Dictionary(); + } } diff --git a/protos/agent_worker.proto b/protos/agent_worker.proto index 4d346dfecd63..d9170130227e 100644 --- a/protos/agent_worker.proto +++ b/protos/agent_worker.proto @@ -117,7 +117,7 @@ message Message { oneof message { RpcRequest request = 1; RpcResponse response = 2; - cloudevent.CloudEvent cloudEvent = 3; + io.cloudevents.v1.CloudEvent cloudEvent = 3; RegisterAgentTypeRequest registerAgentTypeRequest = 4; RegisterAgentTypeResponse registerAgentTypeResponse = 5; AddSubscriptionRequest addSubscriptionRequest = 6; diff --git a/protos/cloudevent.proto b/protos/cloudevent.proto index 0cd2ea85daec..232109c7e02b 100644 --- a/protos/cloudevent.proto +++ b/protos/cloudevent.proto @@ -1,6 +1,16 @@ +// https://github.com/cloudevents/spec/blob/main/cloudevents/formats/cloudevents.proto + +/** + * CloudEvent Protobuf Format + * + * - Required context attributes are explicitly represented. + * - Optional and Extension context attributes are carried in a map structure. + * - Data may be represented as binary, text, or protobuf messages. + */ + syntax = "proto3"; -package cloudevent; +package io.cloudevents.v1; import "google/protobuf/any.proto"; import "google/protobuf/timestamp.proto"; @@ -20,12 +30,12 @@ message CloudEvent { // Optional & Extension Attributes map attributes = 5; - map metadata = 6; + // -- CloudEvent Data (Bytes, Text, or Proto) oneof data { - bytes binary_data = 7; - string text_data = 8; - google.protobuf.Any proto_data = 9; + bytes binary_data = 6; + string text_data = 7; + google.protobuf.Any proto_data = 8; } /** @@ -45,4 +55,4 @@ message CloudEvent { google.protobuf.Timestamp ce_timestamp = 7; } } -} \ No newline at end of file +} diff --git a/python/packages/autogen-ext/src/autogen_ext/runtimes/grpc/_worker_runtime.py b/python/packages/autogen-ext/src/autogen_ext/runtimes/grpc/_worker_runtime.py index 703f88a53be2..d2bf41ce0d1f 100644 --- a/python/packages/autogen-ext/src/autogen_ext/runtimes/grpc/_worker_runtime.py +++ b/python/packages/autogen-ext/src/autogen_ext/runtimes/grpc/_worker_runtime.py @@ -626,11 +626,38 @@ async def _process_event(self, event: cloudevent_pb2.CloudEvent) -> None: agent = await self._get_agent(agent_id) with MessageHandlerContext.populate_context(agent.id): + def stringify_attributes( + attributes: Mapping[str, cloudevent_pb2.CloudEvent.CloudEventAttributeValue], + ) -> Mapping[str, str]: + result: Dict[str, str] = {} + for key, value in attributes.items(): + item = None + match value.WhichOneof("attr"): + case "ce_boolean": + item = str(value.ce_boolean) + case "ce_integer": + item = str(value.ce_integer) + case "ce_string": + item = value.ce_string + case "ce_bytes": + item = str(value.ce_bytes) + case "ce_uri": + item = value.ce_uri + case "ce_uri_ref": + item = value.ce_uri_ref + case "ce_timestamp": + item = str(value.ce_timestamp) + case _: + raise ValueError("Unknown attribute kind") + result[key] = item + + return result + async def send_message(agent: Agent, message_context: MessageContext) -> Any: with self._trace_helper.trace_block( "process", agent.id, - parent=event.metadata, + parent=stringify_attributes(event.attributes), extraAttributes={"message_type": message_type}, ): await agent.on_message(message, ctx=message_context) diff --git a/python/packages/autogen-ext/src/autogen_ext/runtimes/grpc/protos/agent_worker_pb2.py b/python/packages/autogen-ext/src/autogen_ext/runtimes/grpc/protos/agent_worker_pb2.py index b20849e617cc..73377103e92a 100644 --- a/python/packages/autogen-ext/src/autogen_ext/runtimes/grpc/protos/agent_worker_pb2.py +++ b/python/packages/autogen-ext/src/autogen_ext/runtimes/grpc/protos/agent_worker_pb2.py @@ -3,12 +3,10 @@ # source: agent_worker.proto # Protobuf Python Version: 4.25.1 """Generated protocol buffer code.""" - from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool from google.protobuf import symbol_database as _symbol_database from google.protobuf.internal import builder as _builder - # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() @@ -17,62 +15,61 @@ import cloudevent_pb2 as cloudevent__pb2 from google.protobuf import any_pb2 as google_dot_protobuf_dot_any__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile( - b'\n\x12\x61gent_worker.proto\x12\x06\x61gents\x1a\x10\x63loudevent.proto\x1a\x19google/protobuf/any.proto"\'\n\x07TopicId\x12\x0c\n\x04type\x18\x01 \x01(\t\x12\x0e\n\x06source\x18\x02 \x01(\t"$\n\x07\x41gentId\x12\x0c\n\x04type\x18\x01 \x01(\t\x12\x0b\n\x03key\x18\x02 \x01(\t"E\n\x07Payload\x12\x11\n\tdata_type\x18\x01 \x01(\t\x12\x19\n\x11\x64\x61ta_content_type\x18\x02 \x01(\t\x12\x0c\n\x04\x64\x61ta\x18\x03 \x01(\x0c"\x89\x02\n\nRpcRequest\x12\x12\n\nrequest_id\x18\x01 \x01(\t\x12$\n\x06source\x18\x02 \x01(\x0b\x32\x0f.agents.AgentIdH\x00\x88\x01\x01\x12\x1f\n\x06target\x18\x03 \x01(\x0b\x32\x0f.agents.AgentId\x12\x0e\n\x06method\x18\x04 \x01(\t\x12 \n\x07payload\x18\x05 \x01(\x0b\x32\x0f.agents.Payload\x12\x32\n\x08metadata\x18\x06 \x03(\x0b\x32 .agents.RpcRequest.MetadataEntry\x1a/\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\t\n\x07_source"\xb8\x01\n\x0bRpcResponse\x12\x12\n\nrequest_id\x18\x01 \x01(\t\x12 \n\x07payload\x18\x02 \x01(\x0b\x32\x0f.agents.Payload\x12\r\n\x05\x65rror\x18\x03 \x01(\t\x12\x33\n\x08metadata\x18\x04 \x03(\x0b\x32!.agents.RpcResponse.MetadataEntry\x1a/\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01"\xe4\x01\n\x05\x45vent\x12\x12\n\ntopic_type\x18\x01 \x01(\t\x12\x14\n\x0ctopic_source\x18\x02 \x01(\t\x12$\n\x06source\x18\x03 \x01(\x0b\x32\x0f.agents.AgentIdH\x00\x88\x01\x01\x12 \n\x07payload\x18\x04 \x01(\x0b\x32\x0f.agents.Payload\x12-\n\x08metadata\x18\x05 \x03(\x0b\x32\x1b.agents.Event.MetadataEntry\x1a/\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\t\n\x07_source"<\n\x18RegisterAgentTypeRequest\x12\x12\n\nrequest_id\x18\x01 \x01(\t\x12\x0c\n\x04type\x18\x02 \x01(\t"^\n\x19RegisterAgentTypeResponse\x12\x12\n\nrequest_id\x18\x01 \x01(\t\x12\x0f\n\x07success\x18\x02 \x01(\x08\x12\x12\n\x05\x65rror\x18\x03 \x01(\tH\x00\x88\x01\x01\x42\x08\n\x06_error":\n\x10TypeSubscription\x12\x12\n\ntopic_type\x18\x01 \x01(\t\x12\x12\n\nagent_type\x18\x02 \x01(\t"G\n\x16TypePrefixSubscription\x12\x19\n\x11topic_type_prefix\x18\x01 \x01(\t\x12\x12\n\nagent_type\x18\x02 \x01(\t"\x96\x01\n\x0cSubscription\x12\x34\n\x10typeSubscription\x18\x01 \x01(\x0b\x32\x18.agents.TypeSubscriptionH\x00\x12@\n\x16typePrefixSubscription\x18\x02 \x01(\x0b\x32\x1e.agents.TypePrefixSubscriptionH\x00\x42\x0e\n\x0csubscription"X\n\x16\x41\x64\x64SubscriptionRequest\x12\x12\n\nrequest_id\x18\x01 \x01(\t\x12*\n\x0csubscription\x18\x02 \x01(\x0b\x32\x14.agents.Subscription"\\\n\x17\x41\x64\x64SubscriptionResponse\x12\x12\n\nrequest_id\x18\x01 \x01(\t\x12\x0f\n\x07success\x18\x02 \x01(\x08\x12\x12\n\x05\x65rror\x18\x03 \x01(\tH\x00\x88\x01\x01\x42\x08\n\x06_error"\x9d\x01\n\nAgentState\x12!\n\x08\x61gent_id\x18\x01 \x01(\x0b\x32\x0f.agents.AgentId\x12\x0c\n\x04\x65Tag\x18\x02 \x01(\t\x12\x15\n\x0b\x62inary_data\x18\x03 \x01(\x0cH\x00\x12\x13\n\ttext_data\x18\x04 \x01(\tH\x00\x12*\n\nproto_data\x18\x05 \x01(\x0b\x32\x14.google.protobuf.AnyH\x00\x42\x06\n\x04\x64\x61ta"j\n\x10GetStateResponse\x12\'\n\x0b\x61gent_state\x18\x01 \x01(\x0b\x32\x12.agents.AgentState\x12\x0f\n\x07success\x18\x02 \x01(\x08\x12\x12\n\x05\x65rror\x18\x03 \x01(\tH\x00\x88\x01\x01\x42\x08\n\x06_error"B\n\x11SaveStateResponse\x12\x0f\n\x07success\x18\x01 \x01(\x08\x12\x12\n\x05\x65rror\x18\x02 \x01(\tH\x00\x88\x01\x01\x42\x08\n\x06_error"\xa6\x03\n\x07Message\x12%\n\x07request\x18\x01 \x01(\x0b\x32\x12.agents.RpcRequestH\x00\x12\'\n\x08response\x18\x02 \x01(\x0b\x32\x13.agents.RpcResponseH\x00\x12,\n\ncloudEvent\x18\x03 \x01(\x0b\x32\x16.cloudevent.CloudEventH\x00\x12\x44\n\x18registerAgentTypeRequest\x18\x04 \x01(\x0b\x32 .agents.RegisterAgentTypeRequestH\x00\x12\x46\n\x19registerAgentTypeResponse\x18\x05 \x01(\x0b\x32!.agents.RegisterAgentTypeResponseH\x00\x12@\n\x16\x61\x64\x64SubscriptionRequest\x18\x06 \x01(\x0b\x32\x1e.agents.AddSubscriptionRequestH\x00\x12\x42\n\x17\x61\x64\x64SubscriptionResponse\x18\x07 \x01(\x0b\x32\x1f.agents.AddSubscriptionResponseH\x00\x42\t\n\x07message2\xb2\x01\n\x08\x41gentRpc\x12\x33\n\x0bOpenChannel\x12\x0f.agents.Message\x1a\x0f.agents.Message(\x01\x30\x01\x12\x35\n\x08GetState\x12\x0f.agents.AgentId\x1a\x18.agents.GetStateResponse\x12:\n\tSaveState\x12\x12.agents.AgentState\x1a\x19.agents.SaveStateResponseB!\xaa\x02\x1eMicrosoft.AutoGen.Abstractionsb\x06proto3' -) + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x12\x61gent_worker.proto\x12\x06\x61gents\x1a\x10\x63loudevent.proto\x1a\x19google/protobuf/any.proto\"\'\n\x07TopicId\x12\x0c\n\x04type\x18\x01 \x01(\t\x12\x0e\n\x06source\x18\x02 \x01(\t\"$\n\x07\x41gentId\x12\x0c\n\x04type\x18\x01 \x01(\t\x12\x0b\n\x03key\x18\x02 \x01(\t\"E\n\x07Payload\x12\x11\n\tdata_type\x18\x01 \x01(\t\x12\x19\n\x11\x64\x61ta_content_type\x18\x02 \x01(\t\x12\x0c\n\x04\x64\x61ta\x18\x03 \x01(\x0c\"\x89\x02\n\nRpcRequest\x12\x12\n\nrequest_id\x18\x01 \x01(\t\x12$\n\x06source\x18\x02 \x01(\x0b\x32\x0f.agents.AgentIdH\x00\x88\x01\x01\x12\x1f\n\x06target\x18\x03 \x01(\x0b\x32\x0f.agents.AgentId\x12\x0e\n\x06method\x18\x04 \x01(\t\x12 \n\x07payload\x18\x05 \x01(\x0b\x32\x0f.agents.Payload\x12\x32\n\x08metadata\x18\x06 \x03(\x0b\x32 .agents.RpcRequest.MetadataEntry\x1a/\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\t\n\x07_source\"\xb8\x01\n\x0bRpcResponse\x12\x12\n\nrequest_id\x18\x01 \x01(\t\x12 \n\x07payload\x18\x02 \x01(\x0b\x32\x0f.agents.Payload\x12\r\n\x05\x65rror\x18\x03 \x01(\t\x12\x33\n\x08metadata\x18\x04 \x03(\x0b\x32!.agents.RpcResponse.MetadataEntry\x1a/\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xe4\x01\n\x05\x45vent\x12\x12\n\ntopic_type\x18\x01 \x01(\t\x12\x14\n\x0ctopic_source\x18\x02 \x01(\t\x12$\n\x06source\x18\x03 \x01(\x0b\x32\x0f.agents.AgentIdH\x00\x88\x01\x01\x12 \n\x07payload\x18\x04 \x01(\x0b\x32\x0f.agents.Payload\x12-\n\x08metadata\x18\x05 \x03(\x0b\x32\x1b.agents.Event.MetadataEntry\x1a/\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\t\n\x07_source\"<\n\x18RegisterAgentTypeRequest\x12\x12\n\nrequest_id\x18\x01 \x01(\t\x12\x0c\n\x04type\x18\x02 \x01(\t\"^\n\x19RegisterAgentTypeResponse\x12\x12\n\nrequest_id\x18\x01 \x01(\t\x12\x0f\n\x07success\x18\x02 \x01(\x08\x12\x12\n\x05\x65rror\x18\x03 \x01(\tH\x00\x88\x01\x01\x42\x08\n\x06_error\":\n\x10TypeSubscription\x12\x12\n\ntopic_type\x18\x01 \x01(\t\x12\x12\n\nagent_type\x18\x02 \x01(\t\"G\n\x16TypePrefixSubscription\x12\x19\n\x11topic_type_prefix\x18\x01 \x01(\t\x12\x12\n\nagent_type\x18\x02 \x01(\t\"\x96\x01\n\x0cSubscription\x12\x34\n\x10typeSubscription\x18\x01 \x01(\x0b\x32\x18.agents.TypeSubscriptionH\x00\x12@\n\x16typePrefixSubscription\x18\x02 \x01(\x0b\x32\x1e.agents.TypePrefixSubscriptionH\x00\x42\x0e\n\x0csubscription\"X\n\x16\x41\x64\x64SubscriptionRequest\x12\x12\n\nrequest_id\x18\x01 \x01(\t\x12*\n\x0csubscription\x18\x02 \x01(\x0b\x32\x14.agents.Subscription\"\\\n\x17\x41\x64\x64SubscriptionResponse\x12\x12\n\nrequest_id\x18\x01 \x01(\t\x12\x0f\n\x07success\x18\x02 \x01(\x08\x12\x12\n\x05\x65rror\x18\x03 \x01(\tH\x00\x88\x01\x01\x42\x08\n\x06_error\"\x9d\x01\n\nAgentState\x12!\n\x08\x61gent_id\x18\x01 \x01(\x0b\x32\x0f.agents.AgentId\x12\x0c\n\x04\x65Tag\x18\x02 \x01(\t\x12\x15\n\x0b\x62inary_data\x18\x03 \x01(\x0cH\x00\x12\x13\n\ttext_data\x18\x04 \x01(\tH\x00\x12*\n\nproto_data\x18\x05 \x01(\x0b\x32\x14.google.protobuf.AnyH\x00\x42\x06\n\x04\x64\x61ta\"j\n\x10GetStateResponse\x12\'\n\x0b\x61gent_state\x18\x01 \x01(\x0b\x32\x12.agents.AgentState\x12\x0f\n\x07success\x18\x02 \x01(\x08\x12\x12\n\x05\x65rror\x18\x03 \x01(\tH\x00\x88\x01\x01\x42\x08\n\x06_error\"B\n\x11SaveStateResponse\x12\x0f\n\x07success\x18\x01 \x01(\x08\x12\x12\n\x05\x65rror\x18\x02 \x01(\tH\x00\x88\x01\x01\x42\x08\n\x06_error\"\xad\x03\n\x07Message\x12%\n\x07request\x18\x01 \x01(\x0b\x32\x12.agents.RpcRequestH\x00\x12\'\n\x08response\x18\x02 \x01(\x0b\x32\x13.agents.RpcResponseH\x00\x12\x33\n\ncloudEvent\x18\x03 \x01(\x0b\x32\x1d.io.cloudevents.v1.CloudEventH\x00\x12\x44\n\x18registerAgentTypeRequest\x18\x04 \x01(\x0b\x32 .agents.RegisterAgentTypeRequestH\x00\x12\x46\n\x19registerAgentTypeResponse\x18\x05 \x01(\x0b\x32!.agents.RegisterAgentTypeResponseH\x00\x12@\n\x16\x61\x64\x64SubscriptionRequest\x18\x06 \x01(\x0b\x32\x1e.agents.AddSubscriptionRequestH\x00\x12\x42\n\x17\x61\x64\x64SubscriptionResponse\x18\x07 \x01(\x0b\x32\x1f.agents.AddSubscriptionResponseH\x00\x42\t\n\x07message2\xb2\x01\n\x08\x41gentRpc\x12\x33\n\x0bOpenChannel\x12\x0f.agents.Message\x1a\x0f.agents.Message(\x01\x30\x01\x12\x35\n\x08GetState\x12\x0f.agents.AgentId\x1a\x18.agents.GetStateResponse\x12:\n\tSaveState\x12\x12.agents.AgentState\x1a\x19.agents.SaveStateResponseB!\xaa\x02\x1eMicrosoft.AutoGen.Abstractionsb\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, "agent_worker_pb2", _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'agent_worker_pb2', _globals) if _descriptor._USE_C_DESCRIPTORS == False: - _globals["DESCRIPTOR"]._options = None - _globals["DESCRIPTOR"]._serialized_options = b"\252\002\036Microsoft.AutoGen.Abstractions" - _globals["_RPCREQUEST_METADATAENTRY"]._options = None - _globals["_RPCREQUEST_METADATAENTRY"]._serialized_options = b"8\001" - _globals["_RPCRESPONSE_METADATAENTRY"]._options = None - _globals["_RPCRESPONSE_METADATAENTRY"]._serialized_options = b"8\001" - _globals["_EVENT_METADATAENTRY"]._options = None - _globals["_EVENT_METADATAENTRY"]._serialized_options = b"8\001" - _globals["_TOPICID"]._serialized_start = 75 - _globals["_TOPICID"]._serialized_end = 114 - _globals["_AGENTID"]._serialized_start = 116 - _globals["_AGENTID"]._serialized_end = 152 - _globals["_PAYLOAD"]._serialized_start = 154 - _globals["_PAYLOAD"]._serialized_end = 223 - _globals["_RPCREQUEST"]._serialized_start = 226 - _globals["_RPCREQUEST"]._serialized_end = 491 - _globals["_RPCREQUEST_METADATAENTRY"]._serialized_start = 433 - _globals["_RPCREQUEST_METADATAENTRY"]._serialized_end = 480 - _globals["_RPCRESPONSE"]._serialized_start = 494 - _globals["_RPCRESPONSE"]._serialized_end = 678 - _globals["_RPCRESPONSE_METADATAENTRY"]._serialized_start = 433 - _globals["_RPCRESPONSE_METADATAENTRY"]._serialized_end = 480 - _globals["_EVENT"]._serialized_start = 681 - _globals["_EVENT"]._serialized_end = 909 - _globals["_EVENT_METADATAENTRY"]._serialized_start = 433 - _globals["_EVENT_METADATAENTRY"]._serialized_end = 480 - _globals["_REGISTERAGENTTYPEREQUEST"]._serialized_start = 911 - _globals["_REGISTERAGENTTYPEREQUEST"]._serialized_end = 971 - _globals["_REGISTERAGENTTYPERESPONSE"]._serialized_start = 973 - _globals["_REGISTERAGENTTYPERESPONSE"]._serialized_end = 1067 - _globals["_TYPESUBSCRIPTION"]._serialized_start = 1069 - _globals["_TYPESUBSCRIPTION"]._serialized_end = 1127 - _globals["_TYPEPREFIXSUBSCRIPTION"]._serialized_start = 1129 - _globals["_TYPEPREFIXSUBSCRIPTION"]._serialized_end = 1200 - _globals["_SUBSCRIPTION"]._serialized_start = 1203 - _globals["_SUBSCRIPTION"]._serialized_end = 1353 - _globals["_ADDSUBSCRIPTIONREQUEST"]._serialized_start = 1355 - _globals["_ADDSUBSCRIPTIONREQUEST"]._serialized_end = 1443 - _globals["_ADDSUBSCRIPTIONRESPONSE"]._serialized_start = 1445 - _globals["_ADDSUBSCRIPTIONRESPONSE"]._serialized_end = 1537 - _globals["_AGENTSTATE"]._serialized_start = 1540 - _globals["_AGENTSTATE"]._serialized_end = 1697 - _globals["_GETSTATERESPONSE"]._serialized_start = 1699 - _globals["_GETSTATERESPONSE"]._serialized_end = 1805 - _globals["_SAVESTATERESPONSE"]._serialized_start = 1807 - _globals["_SAVESTATERESPONSE"]._serialized_end = 1873 - _globals["_MESSAGE"]._serialized_start = 1876 - _globals["_MESSAGE"]._serialized_end = 2298 - _globals["_AGENTRPC"]._serialized_start = 2301 - _globals["_AGENTRPC"]._serialized_end = 2479 + _globals['DESCRIPTOR']._options = None + _globals['DESCRIPTOR']._serialized_options = b'\252\002\036Microsoft.AutoGen.Abstractions' + _globals['_RPCREQUEST_METADATAENTRY']._options = None + _globals['_RPCREQUEST_METADATAENTRY']._serialized_options = b'8\001' + _globals['_RPCRESPONSE_METADATAENTRY']._options = None + _globals['_RPCRESPONSE_METADATAENTRY']._serialized_options = b'8\001' + _globals['_EVENT_METADATAENTRY']._options = None + _globals['_EVENT_METADATAENTRY']._serialized_options = b'8\001' + _globals['_TOPICID']._serialized_start=75 + _globals['_TOPICID']._serialized_end=114 + _globals['_AGENTID']._serialized_start=116 + _globals['_AGENTID']._serialized_end=152 + _globals['_PAYLOAD']._serialized_start=154 + _globals['_PAYLOAD']._serialized_end=223 + _globals['_RPCREQUEST']._serialized_start=226 + _globals['_RPCREQUEST']._serialized_end=491 + _globals['_RPCREQUEST_METADATAENTRY']._serialized_start=433 + _globals['_RPCREQUEST_METADATAENTRY']._serialized_end=480 + _globals['_RPCRESPONSE']._serialized_start=494 + _globals['_RPCRESPONSE']._serialized_end=678 + _globals['_RPCRESPONSE_METADATAENTRY']._serialized_start=433 + _globals['_RPCRESPONSE_METADATAENTRY']._serialized_end=480 + _globals['_EVENT']._serialized_start=681 + _globals['_EVENT']._serialized_end=909 + _globals['_EVENT_METADATAENTRY']._serialized_start=433 + _globals['_EVENT_METADATAENTRY']._serialized_end=480 + _globals['_REGISTERAGENTTYPEREQUEST']._serialized_start=911 + _globals['_REGISTERAGENTTYPEREQUEST']._serialized_end=971 + _globals['_REGISTERAGENTTYPERESPONSE']._serialized_start=973 + _globals['_REGISTERAGENTTYPERESPONSE']._serialized_end=1067 + _globals['_TYPESUBSCRIPTION']._serialized_start=1069 + _globals['_TYPESUBSCRIPTION']._serialized_end=1127 + _globals['_TYPEPREFIXSUBSCRIPTION']._serialized_start=1129 + _globals['_TYPEPREFIXSUBSCRIPTION']._serialized_end=1200 + _globals['_SUBSCRIPTION']._serialized_start=1203 + _globals['_SUBSCRIPTION']._serialized_end=1353 + _globals['_ADDSUBSCRIPTIONREQUEST']._serialized_start=1355 + _globals['_ADDSUBSCRIPTIONREQUEST']._serialized_end=1443 + _globals['_ADDSUBSCRIPTIONRESPONSE']._serialized_start=1445 + _globals['_ADDSUBSCRIPTIONRESPONSE']._serialized_end=1537 + _globals['_AGENTSTATE']._serialized_start=1540 + _globals['_AGENTSTATE']._serialized_end=1697 + _globals['_GETSTATERESPONSE']._serialized_start=1699 + _globals['_GETSTATERESPONSE']._serialized_end=1805 + _globals['_SAVESTATERESPONSE']._serialized_start=1807 + _globals['_SAVESTATERESPONSE']._serialized_end=1873 + _globals['_MESSAGE']._serialized_start=1876 + _globals['_MESSAGE']._serialized_end=2305 + _globals['_AGENTRPC']._serialized_start=2308 + _globals['_AGENTRPC']._serialized_end=2486 # @@protoc_insertion_point(module_scope) diff --git a/python/packages/autogen-ext/src/autogen_ext/runtimes/grpc/protos/agent_worker_pb2.pyi b/python/packages/autogen-ext/src/autogen_ext/runtimes/grpc/protos/agent_worker_pb2.pyi index f9f8a7c47eae..79e384ab948b 100644 --- a/python/packages/autogen-ext/src/autogen_ext/runtimes/grpc/protos/agent_worker_pb2.pyi +++ b/python/packages/autogen-ext/src/autogen_ext/runtimes/grpc/protos/agent_worker_pb2.pyi @@ -4,14 +4,13 @@ isort:skip_file """ import builtins -import collections.abc -import typing - import cloudevent_pb2 +import collections.abc import google.protobuf.any_pb2 import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message +import typing DESCRIPTOR: google.protobuf.descriptor.FileDescriptor @@ -68,12 +67,7 @@ class Payload(google.protobuf.message.Message): data_content_type: builtins.str = ..., data: builtins.bytes = ..., ) -> None: ... - def ClearField( - self, - field_name: typing.Literal[ - "data", b"data", "data_content_type", b"data_content_type", "data_type", b"data_type" - ], - ) -> None: ... + def ClearField(self, field_name: typing.Literal["data", b"data", "data_content_type", b"data_content_type", "data_type", b"data_type"]) -> None: ... global___Payload = Payload @@ -123,31 +117,8 @@ class RpcRequest(google.protobuf.message.Message): payload: global___Payload | None = ..., metadata: collections.abc.Mapping[builtins.str, builtins.str] | None = ..., ) -> None: ... - def HasField( - self, - field_name: typing.Literal[ - "_source", b"_source", "payload", b"payload", "source", b"source", "target", b"target" - ], - ) -> builtins.bool: ... - def ClearField( - self, - field_name: typing.Literal[ - "_source", - b"_source", - "metadata", - b"metadata", - "method", - b"method", - "payload", - b"payload", - "request_id", - b"request_id", - "source", - b"source", - "target", - b"target", - ], - ) -> None: ... + def HasField(self, field_name: typing.Literal["_source", b"_source", "payload", b"payload", "source", b"source", "target", b"target"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["_source", b"_source", "metadata", b"metadata", "method", b"method", "payload", b"payload", "request_id", b"request_id", "source", b"source", "target", b"target"]) -> None: ... def WhichOneof(self, oneof_group: typing.Literal["_source", b"_source"]) -> typing.Literal["source"] | None: ... global___RpcRequest = RpcRequest @@ -191,12 +162,7 @@ class RpcResponse(google.protobuf.message.Message): metadata: collections.abc.Mapping[builtins.str, builtins.str] | None = ..., ) -> None: ... def HasField(self, field_name: typing.Literal["payload", b"payload"]) -> builtins.bool: ... - def ClearField( - self, - field_name: typing.Literal[ - "error", b"error", "metadata", b"metadata", "payload", b"payload", "request_id", b"request_id" - ], - ) -> None: ... + def ClearField(self, field_name: typing.Literal["error", b"error", "metadata", b"metadata", "payload", b"payload", "request_id", b"request_id"]) -> None: ... global___RpcResponse = RpcResponse @@ -242,26 +208,8 @@ class Event(google.protobuf.message.Message): payload: global___Payload | None = ..., metadata: collections.abc.Mapping[builtins.str, builtins.str] | None = ..., ) -> None: ... - def HasField( - self, field_name: typing.Literal["_source", b"_source", "payload", b"payload", "source", b"source"] - ) -> builtins.bool: ... - def ClearField( - self, - field_name: typing.Literal[ - "_source", - b"_source", - "metadata", - b"metadata", - "payload", - b"payload", - "source", - b"source", - "topic_source", - b"topic_source", - "topic_type", - b"topic_type", - ], - ) -> None: ... + def HasField(self, field_name: typing.Literal["_source", b"_source", "payload", b"payload", "source", b"source"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["_source", b"_source", "metadata", b"metadata", "payload", b"payload", "source", b"source", "topic_source", b"topic_source", "topic_type", b"topic_type"]) -> None: ... def WhichOneof(self, oneof_group: typing.Literal["_source", b"_source"]) -> typing.Literal["source"] | None: ... global___Event = Event @@ -302,12 +250,7 @@ class RegisterAgentTypeResponse(google.protobuf.message.Message): error: builtins.str | None = ..., ) -> None: ... def HasField(self, field_name: typing.Literal["_error", b"_error", "error", b"error"]) -> builtins.bool: ... - def ClearField( - self, - field_name: typing.Literal[ - "_error", b"_error", "error", b"error", "request_id", b"request_id", "success", b"success" - ], - ) -> None: ... + def ClearField(self, field_name: typing.Literal["_error", b"_error", "error", b"error", "request_id", b"request_id", "success", b"success"]) -> None: ... def WhichOneof(self, oneof_group: typing.Literal["_error", b"_error"]) -> typing.Literal["error"] | None: ... global___RegisterAgentTypeResponse = RegisterAgentTypeResponse @@ -326,9 +269,7 @@ class TypeSubscription(google.protobuf.message.Message): topic_type: builtins.str = ..., agent_type: builtins.str = ..., ) -> None: ... - def ClearField( - self, field_name: typing.Literal["agent_type", b"agent_type", "topic_type", b"topic_type"] - ) -> None: ... + def ClearField(self, field_name: typing.Literal["agent_type", b"agent_type", "topic_type", b"topic_type"]) -> None: ... global___TypeSubscription = TypeSubscription @@ -346,9 +287,7 @@ class TypePrefixSubscription(google.protobuf.message.Message): topic_type_prefix: builtins.str = ..., agent_type: builtins.str = ..., ) -> None: ... - def ClearField( - self, field_name: typing.Literal["agent_type", b"agent_type", "topic_type_prefix", b"topic_type_prefix"] - ) -> None: ... + def ClearField(self, field_name: typing.Literal["agent_type", b"agent_type", "topic_type_prefix", b"topic_type_prefix"]) -> None: ... global___TypePrefixSubscription = TypePrefixSubscription @@ -368,31 +307,9 @@ class Subscription(google.protobuf.message.Message): typeSubscription: global___TypeSubscription | None = ..., typePrefixSubscription: global___TypePrefixSubscription | None = ..., ) -> None: ... - def HasField( - self, - field_name: typing.Literal[ - "subscription", - b"subscription", - "typePrefixSubscription", - b"typePrefixSubscription", - "typeSubscription", - b"typeSubscription", - ], - ) -> builtins.bool: ... - def ClearField( - self, - field_name: typing.Literal[ - "subscription", - b"subscription", - "typePrefixSubscription", - b"typePrefixSubscription", - "typeSubscription", - b"typeSubscription", - ], - ) -> None: ... - def WhichOneof( - self, oneof_group: typing.Literal["subscription", b"subscription"] - ) -> typing.Literal["typeSubscription", "typePrefixSubscription"] | None: ... + def HasField(self, field_name: typing.Literal["subscription", b"subscription", "typePrefixSubscription", b"typePrefixSubscription", "typeSubscription", b"typeSubscription"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["subscription", b"subscription", "typePrefixSubscription", b"typePrefixSubscription", "typeSubscription", b"typeSubscription"]) -> None: ... + def WhichOneof(self, oneof_group: typing.Literal["subscription", b"subscription"]) -> typing.Literal["typeSubscription", "typePrefixSubscription"] | None: ... global___Subscription = Subscription @@ -412,9 +329,7 @@ class AddSubscriptionRequest(google.protobuf.message.Message): subscription: global___Subscription | None = ..., ) -> None: ... def HasField(self, field_name: typing.Literal["subscription", b"subscription"]) -> builtins.bool: ... - def ClearField( - self, field_name: typing.Literal["request_id", b"request_id", "subscription", b"subscription"] - ) -> None: ... + def ClearField(self, field_name: typing.Literal["request_id", b"request_id", "subscription", b"subscription"]) -> None: ... global___AddSubscriptionRequest = AddSubscriptionRequest @@ -436,12 +351,7 @@ class AddSubscriptionResponse(google.protobuf.message.Message): error: builtins.str | None = ..., ) -> None: ... def HasField(self, field_name: typing.Literal["_error", b"_error", "error", b"error"]) -> builtins.bool: ... - def ClearField( - self, - field_name: typing.Literal[ - "_error", b"_error", "error", b"error", "request_id", b"request_id", "success", b"success" - ], - ) -> None: ... + def ClearField(self, field_name: typing.Literal["_error", b"_error", "error", b"error", "request_id", b"request_id", "success", b"success"]) -> None: ... def WhichOneof(self, oneof_group: typing.Literal["_error", b"_error"]) -> typing.Literal["error"] | None: ... global___AddSubscriptionResponse = AddSubscriptionResponse @@ -471,41 +381,9 @@ class AgentState(google.protobuf.message.Message): text_data: builtins.str = ..., proto_data: google.protobuf.any_pb2.Any | None = ..., ) -> None: ... - def HasField( - self, - field_name: typing.Literal[ - "agent_id", - b"agent_id", - "binary_data", - b"binary_data", - "data", - b"data", - "proto_data", - b"proto_data", - "text_data", - b"text_data", - ], - ) -> builtins.bool: ... - def ClearField( - self, - field_name: typing.Literal[ - "agent_id", - b"agent_id", - "binary_data", - b"binary_data", - "data", - b"data", - "eTag", - b"eTag", - "proto_data", - b"proto_data", - "text_data", - b"text_data", - ], - ) -> None: ... - def WhichOneof( - self, oneof_group: typing.Literal["data", b"data"] - ) -> typing.Literal["binary_data", "text_data", "proto_data"] | None: ... + def HasField(self, field_name: typing.Literal["agent_id", b"agent_id", "binary_data", b"binary_data", "data", b"data", "proto_data", b"proto_data", "text_data", b"text_data"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["agent_id", b"agent_id", "binary_data", b"binary_data", "data", b"data", "eTag", b"eTag", "proto_data", b"proto_data", "text_data", b"text_data"]) -> None: ... + def WhichOneof(self, oneof_group: typing.Literal["data", b"data"]) -> typing.Literal["binary_data", "text_data", "proto_data"] | None: ... global___AgentState = AgentState @@ -527,15 +405,8 @@ class GetStateResponse(google.protobuf.message.Message): success: builtins.bool = ..., error: builtins.str | None = ..., ) -> None: ... - def HasField( - self, field_name: typing.Literal["_error", b"_error", "agent_state", b"agent_state", "error", b"error"] - ) -> builtins.bool: ... - def ClearField( - self, - field_name: typing.Literal[ - "_error", b"_error", "agent_state", b"agent_state", "error", b"error", "success", b"success" - ], - ) -> None: ... + def HasField(self, field_name: typing.Literal["_error", b"_error", "agent_state", b"agent_state", "error", b"error"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["_error", b"_error", "agent_state", b"agent_state", "error", b"error", "success", b"success"]) -> None: ... def WhichOneof(self, oneof_group: typing.Literal["_error", b"_error"]) -> typing.Literal["error"] | None: ... global___GetStateResponse = GetStateResponse @@ -555,9 +426,7 @@ class SaveStateResponse(google.protobuf.message.Message): error: builtins.str | None = ..., ) -> None: ... def HasField(self, field_name: typing.Literal["_error", b"_error", "error", b"error"]) -> builtins.bool: ... - def ClearField( - self, field_name: typing.Literal["_error", b"_error", "error", b"error", "success", b"success"] - ) -> None: ... + def ClearField(self, field_name: typing.Literal["_error", b"_error", "error", b"error", "success", b"success"]) -> None: ... def WhichOneof(self, oneof_group: typing.Literal["_error", b"_error"]) -> typing.Literal["error"] | None: ... global___SaveStateResponse = SaveStateResponse @@ -598,61 +467,8 @@ class Message(google.protobuf.message.Message): addSubscriptionRequest: global___AddSubscriptionRequest | None = ..., addSubscriptionResponse: global___AddSubscriptionResponse | None = ..., ) -> None: ... - def HasField( - self, - field_name: typing.Literal[ - "addSubscriptionRequest", - b"addSubscriptionRequest", - "addSubscriptionResponse", - b"addSubscriptionResponse", - "cloudEvent", - b"cloudEvent", - "message", - b"message", - "registerAgentTypeRequest", - b"registerAgentTypeRequest", - "registerAgentTypeResponse", - b"registerAgentTypeResponse", - "request", - b"request", - "response", - b"response", - ], - ) -> builtins.bool: ... - def ClearField( - self, - field_name: typing.Literal[ - "addSubscriptionRequest", - b"addSubscriptionRequest", - "addSubscriptionResponse", - b"addSubscriptionResponse", - "cloudEvent", - b"cloudEvent", - "message", - b"message", - "registerAgentTypeRequest", - b"registerAgentTypeRequest", - "registerAgentTypeResponse", - b"registerAgentTypeResponse", - "request", - b"request", - "response", - b"response", - ], - ) -> None: ... - def WhichOneof( - self, oneof_group: typing.Literal["message", b"message"] - ) -> ( - typing.Literal[ - "request", - "response", - "cloudEvent", - "registerAgentTypeRequest", - "registerAgentTypeResponse", - "addSubscriptionRequest", - "addSubscriptionResponse", - ] - | None - ): ... + def HasField(self, field_name: typing.Literal["addSubscriptionRequest", b"addSubscriptionRequest", "addSubscriptionResponse", b"addSubscriptionResponse", "cloudEvent", b"cloudEvent", "message", b"message", "registerAgentTypeRequest", b"registerAgentTypeRequest", "registerAgentTypeResponse", b"registerAgentTypeResponse", "request", b"request", "response", b"response"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["addSubscriptionRequest", b"addSubscriptionRequest", "addSubscriptionResponse", b"addSubscriptionResponse", "cloudEvent", b"cloudEvent", "message", b"message", "registerAgentTypeRequest", b"registerAgentTypeRequest", "registerAgentTypeResponse", b"registerAgentTypeResponse", "request", b"request", "response", b"response"]) -> None: ... + def WhichOneof(self, oneof_group: typing.Literal["message", b"message"]) -> typing.Literal["request", "response", "cloudEvent", "registerAgentTypeRequest", "registerAgentTypeResponse", "addSubscriptionRequest", "addSubscriptionResponse"] | None: ... global___Message = Message diff --git a/python/packages/autogen-ext/src/autogen_ext/runtimes/grpc/protos/agent_worker_pb2_grpc.py b/python/packages/autogen-ext/src/autogen_ext/runtimes/grpc/protos/agent_worker_pb2_grpc.py index c956a5d69282..fc27021587f6 100644 --- a/python/packages/autogen-ext/src/autogen_ext/runtimes/grpc/protos/agent_worker_pb2_grpc.py +++ b/python/packages/autogen-ext/src/autogen_ext/runtimes/grpc/protos/agent_worker_pb2_grpc.py @@ -1,8 +1,8 @@ # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! """Client and server classes corresponding to protobuf-defined services.""" +import grpc import agent_worker_pb2 as agent__worker__pb2 -import grpc class AgentRpcStub(object): @@ -15,20 +15,20 @@ def __init__(self, channel): channel: A grpc.Channel. """ self.OpenChannel = channel.stream_stream( - "/agents.AgentRpc/OpenChannel", - request_serializer=agent__worker__pb2.Message.SerializeToString, - response_deserializer=agent__worker__pb2.Message.FromString, - ) + '/agents.AgentRpc/OpenChannel', + request_serializer=agent__worker__pb2.Message.SerializeToString, + response_deserializer=agent__worker__pb2.Message.FromString, + ) self.GetState = channel.unary_unary( - "/agents.AgentRpc/GetState", - request_serializer=agent__worker__pb2.AgentId.SerializeToString, - response_deserializer=agent__worker__pb2.GetStateResponse.FromString, - ) + '/agents.AgentRpc/GetState', + request_serializer=agent__worker__pb2.AgentId.SerializeToString, + response_deserializer=agent__worker__pb2.GetStateResponse.FromString, + ) self.SaveState = channel.unary_unary( - "/agents.AgentRpc/SaveState", - request_serializer=agent__worker__pb2.AgentState.SerializeToString, - response_deserializer=agent__worker__pb2.SaveStateResponse.FromString, - ) + '/agents.AgentRpc/SaveState', + request_serializer=agent__worker__pb2.AgentState.SerializeToString, + response_deserializer=agent__worker__pb2.SaveStateResponse.FromString, + ) class AgentRpcServicer(object): @@ -37,131 +37,96 @@ class AgentRpcServicer(object): def OpenChannel(self, request_iterator, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') def GetState(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') def SaveState(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') def add_AgentRpcServicer_to_server(servicer, server): rpc_method_handlers = { - "OpenChannel": grpc.stream_stream_rpc_method_handler( - servicer.OpenChannel, - request_deserializer=agent__worker__pb2.Message.FromString, - response_serializer=agent__worker__pb2.Message.SerializeToString, - ), - "GetState": grpc.unary_unary_rpc_method_handler( - servicer.GetState, - request_deserializer=agent__worker__pb2.AgentId.FromString, - response_serializer=agent__worker__pb2.GetStateResponse.SerializeToString, - ), - "SaveState": grpc.unary_unary_rpc_method_handler( - servicer.SaveState, - request_deserializer=agent__worker__pb2.AgentState.FromString, - response_serializer=agent__worker__pb2.SaveStateResponse.SerializeToString, - ), + 'OpenChannel': grpc.stream_stream_rpc_method_handler( + servicer.OpenChannel, + request_deserializer=agent__worker__pb2.Message.FromString, + response_serializer=agent__worker__pb2.Message.SerializeToString, + ), + 'GetState': grpc.unary_unary_rpc_method_handler( + servicer.GetState, + request_deserializer=agent__worker__pb2.AgentId.FromString, + response_serializer=agent__worker__pb2.GetStateResponse.SerializeToString, + ), + 'SaveState': grpc.unary_unary_rpc_method_handler( + servicer.SaveState, + request_deserializer=agent__worker__pb2.AgentState.FromString, + response_serializer=agent__worker__pb2.SaveStateResponse.SerializeToString, + ), } - generic_handler = grpc.method_handlers_generic_handler("agents.AgentRpc", rpc_method_handlers) + generic_handler = grpc.method_handlers_generic_handler( + 'agents.AgentRpc', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) -# This class is part of an EXPERIMENTAL API. + # This class is part of an EXPERIMENTAL API. class AgentRpc(object): """Missing associated documentation comment in .proto file.""" @staticmethod - def OpenChannel( - request_iterator, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None, - ): - return grpc.experimental.stream_stream( - request_iterator, + def OpenChannel(request_iterator, target, - "/agents.AgentRpc/OpenChannel", + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.stream_stream(request_iterator, target, '/agents.AgentRpc/OpenChannel', agent__worker__pb2.Message.SerializeToString, agent__worker__pb2.Message.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - ) + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod - def GetState( - request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None, - ): - return grpc.experimental.unary_unary( - request, + def GetState(request, target, - "/agents.AgentRpc/GetState", + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/agents.AgentRpc/GetState', agent__worker__pb2.AgentId.SerializeToString, agent__worker__pb2.GetStateResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - ) + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod - def SaveState( - request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None, - ): - return grpc.experimental.unary_unary( - request, + def SaveState(request, target, - "/agents.AgentRpc/SaveState", + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/agents.AgentRpc/SaveState', agent__worker__pb2.AgentState.SerializeToString, agent__worker__pb2.SaveStateResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - ) + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) diff --git a/python/packages/autogen-ext/src/autogen_ext/runtimes/grpc/protos/agent_worker_pb2_grpc.pyi b/python/packages/autogen-ext/src/autogen_ext/runtimes/grpc/protos/agent_worker_pb2_grpc.pyi index a60c5ee7882c..bf6bc1ba2d64 100644 --- a/python/packages/autogen-ext/src/autogen_ext/runtimes/grpc/protos/agent_worker_pb2_grpc.pyi +++ b/python/packages/autogen-ext/src/autogen_ext/runtimes/grpc/protos/agent_worker_pb2_grpc.pyi @@ -4,16 +4,16 @@ isort:skip_file """ import abc -import collections.abc -import typing - import agent_worker_pb2 +import collections.abc import grpc import grpc.aio +import typing _T = typing.TypeVar("_T") class _MaybeAsyncIterator(collections.abc.AsyncIterator[_T], collections.abc.Iterator[_T], metaclass=abc.ABCMeta): ... + class _ServicerContext(grpc.ServicerContext, grpc.aio.ServicerContext): # type: ignore[misc, type-arg] ... @@ -56,26 +56,20 @@ class AgentRpcServicer(metaclass=abc.ABCMeta): self, request_iterator: _MaybeAsyncIterator[agent_worker_pb2.Message], context: _ServicerContext, - ) -> typing.Union[ - collections.abc.Iterator[agent_worker_pb2.Message], collections.abc.AsyncIterator[agent_worker_pb2.Message] - ]: ... + ) -> typing.Union[collections.abc.Iterator[agent_worker_pb2.Message], collections.abc.AsyncIterator[agent_worker_pb2.Message]]: ... + @abc.abstractmethod def GetState( self, request: agent_worker_pb2.AgentId, context: _ServicerContext, - ) -> typing.Union[ - agent_worker_pb2.GetStateResponse, collections.abc.Awaitable[agent_worker_pb2.GetStateResponse] - ]: ... + ) -> typing.Union[agent_worker_pb2.GetStateResponse, collections.abc.Awaitable[agent_worker_pb2.GetStateResponse]]: ... + @abc.abstractmethod def SaveState( self, request: agent_worker_pb2.AgentState, context: _ServicerContext, - ) -> typing.Union[ - agent_worker_pb2.SaveStateResponse, collections.abc.Awaitable[agent_worker_pb2.SaveStateResponse] - ]: ... + ) -> typing.Union[agent_worker_pb2.SaveStateResponse, collections.abc.Awaitable[agent_worker_pb2.SaveStateResponse]]: ... -def add_AgentRpcServicer_to_server( - servicer: AgentRpcServicer, server: typing.Union[grpc.Server, grpc.aio.Server] -) -> None: ... +def add_AgentRpcServicer_to_server(servicer: AgentRpcServicer, server: typing.Union[grpc.Server, grpc.aio.Server]) -> None: ... diff --git a/python/packages/autogen-ext/src/autogen_ext/runtimes/grpc/protos/cloudevent_pb2.py b/python/packages/autogen-ext/src/autogen_ext/runtimes/grpc/protos/cloudevent_pb2.py index 1c157bd7d1d0..fd0bd38700b1 100644 --- a/python/packages/autogen-ext/src/autogen_ext/runtimes/grpc/protos/cloudevent_pb2.py +++ b/python/packages/autogen-ext/src/autogen_ext/runtimes/grpc/protos/cloudevent_pb2.py @@ -3,12 +3,10 @@ # source: cloudevent.proto # Protobuf Python Version: 4.25.1 """Generated protocol buffer code.""" - from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool from google.protobuf import symbol_database as _symbol_database from google.protobuf.internal import builder as _builder - # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() @@ -17,26 +15,21 @@ from google.protobuf import any_pb2 as google_dot_protobuf_dot_any__pb2 from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile( - b'\n\x10\x63loudevent.proto\x12\ncloudevent\x1a\x19google/protobuf/any.proto\x1a\x1fgoogle/protobuf/timestamp.proto"\xa4\x05\n\nCloudEvent\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0e\n\x06source\x18\x02 \x01(\t\x12\x14\n\x0cspec_version\x18\x03 \x01(\t\x12\x0c\n\x04type\x18\x04 \x01(\t\x12:\n\nattributes\x18\x05 \x03(\x0b\x32&.cloudevent.CloudEvent.AttributesEntry\x12\x36\n\x08metadata\x18\x06 \x03(\x0b\x32$.cloudevent.CloudEvent.MetadataEntry\x12\x17\n\x0f\x64\x61tacontenttype\x18\x07 \x01(\t\x12\x15\n\x0b\x62inary_data\x18\x08 \x01(\x0cH\x00\x12\x13\n\ttext_data\x18\t \x01(\tH\x00\x12*\n\nproto_data\x18\n \x01(\x0b\x32\x14.google.protobuf.AnyH\x00\x1a\x62\n\x0f\x41ttributesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12>\n\x05value\x18\x02 \x01(\x0b\x32/.cloudevent.CloudEvent.CloudEventAttributeValue:\x02\x38\x01\x1a/\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\xd3\x01\n\x18\x43loudEventAttributeValue\x12\x14\n\nce_boolean\x18\x01 \x01(\x08H\x00\x12\x14\n\nce_integer\x18\x02 \x01(\x05H\x00\x12\x13\n\tce_string\x18\x03 \x01(\tH\x00\x12\x12\n\x08\x63\x65_bytes\x18\x04 \x01(\x0cH\x00\x12\x10\n\x06\x63\x65_uri\x18\x05 \x01(\tH\x00\x12\x14\n\nce_uri_ref\x18\x06 \x01(\tH\x00\x12\x32\n\x0c\x63\x65_timestamp\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00\x42\x06\n\x04\x61ttrB\x06\n\x04\x64\x61taB!\xaa\x02\x1eMicrosoft.AutoGen.Abstractionsb\x06proto3' -) + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x10\x63loudevent.proto\x12\x11io.cloudevents.v1\x1a\x19google/protobuf/any.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xb0\x04\n\nCloudEvent\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0e\n\x06source\x18\x02 \x01(\t\x12\x14\n\x0cspec_version\x18\x03 \x01(\t\x12\x0c\n\x04type\x18\x04 \x01(\t\x12\x41\n\nattributes\x18\x05 \x03(\x0b\x32-.io.cloudevents.v1.CloudEvent.AttributesEntry\x12\x15\n\x0b\x62inary_data\x18\x06 \x01(\x0cH\x00\x12\x13\n\ttext_data\x18\x07 \x01(\tH\x00\x12*\n\nproto_data\x18\x08 \x01(\x0b\x32\x14.google.protobuf.AnyH\x00\x1ai\n\x0f\x41ttributesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x45\n\x05value\x18\x02 \x01(\x0b\x32\x36.io.cloudevents.v1.CloudEvent.CloudEventAttributeValue:\x02\x38\x01\x1a\xd3\x01\n\x18\x43loudEventAttributeValue\x12\x14\n\nce_boolean\x18\x01 \x01(\x08H\x00\x12\x14\n\nce_integer\x18\x02 \x01(\x05H\x00\x12\x13\n\tce_string\x18\x03 \x01(\tH\x00\x12\x12\n\x08\x63\x65_bytes\x18\x04 \x01(\x0cH\x00\x12\x10\n\x06\x63\x65_uri\x18\x05 \x01(\tH\x00\x12\x14\n\nce_uri_ref\x18\x06 \x01(\tH\x00\x12\x32\n\x0c\x63\x65_timestamp\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00\x42\x06\n\x04\x61ttrB\x06\n\x04\x64\x61taB!\xaa\x02\x1eMicrosoft.AutoGen.Abstractionsb\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, "cloudevent_pb2", _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'cloudevent_pb2', _globals) if _descriptor._USE_C_DESCRIPTORS == False: - _globals["DESCRIPTOR"]._options = None - _globals["DESCRIPTOR"]._serialized_options = b"\252\002\036Microsoft.AutoGen.Abstractions" - _globals["_CLOUDEVENT_ATTRIBUTESENTRY"]._options = None - _globals["_CLOUDEVENT_ATTRIBUTESENTRY"]._serialized_options = b"8\001" - _globals["_CLOUDEVENT_METADATAENTRY"]._options = None - _globals["_CLOUDEVENT_METADATAENTRY"]._serialized_options = b"8\001" - _globals["_CLOUDEVENT"]._serialized_start = 93 - _globals["_CLOUDEVENT"]._serialized_end = 769 - _globals["_CLOUDEVENT_ATTRIBUTESENTRY"]._serialized_start = 400 - _globals["_CLOUDEVENT_ATTRIBUTESENTRY"]._serialized_end = 498 - _globals["_CLOUDEVENT_METADATAENTRY"]._serialized_start = 500 - _globals["_CLOUDEVENT_METADATAENTRY"]._serialized_end = 547 - _globals["_CLOUDEVENT_CLOUDEVENTATTRIBUTEVALUE"]._serialized_start = 550 - _globals["_CLOUDEVENT_CLOUDEVENTATTRIBUTEVALUE"]._serialized_end = 761 + _globals['DESCRIPTOR']._options = None + _globals['DESCRIPTOR']._serialized_options = b'\252\002\036Microsoft.AutoGen.Abstractions' + _globals['_CLOUDEVENT_ATTRIBUTESENTRY']._options = None + _globals['_CLOUDEVENT_ATTRIBUTESENTRY']._serialized_options = b'8\001' + _globals['_CLOUDEVENT']._serialized_start=100 + _globals['_CLOUDEVENT']._serialized_end=660 + _globals['_CLOUDEVENT_ATTRIBUTESENTRY']._serialized_start=333 + _globals['_CLOUDEVENT_ATTRIBUTESENTRY']._serialized_end=438 + _globals['_CLOUDEVENT_CLOUDEVENTATTRIBUTEVALUE']._serialized_start=441 + _globals['_CLOUDEVENT_CLOUDEVENTATTRIBUTEVALUE']._serialized_end=652 # @@protoc_insertion_point(module_scope) diff --git a/python/packages/autogen-ext/src/autogen_ext/runtimes/grpc/protos/cloudevent_pb2.pyi b/python/packages/autogen-ext/src/autogen_ext/runtimes/grpc/protos/cloudevent_pb2.pyi index 033a3a509061..bbdb162fc4f2 100644 --- a/python/packages/autogen-ext/src/autogen_ext/runtimes/grpc/protos/cloudevent_pb2.pyi +++ b/python/packages/autogen-ext/src/autogen_ext/runtimes/grpc/protos/cloudevent_pb2.pyi @@ -1,17 +1,22 @@ """ @generated by mypy-protobuf. Do not edit manually! isort:skip_file +* +CloudEvent Protobuf Format + +- Required context attributes are explicitly represented. +- Optional and Extension context attributes are carried in a map structure. +- Data may be represented as binary, text, or protobuf messages. """ import builtins import collections.abc -import typing - import google.protobuf.any_pb2 import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message import google.protobuf.timestamp_pb2 +import typing DESCRIPTOR: google.protobuf.descriptor.FileDescriptor @@ -37,22 +42,6 @@ class CloudEvent(google.protobuf.message.Message): def HasField(self, field_name: typing.Literal["value", b"value"]) -> builtins.bool: ... def ClearField(self, field_name: typing.Literal["key", b"key", "value", b"value"]) -> None: ... - @typing.final - class MetadataEntry(google.protobuf.message.Message): - DESCRIPTOR: google.protobuf.descriptor.Descriptor - - KEY_FIELD_NUMBER: builtins.int - VALUE_FIELD_NUMBER: builtins.int - key: builtins.str - value: builtins.str - def __init__( - self, - *, - key: builtins.str = ..., - value: builtins.str = ..., - ) -> None: ... - def ClearField(self, field_name: typing.Literal["key", b"key", "value", b"value"]) -> None: ... - @typing.final class CloudEventAttributeValue(google.protobuf.message.Message): """* @@ -88,62 +77,15 @@ class CloudEvent(google.protobuf.message.Message): ce_uri_ref: builtins.str = ..., ce_timestamp: google.protobuf.timestamp_pb2.Timestamp | None = ..., ) -> None: ... - def HasField( - self, - field_name: typing.Literal[ - "attr", - b"attr", - "ce_boolean", - b"ce_boolean", - "ce_bytes", - b"ce_bytes", - "ce_integer", - b"ce_integer", - "ce_string", - b"ce_string", - "ce_timestamp", - b"ce_timestamp", - "ce_uri", - b"ce_uri", - "ce_uri_ref", - b"ce_uri_ref", - ], - ) -> builtins.bool: ... - def ClearField( - self, - field_name: typing.Literal[ - "attr", - b"attr", - "ce_boolean", - b"ce_boolean", - "ce_bytes", - b"ce_bytes", - "ce_integer", - b"ce_integer", - "ce_string", - b"ce_string", - "ce_timestamp", - b"ce_timestamp", - "ce_uri", - b"ce_uri", - "ce_uri_ref", - b"ce_uri_ref", - ], - ) -> None: ... - def WhichOneof( - self, oneof_group: typing.Literal["attr", b"attr"] - ) -> ( - typing.Literal["ce_boolean", "ce_integer", "ce_string", "ce_bytes", "ce_uri", "ce_uri_ref", "ce_timestamp"] - | None - ): ... + def HasField(self, field_name: typing.Literal["attr", b"attr", "ce_boolean", b"ce_boolean", "ce_bytes", b"ce_bytes", "ce_integer", b"ce_integer", "ce_string", b"ce_string", "ce_timestamp", b"ce_timestamp", "ce_uri", b"ce_uri", "ce_uri_ref", b"ce_uri_ref"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["attr", b"attr", "ce_boolean", b"ce_boolean", "ce_bytes", b"ce_bytes", "ce_integer", b"ce_integer", "ce_string", b"ce_string", "ce_timestamp", b"ce_timestamp", "ce_uri", b"ce_uri", "ce_uri_ref", b"ce_uri_ref"]) -> None: ... + def WhichOneof(self, oneof_group: typing.Literal["attr", b"attr"]) -> typing.Literal["ce_boolean", "ce_integer", "ce_string", "ce_bytes", "ce_uri", "ce_uri_ref", "ce_timestamp"] | None: ... ID_FIELD_NUMBER: builtins.int SOURCE_FIELD_NUMBER: builtins.int SPEC_VERSION_FIELD_NUMBER: builtins.int TYPE_FIELD_NUMBER: builtins.int ATTRIBUTES_FIELD_NUMBER: builtins.int - METADATA_FIELD_NUMBER: builtins.int - DATACONTENTTYPE_FIELD_NUMBER: builtins.int BINARY_DATA_FIELD_NUMBER: builtins.int TEXT_DATA_FIELD_NUMBER: builtins.int PROTO_DATA_FIELD_NUMBER: builtins.int @@ -156,18 +98,12 @@ class CloudEvent(google.protobuf.message.Message): """URI-reference""" spec_version: builtins.str type: builtins.str - datacontenttype: builtins.str - """MIME type""" binary_data: builtins.bytes text_data: builtins.str @property - def attributes( - self, - ) -> google.protobuf.internal.containers.MessageMap[builtins.str, global___CloudEvent.CloudEventAttributeValue]: + def attributes(self) -> google.protobuf.internal.containers.MessageMap[builtins.str, global___CloudEvent.CloudEventAttributeValue]: """Optional & Extension Attributes""" - @property - def metadata(self) -> google.protobuf.internal.containers.ScalarMap[builtins.str, builtins.str]: ... @property def proto_data(self) -> google.protobuf.any_pb2.Any: ... def __init__( @@ -178,47 +114,12 @@ class CloudEvent(google.protobuf.message.Message): spec_version: builtins.str = ..., type: builtins.str = ..., attributes: collections.abc.Mapping[builtins.str, global___CloudEvent.CloudEventAttributeValue] | None = ..., - metadata: collections.abc.Mapping[builtins.str, builtins.str] | None = ..., - datacontenttype: builtins.str = ..., binary_data: builtins.bytes = ..., text_data: builtins.str = ..., proto_data: google.protobuf.any_pb2.Any | None = ..., ) -> None: ... - def HasField( - self, - field_name: typing.Literal[ - "binary_data", b"binary_data", "data", b"data", "proto_data", b"proto_data", "text_data", b"text_data" - ], - ) -> builtins.bool: ... - def ClearField( - self, - field_name: typing.Literal[ - "attributes", - b"attributes", - "binary_data", - b"binary_data", - "data", - b"data", - "datacontenttype", - b"datacontenttype", - "id", - b"id", - "metadata", - b"metadata", - "proto_data", - b"proto_data", - "source", - b"source", - "spec_version", - b"spec_version", - "text_data", - b"text_data", - "type", - b"type", - ], - ) -> None: ... - def WhichOneof( - self, oneof_group: typing.Literal["data", b"data"] - ) -> typing.Literal["binary_data", "text_data", "proto_data"] | None: ... + def HasField(self, field_name: typing.Literal["binary_data", b"binary_data", "data", b"data", "proto_data", b"proto_data", "text_data", b"text_data"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["attributes", b"attributes", "binary_data", b"binary_data", "data", b"data", "id", b"id", "proto_data", b"proto_data", "source", b"source", "spec_version", b"spec_version", "text_data", b"text_data", "type", b"type"]) -> None: ... + def WhichOneof(self, oneof_group: typing.Literal["data", b"data"]) -> typing.Literal["binary_data", "text_data", "proto_data"] | None: ... global___CloudEvent = CloudEvent diff --git a/python/packages/autogen-ext/src/autogen_ext/runtimes/grpc/protos/cloudevent_pb2_grpc.py b/python/packages/autogen-ext/src/autogen_ext/runtimes/grpc/protos/cloudevent_pb2_grpc.py index bf947056a2f4..2daafffebfc8 100644 --- a/python/packages/autogen-ext/src/autogen_ext/runtimes/grpc/protos/cloudevent_pb2_grpc.py +++ b/python/packages/autogen-ext/src/autogen_ext/runtimes/grpc/protos/cloudevent_pb2_grpc.py @@ -1,4 +1,4 @@ # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! """Client and server classes corresponding to protobuf-defined services.""" - import grpc + diff --git a/python/packages/autogen-ext/src/autogen_ext/runtimes/grpc/protos/cloudevent_pb2_grpc.pyi b/python/packages/autogen-ext/src/autogen_ext/runtimes/grpc/protos/cloudevent_pb2_grpc.pyi index cb7968e33de9..0f50cd8853e1 100644 --- a/python/packages/autogen-ext/src/autogen_ext/runtimes/grpc/protos/cloudevent_pb2_grpc.pyi +++ b/python/packages/autogen-ext/src/autogen_ext/runtimes/grpc/protos/cloudevent_pb2_grpc.pyi @@ -1,17 +1,23 @@ """ @generated by mypy-protobuf. Do not edit manually! isort:skip_file +* +CloudEvent Protobuf Format + +- Required context attributes are explicitly represented. +- Optional and Extension context attributes are carried in a map structure. +- Data may be represented as binary, text, or protobuf messages. """ import abc import collections.abc -import typing - import grpc import grpc.aio +import typing _T = typing.TypeVar("_T") class _MaybeAsyncIterator(collections.abc.AsyncIterator[_T], collections.abc.Iterator[_T], metaclass=abc.ABCMeta): ... + class _ServicerContext(grpc.ServicerContext, grpc.aio.ServicerContext): # type: ignore[misc, type-arg] ... diff --git a/python/packages/autogen-ext/tests/protos/serialization_test_pb2_grpc.pyi b/python/packages/autogen-ext/tests/protos/serialization_test_pb2_grpc.pyi index a6a9cff9dfd4..0f50cd8853e1 100644 --- a/python/packages/autogen-ext/tests/protos/serialization_test_pb2_grpc.pyi +++ b/python/packages/autogen-ext/tests/protos/serialization_test_pb2_grpc.pyi @@ -1,6 +1,12 @@ """ @generated by mypy-protobuf. Do not edit manually! isort:skip_file +* +CloudEvent Protobuf Format + +- Required context attributes are explicitly represented. +- Optional and Extension context attributes are carried in a map structure. +- Data may be represented as binary, text, or protobuf messages. """ import abc