From 0be3786f92b45dcb1741deeb3c0a3fd24266b358 Mon Sep 17 00:00:00 2001 From: Kye Date: Sat, 29 Jul 2023 12:55:27 -0400 Subject: [PATCH] clean up --- swarms/workers/worker_node.py | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/swarms/workers/worker_node.py b/swarms/workers/worker_node.py index dd037f24..59d7572f 100644 --- a/swarms/workers/worker_node.py +++ b/swarms/workers/worker_node.py @@ -119,19 +119,20 @@ class WorkerNodeInitializer: class WorkerNode: def __init__(self, - openai_api_key: str, - llm: Optional[Union[InMemoryDocstore, ChatOpenAI]] = None, - tools: Optional[List[Tool]] = None, - vectorstore: Optional[FAISS] = None, - embedding_size: Optional[int] = 1926, - worker_name: Optional[str] = "Swarm Worker AI Assistant", - worker_role: Optional[str] = "Assistant", - human_in_the_loop: Optional[bool] = False, - search_kwargs: dict = {}, - verbose: Optional[bool] = False, - chat_history_file: str = "chat_history.txt"): - if not openai_api_key: - logging.error("OpenAI API key is not provided") + openai_api_key: str, + temperature: int, + llm: Optional[Union[InMemoryDocstore, ChatOpenAI]] = None, + tools: Optional[List[Tool]] = None, + vectorstore: Optional[FAISS] = None, + embedding_size: Optional[int] = 1926, + worker_name: Optional[str] = "Swarm Worker AI Assistant", + worker_role: Optional[str] = "Assistant", + human_in_the_loop: Optional[bool] = False, + search_kwargs: dict = {}, + verbose: Optional[bool] = False, + chat_history_file: str = "chat_history.txt"): + + if not openai_api_key: raise ValueError("openai_api_key cannot be None") self.openai_api_key = openai_api_key