From f9d75861aed04c1a842c1fa2a27346ce221b40f5 Mon Sep 17 00:00:00 2001 From: phact Date: Mon, 14 Oct 2024 23:42:29 -0400 Subject: [PATCH] do not override openai client outside of assistants --- src/backend/base/langflow/base/astra_assistants/util.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/backend/base/langflow/base/astra_assistants/util.py b/src/backend/base/langflow/base/astra_assistants/util.py index 784880813b01..d548e4be3624 100644 --- a/src/backend/base/langflow/base/astra_assistants/util.py +++ b/src/backend/base/langflow/base/astra_assistants/util.py @@ -7,7 +7,8 @@ import astra_assistants.tools as astra_assistants_tools import requests -from astra_assistants import OpenAI, patch +from astra_assistants import OpenAI as AstraOpenAI +from astra_assistants import patch from astra_assistants.tools.tool_interface import ToolInterface client_lock = threading.Lock() @@ -18,7 +19,7 @@ def get_patched_openai_client(shared_component_cache): os.environ["ASTRA_ASSISTANTS_QUIET"] = "true" client = shared_component_cache.get("client") if client is None: - client = patch(OpenAI()) + client = patch(AstraOpenAI()) shared_component_cache.set("client", client) return client