@@ -22,25 +22,28 @@ async def main(config: AppConfig) -> None:
22
22
Console ().print (Markdown ("Starting **`Writer Agent`**" ))
23
23
24
24
await writer_agent_runtime .start ()
25
+ model_client = AzureOpenAIChatCompletionClient (** config .client_config )
26
+
25
27
writer_agent_type = await BaseGroupChatAgent .register (
26
28
writer_agent_runtime ,
27
29
config .writer_agent .topic_type ,
28
30
lambda : BaseGroupChatAgent (
29
31
description = config .writer_agent .description ,
30
32
group_chat_topic_type = config .group_chat_manager .topic_type ,
31
33
system_message = config .writer_agent .system_message ,
32
- model_client = AzureOpenAIChatCompletionClient ( ** config . client_config ) ,
34
+ model_client = model_client ,
33
35
ui_config = config .ui_agent ,
34
36
),
35
37
)
36
38
await writer_agent_runtime .add_subscription (
37
39
TypeSubscription (topic_type = config .writer_agent .topic_type , agent_type = writer_agent_type .type )
38
40
)
39
41
await writer_agent_runtime .add_subscription (
40
- TypeSubscription (topic_type = config .group_chat_manager .topic_type , agent_type = config . writer_agent . topic_type )
42
+ TypeSubscription (topic_type = config .group_chat_manager .topic_type , agent_type = writer_agent_type . type )
41
43
)
42
44
43
45
await writer_agent_runtime .stop_when_signal ()
46
+ await model_client .close ()
44
47
45
48
46
49
if __name__ == "__main__" :
0 commit comments