From ec923b47c47b11bcfa0f63dc2428548c165c7018 Mon Sep 17 00:00:00 2001 From: Ryan Sweet Date: Sat, 16 Nov 2024 14:18:59 -0800 Subject: [PATCH] format --- .../autogen-core/samples/xlang/user_input.py | 1 + .../autogen_core/application/_worker_runtime.py | 15 +++++++-------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/python/packages/autogen-core/samples/xlang/user_input.py b/python/packages/autogen-core/samples/xlang/user_input.py index 0c947b172c61..5e717f6548e2 100644 --- a/python/packages/autogen-core/samples/xlang/user_input.py +++ b/python/packages/autogen-core/samples/xlang/user_input.py @@ -9,6 +9,7 @@ input_types = Union[ConversationClosed, Input, Output] + class UserProxy(RoutedAgent): """An agent that allows the user to play the role of an agent in the conversation via input.""" diff --git a/python/packages/autogen-core/src/autogen_core/application/_worker_runtime.py b/python/packages/autogen-core/src/autogen_core/application/_worker_runtime.py index f327d22fd7cc..10b3268cef19 100644 --- a/python/packages/autogen-core/src/autogen_core/application/_worker_runtime.py +++ b/python/packages/autogen-core/src/autogen_core/application/_worker_runtime.py @@ -28,6 +28,7 @@ ) import grpc +from google.protobuf import any_pb2 from grpc.aio import StreamStreamCall from opentelemetry.trace import TracerProvider from typing_extensions import Self, deprecated @@ -35,7 +36,6 @@ from autogen_core.base import JSON_DATA_CONTENT_TYPE from autogen_core.base._serialization import MessageSerializer, SerializationRegistry from autogen_core.base._type_helpers import ChannelArgumentType -from google.protobuf import any_pb2 from ..base import ( Agent, @@ -53,7 +53,11 @@ ) from ..components import TypeSubscription from ._helpers import SubscriptionManager, get_impl -from .protos import agent_worker_pb2, agent_worker_pb2_grpc, cloudevent_pb2, cloudevent_pb2_grpc, agent_events_pb2, agent_events_pb2_grpc +from .protos import ( + agent_worker_pb2, + agent_worker_pb2_grpc, + cloudevent_pb2, +) from .telemetry import MessageRuntimeTracingConfig, TraceHelper, get_telemetry_grpc_metadata if TYPE_CHECKING: @@ -381,14 +385,9 @@ async def publish_message( with self._trace_helper.trace_block( "create", topic_id, parent=None, extraAttributes={"message_type": message_type} ): - serialized_message = self._serialization_registry.serialize( - message, type_name=message_type, data_content_type=JSON_DATA_CONTENT_TYPE - ) telemetry_metadata = get_telemetry_grpc_metadata() proto_data = any_pb2.Any() - proto_data.Pack( - msg=message - ) + proto_data.Pack(msg=message) if sender is not None: source = str(AgentId(type=sender.type, key=sender.key)) else: