You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
swarms/example.py

25 lines
576 B

from swarms.models import OpenAIChat
1 year ago
from swarms import Worker
1 year ago
from swarms.prompts import PRODUCT_AGENT_PROMPT
1 year ago
1 year ago
api_key = ""
1 year ago
llm = OpenAIChat(
openai_api_key=api_key,
1 year ago
temperature=0.5,
)
1 year ago
node = Worker(
llm=llm,
1 year ago
ai_name="Optimus Prime",
openai_api_key=api_key,
1 year ago
ai_role=PRODUCT_AGENT_PROMPT,
1 year ago
external_tools=None,
human_in_the_loop=False,
temperature=0.5,
1 year ago
)
1 year ago
task = "Locate 5 trending topics on healthy living, locate a website like NYTimes, and then generate an image of people doing those topics."
1 year ago
response = node.run(task)
print(response)