A programming framework for agentic AI
add subscription to agents (#544)
Mohammad Mazraeh0da2540327f9
diff --git a/python/packages/autogen-core/samples/patterns/group_chat.py b/python/packages/autogen-core/samples/patterns/group_chat.pyindex 1680398d6..728728566 100644--- a/python/packages/autogen-core/samples/patterns/group_chat.py+++ b/python/packages/autogen-core/samples/patterns/group_chat.py@@ -20,6 +20,7 @@ from typing import Listfrom autogen_core.application import SingleThreadedAgentRuntimefrom autogen_core.base import AgentId, AgentInstantiationContextfrom autogen_core.components import DefaultTopicId, RoutedAgent, message_handler+from autogen_core.components._default_subscription import DefaultSubscriptionfrom autogen_core.components.models import (AssistantMessage,ChatCompletionClient,@@ -121,6 +122,7 @@ async def main() -> None:system_messages=[SystemMessage("You are a data scientist.")],model_client=get_chat_completion_client_from_envs(model="gpt-4o-mini"),),+ lambda: [DefaultSubscription()],)await runtime.register(@@ -130,6 +132,7 @@ async def main() -> None:system_messages=[SystemMessage("You are an engineer.")],model_client=get_chat_completion_client_from_envs(model="gpt-4o-mini"),),+ lambda: [DefaultSubscription()],)await runtime.register("Artist",@@ -138,6 +141,7 @@ async def main() -> None:system_messages=[SystemMessage("You are an artist.")],model_client=get_chat_completion_client_from_envs(model="gpt-4o-mini"),),+ lambda: [DefaultSubscription()],)# Register the group chat manager.@@ -152,6 +156,7 @@ async def main() -> None:],num_rounds=3,),+ lambda: [DefaultSubscription()],)# Start the runtime.