From 0bc1dae750fd6a9d817ffdefcd8645b77877a0a1 Mon Sep 17 00:00:00 2001 From: Kye Date: Mon, 25 Sep 2023 14:12:20 -0400 Subject: [PATCH] clean up agents Former-commit-id: ec22711d0980bc80081632ae56e3ca7560356fca --- swarms/workers/developer_agent.py | 24 ++++++++++-------------- swarms/workers/multi_modal_worker.py | 9 +-------- 2 files changed, 11 insertions(+), 22 deletions(-) diff --git a/swarms/workers/developer_agent.py b/swarms/workers/developer_agent.py index 0ac8fd9b..3e6550cc 100644 --- a/swarms/workers/developer_agent.py +++ b/swarms/workers/developer_agent.py @@ -1,25 +1,21 @@ +import argparse +import asyncio import enum +import logging import os -from pathlib import Path +import re +import shutil import sys import time -import shutil -import argparse -import asyncio -import re -from typing import List, Optional, Callable, Any +from pathlib import Path +from typing import Any, Callable, List, Optional import openai +from agent_protocol import Agent, Step, Task from openai_function_call import openai_function -from tenacity import retry, stop_after_attempt, wait_random_exponential -import logging - -from smol_dev.prompts import plan, specify_file_paths, generate_code_sync +from smol_dev.prompts import generate_code_sync, plan, specify_file_paths from smol_dev.utils import generate_folder, write_file - -from agent_protocol import Agent, Step, Task - - +from tenacity import retry, stop_after_attempt, wait_random_exponential class DeveloperAgent: diff --git a/swarms/workers/multi_modal_worker.py b/swarms/workers/multi_modal_worker.py index fc6d36b9..ce2fe0f7 100644 --- a/swarms/workers/multi_modal_worker.py +++ b/swarms/workers/multi_modal_worker.py @@ -1,11 +1,7 @@ # from swarms.workers.multi_modal_workers.multi_modal_agent import MultiModalVisualAgent from swarms.workers.multi_modal_workers.multi_modal_agent import MultiModalVisualAgent -from langchain.tools import BaseTool - -class MultiModalVisualAgentTool(BaseTool): - name = "multi_visual_agent" - description = "Multi-Modal Visual agent tool" +class MultiModalVisualAgentTool: def __init__(self, agent: MultiModalVisualAgent): self.agent = agent @@ -13,6 +9,3 @@ class MultiModalVisualAgentTool(BaseTool): #run the multi-modal visual agent with the give task return self.agent.run_text(text) - -multimodal_agent = MultiModalVisualAgent() -multimodal_agent_tool = MultiModalVisualAgentTool(multimodal_agent) \ No newline at end of file