|
|
|
@ -23,7 +23,8 @@ from swarms.utils.decorators import error_decorator, log_decorator, timing_decor
|
|
|
|
|
ROOT_DIR = "./data/"
|
|
|
|
|
|
|
|
|
|
# main
|
|
|
|
|
openai_api_key = os.environ["OPENAI_API_KEY"]
|
|
|
|
|
OPENAI_API_KEY = os.environ["OPENAI_API_KEY"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Worker:
|
|
|
|
|
"""
|
|
|
|
@ -72,7 +73,7 @@ class Worker:
|
|
|
|
|
self.temperature = temperature
|
|
|
|
|
self.human_in_the_loop = human_in_the_loop
|
|
|
|
|
self.llm = llm
|
|
|
|
|
self.openai_api_key = openai_api_key or os.environ["OPENAI_API_KEY"]
|
|
|
|
|
self.openai_api_key = openai_api_key or OPENAI_API_KEY
|
|
|
|
|
self.ai_name = ai_name
|
|
|
|
|
self.ai_role = ai_role
|
|
|
|
|
self.setup_tools(external_tools)
|
|
|
|
@ -281,4 +282,4 @@ class Worker:
|
|
|
|
|
if isinstance(message, str):
|
|
|
|
|
return {"content": message}
|
|
|
|
|
else:
|
|
|
|
|
return message
|
|
|
|
|
return message
|