diff --git a/swarms/agents/workers/WorkerUltraNode.py b/swarms/agents/workers/WorkerUltraNode.py index 0f88c82d..44a9f722 100644 --- a/swarms/agents/workers/WorkerUltraNode.py +++ b/swarms/agents/workers/WorkerUltraNode.py @@ -30,7 +30,7 @@ except Exception as e: class WorkerUltraNode: def __init__(self, objective: str, openai_api_key: str): - self.openai_api_key = openai_api_key + self.openai_api_key = openai_api_key or os.getenv("OPENAI_API_KEY") if not isinstance(objective, str): raise TypeError("Objective must be a string")