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

33 lines
749 B

1 year ago
from swarms import Agent, Anthropic
11 months ago
# Initialize the agemt
agent = Agent(
1 year ago
agent_name="Transcript Generator",
agent_description=(
11 months ago
"Generate a transcript for a youtube video on what swarms" " are!"
1 year ago
),
1 year ago
llm=Anthropic(),
max_loops=3,
autosave=True,
dashboard=False,
streaming_on=True,
verbose=True,
stopping_token="<DONE>",
interactive=True,
11 months ago
state_save_file_type="json",
saved_state_path="transcript_generator.json",
)
11 months ago
# Run the Agent on a task
11 months ago
out = agent.run(
"Generate a transcript for a youtube video on what swarms are!"
)
11 months ago
print(out)
# Save the state
11 months ago
check = agent.save_state(
"transcript_generator.json",
"Generate a transcript for a youtube video on what swarms are!",
)