[CODE FORMATTING]

pull/704/head
Kye Gomez 2 weeks ago
parent b53cd15c24
commit da3f12905d

@ -1,4 +1,3 @@
import os import os
from dotenv import load_dotenv from dotenv import load_dotenv
from swarm_models import OpenAIChat from swarm_models import OpenAIChat

@ -201,8 +201,8 @@ blackstone_market_analysis = AgentRearrange(
) )
swarm_arrange = SwarmRearrange( swarm_arrange = SwarmRearrange(
name = "Blackstone-Swarm", name="Blackstone-Swarm",
description = "A swarm that processes tasks concurrently using multiple agents and rearranges the flow based on the task requirements.", description="A swarm that processes tasks concurrently using multiple agents and rearranges the flow based on the task requirements.",
swarms=[ swarms=[
blackstone_acquisition_analysis, blackstone_acquisition_analysis,
blackstone_investment_strategy, blackstone_investment_strategy,

@ -17,7 +17,7 @@ from swarms.structs.groupchat import (
ChatHistory, ChatHistory,
ChatTurn, ChatTurn,
AgentResponse, AgentResponse,
expertise_based expertise_based,
) )
from swarms.structs.majority_voting import ( from swarms.structs.majority_voting import (
MajorityVoting, MajorityVoting,

@ -24,6 +24,7 @@ uuid_hex = uuid.uuid4().hex
formatted_time = datetime.datetime.now().strftime("%Y-%m-%dT%H-%M-%S") formatted_time = datetime.datetime.now().strftime("%Y-%m-%dT%H-%M-%S")
# --------------- NEW CHANGE END --------------- # --------------- NEW CHANGE END ---------------
class AgentOutput(BaseModel): class AgentOutput(BaseModel):
agent_name: str agent_name: str
task: str task: str

@ -44,16 +44,16 @@ class OpenAIFunctionCaller:
self.temperature = temperature self.temperature = temperature
self.base_model = base_model self.base_model = base_model
self.max_tokens = max_tokens self.max_tokens = max_tokens
try: try:
from openai import OpenAI from openai import OpenAI
except ImportError: 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"]) subprocess.run(["pip", "install", "openai"])
from openai import OpenAI from openai import OpenAI
self.client = OpenAI(api_key=api_key) self.client = OpenAI(api_key=api_key)
def run(self, task: str, *args, **kwargs) -> BaseModel: def run(self, task: str, *args, **kwargs) -> BaseModel:

Loading…
Cancel
Save