pull/55/head
Kye 1 year ago
parent d46d292549
commit 9f46af57af

@ -69,22 +69,23 @@ class Worker:
self.openai_api_key = openai_api_key self.openai_api_key = openai_api_key
self.temperature = temperature self.temperature = temperature
self.human_in_the_loop = human_in_the_loop self.human_in_the_loop = human_in_the_loop
self.openai = openai
if self.openai is True:
try: # if self.openai is True:
self.llm = ChatOpenAI( # try:
model_name=model_name, self.llm = ChatOpenAI(
openai_api_key=self.openai_api_key, model_name=model_name,
temperature=self.temperature openai_api_key=self.openai_api_key,
) temperature=self.temperature
except Exception as error: )
raise RuntimeError(f"Error Initializing ChatOpenAI: {error}") # except Exception as error:
else: # raise RuntimeError(f"Error Initializing ChatOpenAI: {error}")
self.llm = llm( # else:
model_name=model_name, # self.llm = llm(
temperature=self.temperature # model_name=model_name,
) # temperature=self.temperature
# )
self.ai_name = ai_name self.ai_name = ai_name
self.ai_role = ai_role self.ai_role = ai_role

Loading…
Cancel
Save