You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to reproduce the distributed agent runtime example.
However my program gets stuck on the first WorkerAgent register. I don't see the output as indicated in the example.
What did you expect to happen?
I expected to be able to reproduce the Distributed Agent Runtime example.
How can we reproduce it (as minimally and precisely as possible)?
Here is the exact code I am running:
fromautogen_coreimportTRACE_LOGGER_NAMEimportloggingimportasynciofromautogen_ext.runtimes.grpcimportGrpcWorkerAgentRuntimefromdataclassesimportdataclassfromautogen_coreimportDefaultTopicId, MessageContext, RoutedAgent, default_subscription, message_handler@dataclassclassMyMessage:
content: str@default_subscriptionclassMyAgent(RoutedAgent):
def__init__(self, name: str) ->None:
super().__init__("My agent")
self._name=nameself._counter=0@message_handlerasyncdefmy_message_handler(self, message: MyMessage, ctx: MessageContext) ->None:
self._counter+=1ifself._counter>5:
returncontent=f"{self._name}: Hello x {self._counter}"print(content)
awaitself.publish_message(MyMessage(content=content), DefaultTopicId())
logging.basicConfig(level=logging.INFO)
logger=logging.getLogger(TRACE_LOGGER_NAME)
logger.setLevel(logging.DEBUG)
asyncdefmain():
print("Starting the agents...")
worker1=GrpcWorkerAgentRuntime(host_address="localhost:50051")
worker1.start()
awaitMyAgent.register(worker1, "worker1", lambda: MyAgent("worker1"))
print("Worker 1 started")
worker2=GrpcWorkerAgentRuntime(host_address="localhost:50051")
worker2.start()
awaitMyAgent.register(worker2, "worker2", lambda: MyAgent("worker2"))
print("Worker 2 started")
awaitworker2.publish_message(MyMessage(content="Hello!"), DefaultTopicId())
# Let the agents run for a while.awaitasyncio.sleep(5)
asyncio.run(main())
I don't see the output as indicated in the example. For me, the program gets stuck on the first MyAgent.register. Here are the logs:
Starting the agents...
INFO:autogen_core:Connecting to host: localhost:50051
INFO:autogen_core:Connecting to localhost:50051
INFO:autogen_core:Connection established
INFO:autogen_core:Send message to host: registerAgentTypeRequest {
request_id: "1"
type: "worker1"
}
INFO:autogen_core:Put message in send queue
INFO:autogen_core:Waiting for message from host
INFO:autogen_core:Starting read loop
INFO:autogen_core:Getting message from queue
The Worker 1 started print is never seen.
AutoGen version
0.4.0.dev11
Which package was this bug in
Core
Model used
No response
Python version
3.12
Operating system
Mac
Any additional info you think would be helpful for fixing this bug
No response
The text was updated successfully, but these errors were encountered:
What happened?
I am trying to reproduce the distributed agent runtime example.
However my program gets stuck on the first WorkerAgent register. I don't see the output as indicated in the example.
What did you expect to happen?
I expected to be able to reproduce the Distributed Agent Runtime example.
How can we reproduce it (as minimally and precisely as possible)?
Here is the exact code I am running:
I don't see the output as indicated in the example. For me, the program gets stuck on the first
MyAgent.register
. Here are the logs:The
Worker 1 started
print is never seen.AutoGen version
0.4.0.dev11
Which package was this bug in
Core
Model used
No response
Python version
3.12
Operating system
Mac
Any additional info you think would be helpful for fixing this bug
No response
The text was updated successfully, but these errors were encountered: