Former-commit-id: 31f7a6304a
group-chat
Kye 1 year ago
parent 70a6bad805
commit 0fa72cf4b7

@ -1,3 +1,5 @@
from agent_protocol import Agent, Step, Task
from swarms.workers.multi_modal_workers.multi_modal_agent import MultiModalVisualAgent from swarms.workers.multi_modal_workers.multi_modal_agent import MultiModalVisualAgent
class MultiModalVisualAgent: class MultiModalVisualAgent:
@ -6,8 +8,27 @@ class MultiModalVisualAgent:
agent: MultiModalVisualAgent agent: MultiModalVisualAgent
): ):
self.agent = agent self.agent = agent
self.plan = plan
def _run(self, text: str) -> str: async def run(self, text: str) -> str:
#run the multi-modal visual agent with the give task #run the multi-modal visual agent with the give task
return self.agent.run_text(text) return self.agent.run_text(text)
async def __call__(self, text: str) -> str:
return self.agent.run(text)
async def plan(self, step: Step) -> Step:
task = Agent
pass
async def task_handler(self, task: Task):
await self.agent.run()
async def step_handler(self, step: Step):
if step.name == "plan":
await self.plan(step)
else:
await self.agent.run(step)
return step

@ -3,11 +3,11 @@ from swarms.workers.multi_modal_workers.omni_agent.omni_chat import chat_hugging
class OmniModalAgent: class OmniModalAgent:
def __init__( def __init__(
self, self,
api_key, api_key,
api_endpoint, api_endpoint,
api_type api_type
): ):
self.api_key = api_key self.api_key = api_key
self.api_endpoint = api_endpoint self.api_endpoint = api_endpoint
self.api_type = api_type self.api_type = api_type

Loading…
Cancel
Save