diff --git a/group_chat_example.py b/group_chat_example.py index 830594f4..d28bea9b 100644 --- a/group_chat_example.py +++ b/group_chat_example.py @@ -1,4 +1,3 @@ - import os from dotenv import load_dotenv from swarm_models import OpenAIChat diff --git a/swarm_arange_demo.py b/swarm_arange_demo.py index de0051f0..b2aebb91 100644 --- a/swarm_arange_demo.py +++ b/swarm_arange_demo.py @@ -201,8 +201,8 @@ blackstone_market_analysis = AgentRearrange( ) swarm_arrange = SwarmRearrange( - name = "Blackstone-Swarm", - description = "A swarm that processes tasks concurrently using multiple agents and rearranges the flow based on the task requirements.", + name="Blackstone-Swarm", + description="A swarm that processes tasks concurrently using multiple agents and rearranges the flow based on the task requirements.", swarms=[ blackstone_acquisition_analysis, blackstone_investment_strategy, diff --git a/swarms/structs/__init__.py b/swarms/structs/__init__.py index dbae2f48..e4f6d91d 100644 --- a/swarms/structs/__init__.py +++ b/swarms/structs/__init__.py @@ -17,7 +17,7 @@ from swarms.structs.groupchat import ( ChatHistory, ChatTurn, AgentResponse, - expertise_based + expertise_based, ) from swarms.structs.majority_voting import ( MajorityVoting, diff --git a/swarms/structs/spreadsheet_swarm.py b/swarms/structs/spreadsheet_swarm.py index 2fb298e6..9bbb36a7 100644 --- a/swarms/structs/spreadsheet_swarm.py +++ b/swarms/structs/spreadsheet_swarm.py @@ -24,6 +24,7 @@ uuid_hex = uuid.uuid4().hex formatted_time = datetime.datetime.now().strftime("%Y-%m-%dT%H-%M-%S") # --------------- NEW CHANGE END --------------- + class AgentOutput(BaseModel): agent_name: str task: str diff --git a/swarms/structs/swarm_builder.py b/swarms/structs/swarm_builder.py index 2e963272..78d5ea34 100644 --- a/swarms/structs/swarm_builder.py +++ b/swarms/structs/swarm_builder.py @@ -44,16 +44,16 @@ class OpenAIFunctionCaller: self.temperature = temperature self.base_model = base_model self.max_tokens = max_tokens - - + try: from openai import OpenAI except ImportError: - logger.error("OpenAI library not found. Please install the OpenAI library by running 'pip install openai'") + logger.error( + "OpenAI library not found. Please install the OpenAI library by running 'pip install openai'" + ) subprocess.run(["pip", "install", "openai"]) from openai import OpenAI - - + self.client = OpenAI(api_key=api_key) def run(self, task: str, *args, **kwargs) -> BaseModel: