revert-563-dependabot/pip/pymdown-extensions-approx-eq-10.9
Kye Gomez 5 months ago
parent 07f8e371de
commit f6acc4adfd

@ -152,6 +152,7 @@ nav:
- HuggingFaceLLM: "swarms/models/huggingface.md" - HuggingFaceLLM: "swarms/models/huggingface.md"
- Anthropic: "swarms/models/anthropic.md" - Anthropic: "swarms/models/anthropic.md"
- OpenAIChat: "swarms/models/openai.md" - OpenAIChat: "swarms/models/openai.md"
- OpenAIFunctionCaller: "swarms/models/openai_function_caller.md"
# - TogetherAI: "swarms/models/togetherai.md" # - TogetherAI: "swarms/models/togetherai.md"
- MultiModal Models: - MultiModal Models:
- BaseMultiModalModel: "swarms/models/base_multimodal_model.md" - BaseMultiModalModel: "swarms/models/base_multimodal_model.md"

@ -63,7 +63,8 @@ swarm = AgentRearrange(
flow="Treasurer -> CFO", flow="Treasurer -> CFO",
) )
results = swarm.run("Date,Revenue,Expenses,Profit,Cash_Flow,Inventory,Customer_Acquisition_Cost,Customer_Retention_Rate,Marketing_Spend,R&D_Spend,Debt,Assets\n" results = swarm.run(
"Date,Revenue,Expenses,Profit,Cash_Flow,Inventory,Customer_Acquisition_Cost,Customer_Retention_Rate,Marketing_Spend,R&D_Spend,Debt,Assets\n"
"2023-01-01,1000000,800000,200000,150000,500000,100,0.85,50000,100000,2000000,5000000\n" "2023-01-01,1000000,800000,200000,150000,500000,100,0.85,50000,100000,2000000,5000000\n"
"2023-02-01,1050000,820000,230000,180000,520000,95,0.87,55000,110000,1950000,5100000\n" "2023-02-01,1050000,820000,230000,180000,520000,95,0.87,55000,110000,1950000,5100000\n"
"2023-03-01,1100000,850000,250000,200000,530000,90,0.88,60000,120000,1900000,5200000\n" "2023-03-01,1100000,850000,250000,200000,530000,90,0.88,60000,120000,1900000,5200000\n"
@ -82,4 +83,4 @@ results = swarm.run("Date,Revenue,Expenses,Profit,Cash_Flow,Inventory,Customer_A
"2024-04-01,1650000,1260000,390000,240000,720000,86,0.87,115000,195000,1440000,6450000\n" "2024-04-01,1650000,1260000,390000,240000,720000,86,0.87,115000,195000,1440000,6450000\n"
"2024-05-01,1700000,1280000,420000,260000,700000,83,0.88,120000,200000,1420000,6500000\n" "2024-05-01,1700000,1280000,420000,260000,700000,83,0.88,120000,200000,1420000,6500000\n"
"2024-06-01,1750000,1300000,450000,280000,680000,80,0.89,125000,205000,1400000,6550000" "2024-06-01,1750000,1300000,450000,280000,680000,80,0.89,125000,205000,1400000,6550000"
) )

@ -27,6 +27,7 @@ sys.path.insert(0, os.getcwd())
from swarms import Agent, OpenAIChat from swarms import Agent, OpenAIChat
from agentops import record_function from agentops import record_function
# Add agentops decorator on your tools # Add agentops decorator on your tools
@record_function("length_checker") @record_function("length_checker")
def length_checker(string: str) -> int: def length_checker(string: str) -> int:
@ -41,6 +42,7 @@ def length_checker(string: str) -> int:
""" """
return len(string) return len(string)
agent1 = Agent( agent1 = Agent(
agent_name="lengther", agent_name="lengther",
system_prompt="return the length of the string", system_prompt="return the length of the string",

@ -91,6 +91,7 @@ def step_id():
agent_output_type = Union[BaseModel, dict, str] agent_output_type = Union[BaseModel, dict, str]
ToolUsageType = Union[BaseModel, Dict[str, Any]] ToolUsageType = Union[BaseModel, Dict[str, Any]]
# [FEAT][AGENT] # [FEAT][AGENT]
@agentops.track_agent() @agentops.track_agent()
class Agent(BaseStructure): class Agent(BaseStructure):

@ -224,7 +224,11 @@ class AgentRearrange(BaseSwarm):
else: else:
agent = self.agents[agent_name] agent = self.agents[agent_name]
result = agent.run( result = agent.run(
current_task, img, is_last, *args, **kwargs current_task,
img,
is_last,
*args,
**kwargs,
) )
results.append(result) results.append(result)
@ -324,13 +328,22 @@ class AgentRearrange(BaseSwarm):
results = [] results = []
for agent_name in agent_names: for agent_name in agent_names:
result = self.process_agent_or_swarm( result = self.process_agent_or_swarm(
agent_name, current_task, img, is_last*args, **kwargs agent_name,
current_task,
img,
is_last * args,
**kwargs,
) )
results.append(result) results.append(result)
current_task = "; ".join(results) current_task = "; ".join(results)
else: else:
current_task = self.process_agent_or_swarm( current_task = self.process_agent_or_swarm(
agent_names[0], current_task, is_last, img, *args, **kwargs agent_names[0],
current_task,
is_last,
img,
*args,
**kwargs,
) )
return current_task return current_task

@ -30,7 +30,11 @@ def parse_and_execute_json(
function_dict = {func.__name__: func for func in functions} function_dict = {func.__name__: func for func in functions}
data = json.loads(json_string) data = json.loads(json_string)
function_list = data.get("functions", []) if data.get("functions") else [data.get("function", [])] function_list = (
data.get("functions", [])
if data.get("functions")
else [data.get("function", [])]
)
results = {} results = {}
for function_data in function_list: for function_data in function_list:

Loading…
Cancel
Save