@ -1,9 +1,15 @@
from langchain.models import OpenAIChat
from swarms import Worker
llm = OpenAIChat()
node = Worker(
openai_api_key="",
llm=llm,
ai_name="Optimus Prime",
ai_role="Worker in a swarm",
external_tools = None,
human_in_the_loop = False,
temperature = 0.5,
)
task = "What were the winning boston marathon times for the past 5 years (ending in 2022)? Generate a table of the year, name, country of origin, and times."
@ -3,5 +3,7 @@ from swarms.agents import OmniModalAgent
llm = OpenAIChat(model_name="gpt-4")
agent = OmniModalAgent(llm)
agent.run("Create a video of a swarm of fish")
@ -155,4 +155,21 @@ class GroupChatManager(Worker):
message = self.last_message(speaker)
message = self.last_messge(speaker)
return True, None
model = GroupChatManager(
groupchat=GroupChat(
workers=[
Worker(name="A", system_message="I am worker A"),
Worker(name="B", system_message="I am worker B"),
Worker(name="C", system_message="I am worker C"),
]
model.run(
messages=[
'A: Hello, I am worker A',
'B: Hello, I am worker B',
@ -58,10 +58,12 @@ class Worker:
print(response)
```
llm + tools + memory
"""
def __init__(
self,
openai_api_key: str = None,
ai_name: str = "Autobot Swarm Worker",
ai_role: str = "Worker in a swarm",
@ -69,7 +71,6 @@ class Worker:
temperature: float = 0.5,
llm = None,
):
self.openai_api_key = openai_api_key
self.temperature = temperature
self.human_in_the_loop = human_in_the_loop
self.llm = llm