From 9f46af57af44a5ce49b59a139a453854cbe49c95 Mon Sep 17 00:00:00 2001 From: Kye Date: Mon, 25 Sep 2023 13:16:44 -0400 Subject: [PATCH] worker fix --- swarms/workers/worker.py | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/swarms/workers/worker.py b/swarms/workers/worker.py index 0d2686b0..eb9211a0 100644 --- a/swarms/workers/worker.py +++ b/swarms/workers/worker.py @@ -69,22 +69,23 @@ class Worker: self.openai_api_key = openai_api_key self.temperature = temperature self.human_in_the_loop = human_in_the_loop + self.openai = openai - if self.openai is True: - try: - self.llm = ChatOpenAI( - model_name=model_name, - openai_api_key=self.openai_api_key, - temperature=self.temperature - ) - except Exception as error: - raise RuntimeError(f"Error Initializing ChatOpenAI: {error}") - else: - self.llm = llm( - model_name=model_name, - temperature=self.temperature - ) + # if self.openai is True: + # try: + self.llm = ChatOpenAI( + model_name=model_name, + openai_api_key=self.openai_api_key, + temperature=self.temperature + ) + # except Exception as error: + # raise RuntimeError(f"Error Initializing ChatOpenAI: {error}") + # else: + # self.llm = llm( + # model_name=model_name, + # temperature=self.temperature + # ) self.ai_name = ai_name self.ai_role = ai_role