Skip to content

A programming framework for agentic AI

Remove channel based control plane APIs, cleanup proto (#5236)

Jack Gerrits7445e4b276c2
diff --git a/protos/agent_worker.proto b/protos/agent_worker.proto
index 0cf1581af..07375fe97 100644
--- a/protos/agent_worker.proto
+++ b/protos/agent_worker.proto
@@ -2,15 +2,11 @@ syntax = "proto3";
package agents;
-option csharp_namespace = "Microsoft.AutoGen.Contracts";
+option csharp_namespace = "Microsoft.AutoGen.Protobuf";
import "cloudevent.proto";
import "google/protobuf/any.proto";
-message TopicId {
- string type = 1;
- string source = 2;
-}
message AgentId {
string type = 1;
@@ -39,23 +35,11 @@ message RpcResponse {
map<string, string> metadata = 4;
}
-message Event {
- string topic_type = 1;
- string topic_source = 2;
- optional AgentId source = 3;
- Payload payload = 4;
- map<string, string> metadata = 5;
-}
-
message RegisterAgentTypeRequest {
- string request_id = 1; // TODO: remove once message based requests are removed
- string type = 2;
+ string type = 1;
}
message RegisterAgentTypeResponse {
- string request_id = 1; // TODO: remove once message based requests are removed
- bool success = 2;
- optional string error = 3;
}
message TypeSubscription {
@@ -77,14 +61,10 @@ message Subscription {
}
message AddSubscriptionRequest {
- string request_id = 1; // TODO: remove once message based requests are removed
- Subscription subscription = 2;
+ Subscription subscription = 1;
}
message AddSubscriptionResponse {
- string request_id = 1; // TODO: remove once message based requests are removed
- bool success = 2;
- optional string error = 3;
}
message RemoveSubscriptionRequest {
@@ -92,8 +72,6 @@ message RemoveSubscriptionRequest {
}
message RemoveSubscriptionResponse {
- bool success = 1;
- optional string error = 2;
}
message GetSubscriptionsRequest {}
@@ -101,16 +79,6 @@ message GetSubscriptionsResponse {
repeated Subscription subscriptions = 1;
}
-service AgentRpc {
- rpc OpenChannel (stream Message) returns (stream Message);
- rpc GetState(AgentId) returns (GetStateResponse);
- rpc SaveState(AgentState) returns (SaveStateResponse);
- rpc RegisterAgent(RegisterAgentTypeRequest) returns (RegisterAgentTypeResponse);
- rpc AddSubscription(AddSubscriptionRequest) returns (AddSubscriptionResponse);
- rpc RemoveSubscription(RemoveSubscriptionRequest) returns (RemoveSubscriptionResponse);
- rpc GetSubscriptions(GetSubscriptionsRequest) returns (GetSubscriptionsResponse);
-}
-
message AgentState {
AgentId agent_id = 1;
string eTag = 2;
@@ -123,13 +91,9 @@ message AgentState {
message GetStateResponse {
AgentState agent_state = 1;
- bool success = 2;
- optional string error = 3;
}
message SaveStateResponse {
- bool success = 1;
- optional string error = 2;
}
message Message {
@@ -137,10 +101,15 @@ message Message {
RpcRequest request = 1;
RpcResponse response = 2;
io.cloudevents.v1.CloudEvent cloudEvent = 3;
- RegisterAgentTypeRequest registerAgentTypeRequest = 4;
- RegisterAgentTypeResponse registerAgentTypeResponse = 5;
- AddSubscriptionRequest addSubscriptionRequest = 6;
- AddSubscriptionResponse addSubscriptionResponse = 7;
}
}
+service AgentRpc {
+ rpc OpenChannel (stream Message) returns (stream Message);
+ rpc GetState(AgentId) returns (GetStateResponse);
+ rpc SaveState(AgentState) returns (SaveStateResponse);
+ rpc RegisterAgent(RegisterAgentTypeRequest) returns (RegisterAgentTypeResponse);
+ rpc AddSubscription(AddSubscriptionRequest) returns (AddSubscriptionResponse);
+ rpc RemoveSubscription(RemoveSubscriptionRequest) returns (RemoveSubscriptionResponse);
+ rpc GetSubscriptions(GetSubscriptionsRequest) returns (GetSubscriptionsResponse);
+}
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 ee41a1f58..4a87793ff 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
@@ -275,8 +275,6 @@ class GrpcWorkerAgentRuntime(AgentRuntime):
message = await self._host_connection.recv()
oneofcase = agent_worker_pb2.Message.WhichOneof(message, "message")
match oneofcase:
- case "registerAgentTypeRequest" | "addSubscriptionRequest":
- logger.warning(f"Cant handle {oneofcase}, skipping.")
case "request":
task = asyncio.create_task(self._process_request(message.request))
self._background_tasks.add(task)
@@ -292,20 +290,6 @@ class GrpcWorkerAgentRuntime(AgentRuntime):
self._background_tasks.add(task)
task.add_done_callback(self._raise_on_exception)
task.add_done_callback(self._background_tasks.discard)
- case "registerAgentTypeResponse":
- task = asyncio.create_task(
- self._process_register_agent_type_response(message.registerAgentTypeResponse)
- )
- self._background_tasks.add(task)
- task.add_done_callback(self._raise_on_exception)
- task.add_done_callback(self._background_tasks.discard)
- case "addSubscriptionResponse":
- task = asyncio.create_task(
- self._process_add_subscription_response(message.addSubscriptionResponse)
- )
- self._background_tasks.add(task)
- task.add_done_callback(self._raise_on_exception)
- task.add_done_callback(self._background_tasks.discard)
case None:
logger.warning("No message")
except Exception as e:
@@ -737,28 +721,13 @@ class GrpcWorkerAgentRuntime(AgentRuntime):
self._agent_factories[type.type] = factory_wrapper
- # Create a future for the registration response.
- future = asyncio.get_event_loop().create_future()
- request_id = await self._get_new_request_id()
- self._pending_requests[request_id] = future
-
# Send the registration request message to the host.
- message = agent_worker_pb2.RegisterAgentTypeRequest(request_id=request_id, type=type.type)
- response: agent_worker_pb2.RegisterAgentTypeResponse = await self._host_connection.stub.RegisterAgent(
+ message = agent_worker_pb2.RegisterAgentTypeRequest(type=type.type)
+ _response: agent_worker_pb2.RegisterAgentTypeResponse = await self._host_connection.stub.RegisterAgent(
message, metadata=self._host_connection.metadata
)
- # TODO: just use grpc error handling
- if not response.success:
- raise RuntimeError(response.error)
return type
- async def _process_register_agent_type_response(self, response: agent_worker_pb2.RegisterAgentTypeResponse) -> None:
- future = self._pending_requests.pop(response.request_id)
- if response.HasField("error") and response.error != "":
- future.set_exception(RuntimeError(response.error))
- else:
- future.set_result(None)
-
async def _invoke_agent_factory(
self,
agent_factory: Callable[[], T | Awaitable[T]] | Callable[[AgentRuntime, AgentId], T | Awaitable[T]],
@@ -812,28 +781,14 @@ class GrpcWorkerAgentRuntime(AgentRuntime):
if self._host_connection is None:
raise RuntimeError("Host connection is not set.")
- # Create a future for the subscription response.
- request_id = await self._get_new_request_id()
-
- message = agent_worker_pb2.AddSubscriptionRequest(
- request_id=request_id, subscription=subscription_to_proto(subscription)
- )
- response: agent_worker_pb2.AddSubscriptionResponse = await self._host_connection.stub.AddSubscription(
+ message = agent_worker_pb2.AddSubscriptionRequest(subscription=subscription_to_proto(subscription))
+ _response: agent_worker_pb2.AddSubscriptionResponse = await self._host_connection.stub.AddSubscription(
message, metadata=self._host_connection.metadata
)
- if not response.success:
- raise RuntimeError(response.error)
# Add to local subscription manager.
await self._subscription_manager.add_subscription(subscription)
- async def _process_add_subscription_response(self, response: agent_worker_pb2.AddSubscriptionResponse) -> None:
- future = self._pending_requests.pop(response.request_id)
- if response.HasField("error") and response.error != "":
- future.set_exception(RuntimeError(response.error))
- else:
- future.set_result(None)
-
async def remove_subscription(self, id: str) -> None:
raise NotImplementedError("Subscriptions cannot be removed while using distributed runtime currently.")
diff --git a/python/packages/autogen-ext/src/autogen_ext/runtimes/grpc/_worker_runtime_host_servicer.py b/python/packages/autogen-ext/src/autogen_ext/runtimes/grpc/_worker_runtime_host_servicer.py
index e5c7d53df..74c1ef3b3 100644
--- a/python/packages/autogen-ext/src/autogen_ext/runtimes/grpc/_worker_runtime_host_servicer.py
+++ b/python/packages/autogen-ext/src/autogen_ext/runtimes/grpc/_worker_runtime_host_servicer.py
@@ -130,22 +130,6 @@ class GrpcWorkerAgentRuntimeHostServicer(agent_worker_pb2_grpc.AgentRpcServicer)
self._background_tasks.add(task)
task.add_done_callback(self._raise_on_exception)
task.add_done_callback(self._background_tasks.discard)
- case "registerAgentTypeRequest":
- register_agent_type: agent_worker_pb2.RegisterAgentTypeRequest = message.registerAgentTypeRequest
- task = asyncio.create_task(
- self._process_register_agent_type_request(register_agent_type, client_id)
- )
- self._background_tasks.add(task)
- task.add_done_callback(self._raise_on_exception)
- task.add_done_callback(self._background_tasks.discard)
- case "addSubscriptionRequest":
- add_subscription: agent_worker_pb2.AddSubscriptionRequest = message.addSubscriptionRequest
- task = asyncio.create_task(self._process_add_subscription_request(add_subscription, client_id))
- self._background_tasks.add(task)
- task.add_done_callback(self._raise_on_exception)
- task.add_done_callback(self._background_tasks.discard)
- case "registerAgentTypeResponse" | "addSubscriptionResponse":
- logger.warning(f"Received unexpected message type: {oneofcase}")
case None:
logger.warning("Received empty message")
@@ -204,53 +188,6 @@ class GrpcWorkerAgentRuntimeHostServicer(agent_worker_pb2_grpc.AgentRpcServicer)
for client_id in client_ids:
await self._send_queues[client_id].put(agent_worker_pb2.Message(cloudEvent=event))
- async def _process_register_agent_type_request(
- self, register_agent_type_req: agent_worker_pb2.RegisterAgentTypeRequest, client_id: ClientConnectionId
- ) -> None:
- # Register the agent type with the host runtime.
- async with self._agent_type_to_client_id_lock:
- if register_agent_type_req.type in self._agent_type_to_client_id:
- existing_client_id = self._agent_type_to_client_id[register_agent_type_req.type]
- logger.error(
- f"Agent type {register_agent_type_req.type} already registered with client {existing_client_id}."
- )
- success = False
- error = f"Agent type {register_agent_type_req.type} already registered."
- else:
- self._agent_type_to_client_id[register_agent_type_req.type] = client_id
- success = True
- error = None
- # Send a response back to the client.
- await self._send_queues[client_id].put(
- agent_worker_pb2.Message(
- registerAgentTypeResponse=agent_worker_pb2.RegisterAgentTypeResponse(
- request_id=register_agent_type_req.request_id, success=success, error=error
- )
- )
- )
-
- async def _process_add_subscription_request(
- self, add_subscription_req: agent_worker_pb2.AddSubscriptionRequest, client_id: ClientConnectionId
- ) -> None:
- subscription = subscription_from_proto(add_subscription_req.subscription)
- try:
- await self._subscription_manager.add_subscription(subscription)
- subscription_ids = self._client_id_to_subscription_id_mapping.setdefault(client_id, set())
- subscription_ids.add(subscription.id)
- success = True
- error = None
- except ValueError as e:
- success = False
- error = str(e)
- # Send a response back to the client.
- await self._send_queues[client_id].put(
- agent_worker_pb2.Message(
- addSubscriptionResponse=agent_worker_pb2.AddSubscriptionResponse(
- request_id=add_subscription_req.request_id, success=success, error=error
- )
- )
- )
-
async def RegisterAgent( # type: ignore
self,
request: agent_worker_pb2.RegisterAgentTypeRequest,
@@ -263,14 +200,14 @@ class GrpcWorkerAgentRuntimeHostServicer(agent_worker_pb2_grpc.AgentRpcServicer)
async with self._agent_type_to_client_id_lock:
if request.type in self._agent_type_to_client_id:
existing_client_id = self._agent_type_to_client_id[request.type]
- logger.error(f"Agent type {request.type} already registered with client {existing_client_id}.")
- success = False
- error = f"Agent type {request.type} already registered."
+ await context.abort(
+ grpc.StatusCode.INVALID_ARGUMENT,
+ f"Agent type {request.type} already registered with client {existing_client_id}.",
+ )
else:
self._agent_type_to_client_id[request.type] = client_id
- success = True
- error = None
- return agent_worker_pb2.RegisterAgentTypeResponse(request_id=request.request_id, success=success, error=error)
+
+ return agent_worker_pb2.RegisterAgentTypeResponse()
async def AddSubscription( # type: ignore
self,
@@ -286,13 +223,9 @@ class GrpcWorkerAgentRuntimeHostServicer(agent_worker_pb2_grpc.AgentRpcServicer)
await self._subscription_manager.add_subscription(subscription)
subscription_ids = self._client_id_to_subscription_id_mapping.setdefault(client_id, set())
subscription_ids.add(subscription.id)
- success = True
- error = None
except ValueError as e:
- success = False
- error = str(e)
- # Send a response back to the client.
- return agent_worker_pb2.AddSubscriptionResponse(request_id=request.request_id, success=success, error=error)
+ await context.abort(grpc.StatusCode.INVALID_ARGUMENT, str(e))
+ return agent_worker_pb2.AddSubscriptionResponse()
async def RemoveSubscription( # type: ignore
self,
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 37faa08a9..b62c1073f 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
@@ -16,68 +16,60 @@ from . 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\"\xa2\x01\n\x0cSubscription\x12\n\n\x02id\x18\x01 \x01(\t\x12\x34\n\x10typeSubscription\x18\x02 \x01(\x0b\x32\x18.agents.TypeSubscriptionH\x00\x12@\n\x16typePrefixSubscription\x18\x03 \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\"\'\n\x19RemoveSubscriptionRequest\x12\n\n\x02id\x18\x01 \x01(\t\"K\n\x1aRemoveSubscriptionResponse\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\"\x19\n\x17GetSubscriptionsRequest\"G\n\x18GetSubscriptionsResponse\x12+\n\rsubscriptions\x18\x01 \x03(\x0b\x32\x14.agents.Subscription\"\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\x90\x04\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.SaveStateResponse\x12T\n\rRegisterAgent\x12 .agents.RegisterAgentTypeRequest\x1a!.agents.RegisterAgentTypeResponse\x12R\n\x0f\x41\x64\x64Subscription\x12\x1e.agents.AddSubscriptionRequest\x1a\x1f.agents.AddSubscriptionResponse\x12[\n\x12RemoveSubscription\x12!.agents.RemoveSubscriptionRequest\x1a\".agents.RemoveSubscriptionResponse\x12U\n\x10GetSubscriptions\x12\x1f.agents.GetSubscriptionsRequest\x1a .agents.GetSubscriptionsResponseB\x1e\xaa\x02\x1bMicrosoft.AutoGen.Contractsb\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\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\"(\n\x18RegisterAgentTypeRequest\x12\x0c\n\x04type\x18\x01 \x01(\t\"\x1b\n\x19RegisterAgentTypeResponse\":\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\"\xa2\x01\n\x0cSubscription\x12\n\n\x02id\x18\x01 \x01(\t\x12\x34\n\x10typeSubscription\x18\x02 \x01(\x0b\x32\x18.agents.TypeSubscriptionH\x00\x12@\n\x16typePrefixSubscription\x18\x03 \x01(\x0b\x32\x1e.agents.TypePrefixSubscriptionH\x00\x42\x0e\n\x0csubscription\"D\n\x16\x41\x64\x64SubscriptionRequest\x12*\n\x0csubscription\x18\x01 \x01(\x0b\x32\x14.agents.Subscription\"\x19\n\x17\x41\x64\x64SubscriptionResponse\"\'\n\x19RemoveSubscriptionRequest\x12\n\n\x02id\x18\x01 \x01(\t\"\x1c\n\x1aRemoveSubscriptionResponse\"\x19\n\x17GetSubscriptionsRequest\"G\n\x18GetSubscriptionsResponse\x12+\n\rsubscriptions\x18\x01 \x03(\x0b\x32\x14.agents.Subscription\"\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\";\n\x10GetStateResponse\x12\'\n\x0b\x61gent_state\x18\x01 \x01(\x0b\x32\x12.agents.AgentState\"\x13\n\x11SaveStateResponse\"\x99\x01\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\x42\t\n\x07message2\x90\x04\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.SaveStateResponse\x12T\n\rRegisterAgent\x12 .agents.RegisterAgentTypeRequest\x1a!.agents.RegisterAgentTypeResponse\x12R\n\x0f\x41\x64\x64Subscription\x12\x1e.agents.AddSubscriptionRequest\x1a\x1f.agents.AddSubscriptionResponse\x12[\n\x12RemoveSubscription\x12!.agents.RemoveSubscriptionRequest\x1a\".agents.RemoveSubscriptionResponse\x12U\n\x10GetSubscriptions\x12\x1f.agents.GetSubscriptionsRequest\x1a .agents.GetSubscriptionsResponseB\x1d\xaa\x02\x1aMicrosoft.AutoGen.Protobufb\x06proto3')
_globals = globals()
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _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\033Microsoft.AutoGen.Contracts'
+ _globals['DESCRIPTOR']._serialized_options = b'\252\002\032Microsoft.AutoGen.Protobuf'
_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=1365
- _globals['_ADDSUBSCRIPTIONREQUEST']._serialized_start=1367
- _globals['_ADDSUBSCRIPTIONREQUEST']._serialized_end=1455
- _globals['_ADDSUBSCRIPTIONRESPONSE']._serialized_start=1457
- _globals['_ADDSUBSCRIPTIONRESPONSE']._serialized_end=1549
- _globals['_REMOVESUBSCRIPTIONREQUEST']._serialized_start=1551
- _globals['_REMOVESUBSCRIPTIONREQUEST']._serialized_end=1590
- _globals['_REMOVESUBSCRIPTIONRESPONSE']._serialized_start=1592
- _globals['_REMOVESUBSCRIPTIONRESPONSE']._serialized_end=1667
- _globals['_GETSUBSCRIPTIONSREQUEST']._serialized_start=1669
- _globals['_GETSUBSCRIPTIONSREQUEST']._serialized_end=1694
- _globals['_GETSUBSCRIPTIONSRESPONSE']._serialized_start=1696
- _globals['_GETSUBSCRIPTIONSRESPONSE']._serialized_end=1767
- _globals['_AGENTSTATE']._serialized_start=1770
- _globals['_AGENTSTATE']._serialized_end=1927
- _globals['_GETSTATERESPONSE']._serialized_start=1929
- _globals['_GETSTATERESPONSE']._serialized_end=2035
- _globals['_SAVESTATERESPONSE']._serialized_start=2037
- _globals['_SAVESTATERESPONSE']._serialized_end=2103
- _globals['_MESSAGE']._serialized_start=2106
- _globals['_MESSAGE']._serialized_end=2535
- _globals['_AGENTRPC']._serialized_start=2538
- _globals['_AGENTRPC']._serialized_end=3066
+ _globals['_AGENTID']._serialized_start=75
+ _globals['_AGENTID']._serialized_end=111
+ _globals['_PAYLOAD']._serialized_start=113
+ _globals['_PAYLOAD']._serialized_end=182
+ _globals['_RPCREQUEST']._serialized_start=185
+ _globals['_RPCREQUEST']._serialized_end=450
+ _globals['_RPCREQUEST_METADATAENTRY']._serialized_start=392
+ _globals['_RPCREQUEST_METADATAENTRY']._serialized_end=439
+ _globals['_RPCRESPONSE']._serialized_start=453
+ _globals['_RPCRESPONSE']._serialized_end=637
+ _globals['_RPCRESPONSE_METADATAENTRY']._serialized_start=392
+ _globals['_RPCRESPONSE_METADATAENTRY']._serialized_end=439
+ _globals['_REGISTERAGENTTYPEREQUEST']._serialized_start=639
+ _globals['_REGISTERAGENTTYPEREQUEST']._serialized_end=679
+ _globals['_REGISTERAGENTTYPERESPONSE']._serialized_start=681
+ _globals['_REGISTERAGENTTYPERESPONSE']._serialized_end=708
+ _globals['_TYPESUBSCRIPTION']._serialized_start=710
+ _globals['_TYPESUBSCRIPTION']._serialized_end=768
+ _globals['_TYPEPREFIXSUBSCRIPTION']._serialized_start=770
+ _globals['_TYPEPREFIXSUBSCRIPTION']._serialized_end=841
+ _globals['_SUBSCRIPTION']._serialized_start=844
+ _globals['_SUBSCRIPTION']._serialized_end=1006
+ _globals['_ADDSUBSCRIPTIONREQUEST']._serialized_start=1008
+ _globals['_ADDSUBSCRIPTIONREQUEST']._serialized_end=1076
+ _globals['_ADDSUBSCRIPTIONRESPONSE']._serialized_start=1078
+ _globals['_ADDSUBSCRIPTIONRESPONSE']._serialized_end=1103
+ _globals['_REMOVESUBSCRIPTIONREQUEST']._serialized_start=1105
+ _globals['_REMOVESUBSCRIPTIONREQUEST']._serialized_end=1144
+ _globals['_REMOVESUBSCRIPTIONRESPONSE']._serialized_start=1146
+ _globals['_REMOVESUBSCRIPTIONRESPONSE']._serialized_end=1174
+ _globals['_GETSUBSCRIPTIONSREQUEST']._serialized_start=1176
+ _globals['_GETSUBSCRIPTIONSREQUEST']._serialized_end=1201
+ _globals['_GETSUBSCRIPTIONSRESPONSE']._serialized_start=1203
+ _globals['_GETSUBSCRIPTIONSRESPONSE']._serialized_end=1274
+ _globals['_AGENTSTATE']._serialized_start=1277
+ _globals['_AGENTSTATE']._serialized_end=1434
+ _globals['_GETSTATERESPONSE']._serialized_start=1436
+ _globals['_GETSTATERESPONSE']._serialized_end=1495
+ _globals['_SAVESTATERESPONSE']._serialized_start=1497
+ _globals['_SAVESTATERESPONSE']._serialized_end=1516
+ _globals['_MESSAGE']._serialized_start=1519
+ _globals['_MESSAGE']._serialized_end=1672
+ _globals['_AGENTRPC']._serialized_start=1675
+ _globals['_AGENTRPC']._serialized_end=2203
# @@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 91625ff79..b37fb5ac2 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
@@ -14,24 +14,6 @@ import typing
DESCRIPTOR: google.protobuf.descriptor.FileDescriptor
-class TopicId(google.protobuf.message.Message):
- DESCRIPTOR: google.protobuf.descriptor.Descriptor
-
- TYPE_FIELD_NUMBER: builtins.int
- SOURCE_FIELD_NUMBER: builtins.int
- type: builtins.str
- source: builtins.str
- def __init__(
- self,
- *,
- type: builtins.str = ...,
- source: builtins.str = ...,
- ) -> None: ...
- def ClearField(self, field_name: typing.Literal["source", b"source", "type", b"type"]) -> None: ...
-
-global___TopicId = TopicId
-
@typing.final
class AgentId(google.protobuf.message.Message):
DESCRIPTOR: google.protobuf.descriptor.Descriptor
@@ -166,70 +148,18 @@ class RpcResponse(google.protobuf.message.Message):
global___RpcResponse = RpcResponse
-class Event(google.protobuf.message.Message):
- DESCRIPTOR: google.protobuf.descriptor.Descriptor
-
- @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: ...
-
- TOPIC_TYPE_FIELD_NUMBER: builtins.int
- TOPIC_SOURCE_FIELD_NUMBER: builtins.int
- SOURCE_FIELD_NUMBER: builtins.int
- PAYLOAD_FIELD_NUMBER: builtins.int
- METADATA_FIELD_NUMBER: builtins.int
- topic_type: builtins.str
- topic_source: builtins.str
- @property
- def source(self) -> global___AgentId: ...
- @property
- def payload(self) -> global___Payload: ...
- @property
- def metadata(self) -> google.protobuf.internal.containers.ScalarMap[builtins.str, builtins.str]: ...
- def __init__(
- self,
- *,
- topic_type: builtins.str = ...,
- topic_source: builtins.str = ...,
- source: global___AgentId | None = ...,
- 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 WhichOneof(self, oneof_group: typing.Literal["_source", b"_source"]) -> typing.Literal["source"] | None: ...
-
-global___Event = Event
-
@typing.final
class RegisterAgentTypeRequest(google.protobuf.message.Message):
DESCRIPTOR: google.protobuf.descriptor.Descriptor
- REQUEST_ID_FIELD_NUMBER: builtins.int
TYPE_FIELD_NUMBER: builtins.int
- request_id: builtins.str
- """TODO: remove once message based requests are removed"""
type: builtins.str
def __init__(
self,
*,
- request_id: builtins.str = ...,
type: builtins.str = ...,
) -> None: ...
- def ClearField(self, field_name: typing.Literal["request_id", b"request_id", "type", b"type"]) -> None: ...
+ def ClearField(self, field_name: typing.Literal["type", b"type"]) -> None: ...
global___RegisterAgentTypeRequest = RegisterAgentTypeRequest
@@ -237,23 +167,9 @@ global___RegisterAgentTypeRequest = RegisterAgentTypeRequest
class RegisterAgentTypeResponse(google.protobuf.message.Message):
DESCRIPTOR: google.protobuf.descriptor.Descriptor
- REQUEST_ID_FIELD_NUMBER: builtins.int
- SUCCESS_FIELD_NUMBER: builtins.int
- ERROR_FIELD_NUMBER: builtins.int
- request_id: builtins.str
- """TODO: remove once message based requests are removed"""
- success: builtins.bool
- error: builtins.str
def __init__(
self,
- *,
- request_id: builtins.str = ...,
- success: builtins.bool = ...,
- 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 WhichOneof(self, oneof_group: typing.Literal["_error", b"_error"]) -> typing.Literal["error"] | None: ...
global___RegisterAgentTypeResponse = RegisterAgentTypeResponse
@@ -322,20 +238,16 @@ global___Subscription = Subscription
class AddSubscriptionRequest(google.protobuf.message.Message):
DESCRIPTOR: google.protobuf.descriptor.Descriptor
- REQUEST_ID_FIELD_NUMBER: builtins.int
SUBSCRIPTION_FIELD_NUMBER: builtins.int
- request_id: builtins.str
- """TODO: remove once message based requests are removed"""
@property
def subscription(self) -> global___Subscription: ...
def __init__(
self,
*,
- request_id: builtins.str = ...,
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["subscription", b"subscription"]) -> None: ...
global___AddSubscriptionRequest = AddSubscriptionRequest
@@ -343,23 +255,9 @@ global___AddSubscriptionRequest = AddSubscriptionRequest
class AddSubscriptionResponse(google.protobuf.message.Message):
DESCRIPTOR: google.protobuf.descriptor.Descriptor
- REQUEST_ID_FIELD_NUMBER: builtins.int
- SUCCESS_FIELD_NUMBER: builtins.int
- ERROR_FIELD_NUMBER: builtins.int
- request_id: builtins.str
- """TODO: remove once message based requests are removed"""
- success: builtins.bool
- error: builtins.str
def __init__(
self,
- *,
- request_id: builtins.str = ...,
- success: builtins.bool = ...,
- 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 WhichOneof(self, oneof_group: typing.Literal["_error", b"_error"]) -> typing.Literal["error"] | None: ...
global___AddSubscriptionResponse = AddSubscriptionResponse
@@ -382,19 +280,9 @@ global___RemoveSubscriptionRequest = RemoveSubscriptionRequest
class RemoveSubscriptionResponse(google.protobuf.message.Message):
DESCRIPTOR: google.protobuf.descriptor.Descriptor
- SUCCESS_FIELD_NUMBER: builtins.int
- ERROR_FIELD_NUMBER: builtins.int
- success: builtins.bool
- error: builtins.str
def __init__(
self,
- *,
- success: builtins.bool = ...,
- 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 WhichOneof(self, oneof_group: typing.Literal["_error", b"_error"]) -> typing.Literal["error"] | None: ...
global___RemoveSubscriptionResponse = RemoveSubscriptionResponse
@@ -460,22 +348,15 @@ class GetStateResponse(google.protobuf.message.Message):
DESCRIPTOR: google.protobuf.descriptor.Descriptor
AGENT_STATE_FIELD_NUMBER: builtins.int
- SUCCESS_FIELD_NUMBER: builtins.int
- ERROR_FIELD_NUMBER: builtins.int
- success: builtins.bool
- error: builtins.str
@property
def agent_state(self) -> global___AgentState: ...
def __init__(
self,
*,
agent_state: global___AgentState | None = ...,
- 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 WhichOneof(self, oneof_group: typing.Literal["_error", b"_error"]) -> typing.Literal["error"] | None: ...
+ def HasField(self, field_name: typing.Literal["agent_state", b"agent_state"]) -> builtins.bool: ...
+ def ClearField(self, field_name: typing.Literal["agent_state", b"agent_state"]) -> None: ...
global___GetStateResponse = GetStateResponse
@@ -483,19 +364,9 @@ global___GetStateResponse = GetStateResponse
class SaveStateResponse(google.protobuf.message.Message):
DESCRIPTOR: google.protobuf.descriptor.Descriptor
- SUCCESS_FIELD_NUMBER: builtins.int
- ERROR_FIELD_NUMBER: builtins.int
- success: builtins.bool
- error: builtins.str
def __init__(
self,
- *,
- success: builtins.bool = ...,
- 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 WhichOneof(self, oneof_group: typing.Literal["_error", b"_error"]) -> typing.Literal["error"] | None: ...
global___SaveStateResponse = SaveStateResponse
@@ -506,37 +377,21 @@ class Message(google.protobuf.message.Message):
REQUEST_FIELD_NUMBER: builtins.int
RESPONSE_FIELD_NUMBER: builtins.int
CLOUDEVENT_FIELD_NUMBER: builtins.int
- REGISTERAGENTTYPEREQUEST_FIELD_NUMBER: builtins.int
- REGISTERAGENTTYPERESPONSE_FIELD_NUMBER: builtins.int
- ADDSUBSCRIPTIONREQUEST_FIELD_NUMBER: builtins.int
- ADDSUBSCRIPTIONRESPONSE_FIELD_NUMBER: builtins.int
@property
def request(self) -> global___RpcRequest: ...
@property
def response(self) -> global___RpcResponse: ...
@property
def cloudEvent(self) -> cloudevent_pb2.CloudEvent: ...
- @property
- def registerAgentTypeRequest(self) -> global___RegisterAgentTypeRequest: ...
- @property
- def registerAgentTypeResponse(self) -> global___RegisterAgentTypeResponse: ...
- @property
- def addSubscriptionRequest(self) -> global___AddSubscriptionRequest: ...
- @property
- def addSubscriptionResponse(self) -> global___AddSubscriptionResponse: ...
def __init__(
self,
*,
request: global___RpcRequest | None = ...,
response: global___RpcResponse | None = ...,
cloudEvent: cloudevent_pb2.CloudEvent | None = ...,
- registerAgentTypeRequest: global___RegisterAgentTypeRequest | None = ...,
- registerAgentTypeResponse: global___RegisterAgentTypeResponse | None = ...,
- 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["cloudEvent", b"cloudEvent", "message", b"message", "request", b"request", "response", b"response"]) -> builtins.bool: ...
+ def ClearField(self, field_name: typing.Literal["cloudEvent", b"cloudEvent", "message", b"message", "request", b"request", "response", b"response"]) -> None: ...
+ def WhichOneof(self, oneof_group: typing.Literal["message", b"message"]) -> typing.Literal["request", "response", "cloudEvent"] | None: ...
global___Message = Message
diff --git a/python/packages/autogen-ext/tests/test_worker_runtime.py b/python/packages/autogen-ext/tests/test_worker_runtime.py
index 6375e284d..e7f62f19d 100644
--- a/python/packages/autogen-ext/tests/test_worker_runtime.py
+++ b/python/packages/autogen-ext/tests/test_worker_runtime.py
@@ -67,7 +67,7 @@ async def test_agent_types_must_be_unique_multiple_workers() -> None:
await worker1.register_factory(type=AgentType("name1"), agent_factory=lambda: NoopAgent(), expected_class=NoopAgent)
- with pytest.raises(RuntimeError):
+ with pytest.raises(Exception, match="Agent type name1 already registered"):
await worker2.register_factory(
type=AgentType("name1"), agent_factory=lambda: NoopAgent(), expected_class=NoopAgent
)
@@ -323,7 +323,7 @@ async def test_duplicate_subscription() -> None:
worker1_2.start()
# Note: This passes because worker1 is still running
- with pytest.raises(RuntimeError, match="Agent type worker1 already registered"):
+ with pytest.raises(Exception, match="Agent type worker1 already registered"):
await NoopAgent.register(worker1_2, "worker1", lambda: NoopAgent())
# This is somehow covered in test_disconnected_agent as well as a stop will also disconnect the agent.