From d76cb9c5f0d8bc2b934f846915610ccc4b2ffa04 Mon Sep 17 00:00:00 2001 From: heyitsaamir Date: Fri, 23 Aug 2024 12:14:40 -0700 Subject: [PATCH] Fix breaking changes with autogen --- src/autogen_planner.py | 2 +- src/config.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/autogen_planner.py b/src/autogen_planner.py index 4c618a2..58d283b 100644 --- a/src/autogen_planner.py +++ b/src/autogen_planner.py @@ -56,7 +56,7 @@ async def continue_task(self, context, state: AppTurnState): llm_config=self.llm_config ) if is_existing_group_chat and state.conversation.message_history is not None: - await manager.a_resume(messages=state.conversation.message_history) + await manager.a_resume(messages=state.conversation.message_history, remove_termination_string=None) # type: ignore incoming_message = self.messageBuilder(context, state) if self.messageBuilder is not None else context.activity.text chat_result = await user_proxy.a_initiate_chat(recipient=manager, message=incoming_message, clear_history=False) diff --git a/src/config.py b/src/config.py index a0cc546..a4099f7 100644 --- a/src/config.py +++ b/src/config.py @@ -28,8 +28,10 @@ class Config: def build_llm_config(self): if self.OPENAI_KEY: + print("Using OpenAI API") autogen_llm_config = {"model": "gpt-4o-mini", "api_key": self.OPENAI_KEY} elif self.AZURE_OPENAI_KEY and self.AZURE_OPENAI_ENDPOINT: + print("Using Azure OpenAI API") autogen_llm_config = { "model": "my-gpt-4-deployment", "api_version": "2024-02-01", @@ -38,6 +40,7 @@ def build_llm_config(self): "base_url": self.AZURE_OPENAI_ENDPOINT, } elif self.AZURE_MANAGED_IDENTITY_CLIENT_ID and self.AZURE_LLM_MODEL and self.AZURE_LLM_BASE_URL: + print("Using Azure OpenAI API with managed identity") import azure.identity autogen_llm_config = { "model": self.AZURE_LLM_MODEL,