undo a couple changes

pull/443/head
Wyatt Stanke 1 year ago
parent 42ee4ba39c
commit 7cec78fdc1
No known key found for this signature in database
GPG Key ID: CE6BA5FFF135536D

@ -1,19 +1,18 @@
---
repos: repos:
- repo: https://github.com/ambv/black - repo: https://github.com/ambv/black
rev: 22.3.0 rev: 22.3.0
hooks: hooks:
- id: black - id: black
- repo: https://github.com/charliermarsh/ruff-pre-commit - repo: https://github.com/charliermarsh/ruff-pre-commit
rev: 'v0.0.255' rev: 'v0.0.255'
hooks: hooks:
- id: ruff - id: ruff
args: ['----unsafe-fixes'] args: [----unsafe-fixes]
- repo: https://github.com/nbQA-dev/nbQA - repo: https://github.com/nbQA-dev/nbQA
rev: 1.6.3 rev: 1.6.3
hooks: hooks:
- id: nbqa-black - id: nbqa-black
additional_dependencies: [ipython==8.12, black] additional_dependencies: [ipython==8.12, black]
- id: nbqa-ruff - id: nbqa-ruff
args: ["--ignore=I001"] args: ["--ignore=I001"]
additional_dependencies: [ipython==8.12, ruff] additional_dependencies: [ipython==8.12, ruff]

@ -1,11 +1,13 @@
---
version: 2 version: 2
build: build:
os: ubuntu-22.04 os: ubuntu-22.04
tools: tools:
python: "3.11" python: "3.11"
mkdocs: mkdocs:
configuration: mkdocs.yml configuration: mkdocs.yml
python: python:
install: install:
- requirements: requirements.txt - requirements: requirements.txt

@ -1,5 +0,0 @@
---
formatter:
type: basic
include_document_start: true
max_line_length: 80

@ -1,3 +0,0 @@
rules:
line-length:
max: 127

@ -1,6 +1,7 @@
from swarms import Agent, Anthropic from swarms import Agent, Anthropic
# Initialize the workflow
## Initialize the workflow
agent = Agent( agent = Agent(
agent_name="Transcript Generator", agent_name="Transcript Generator",
agent_description=( agent_description=(

@ -1,4 +1,3 @@
---
site_name: Swarms Docs site_name: Swarms Docs
plugins: plugins:
- glightbox - glightbox
@ -17,15 +16,15 @@ extra:
- icon: fontawesome/brands/python - icon: fontawesome/brands/python
link: https://pypi.org/project/Swarms/ link: https://pypi.org/project/Swarms/
theme: theme:
name: material name: material
custom_dir: docs/overrides custom_dir: docs/overrides
logo: assets/img/SwarmsLogoIcon.png logo: assets/img/SwarmsLogoIcon.png
palette: palette:
# Palette toggle for light mode # Palette toggle for light mode
- scheme: default - scheme: default
primary: black primary: black
toggle: toggle:
icon: material/brightness-7 icon: material/brightness-7
name: Switch to dark mode name: Switch to dark mode
# Palette toggle for dark mode # Palette toggle for dark mode
- scheme: slate - scheme: slate
@ -33,14 +32,14 @@ theme:
toggle: toggle:
icon: material/brightness-4 icon: material/brightness-4
name: Switch to light mode name: Switch to light mode
features: features:
- content.code.copy - content.code.copy
- content.code.annotate - content.code.annotate
- navigation.tabs - navigation.tabs
- navigation.sections - navigation.sections
- navigation.expand - navigation.expand
- navigation.top - navigation.top
- announce.dismiss - announce.dismiss
markdown_extensions: markdown_extensions:
- pymdownx.highlight: - pymdownx.highlight:
anchor_linenums: true anchor_linenums: true
@ -56,127 +55,131 @@ markdown_extensions:
- def_list - def_list
- footnotes - footnotes
nav: nav:
- Home: - Home:
- Overview: "index.md" - Overview: "index.md"
- Contributing: "contributing.md" - Contributing: "contributing.md"
- Limitations of Individual Agents: "limits_of_individual_agents.md" - Limitations of Individual Agents: "limits_of_individual_agents.md"
- Why Swarms: "why_swarms.md" - Why Swarms: "why_swarms.md"
- The Swarms Bounty System: "swarms_bounty_system.md" - The Swarms Bounty System: "swarms_bounty_system.md"
- Swarms Cloud API: - Swarms Cloud API:
- Overview: "swarms_cloud/main.md" - Overview: "swarms_cloud/main.md"
- Migrate from OpenAI to Swarms in 3 lines of code: "swarms_cloud/migrate_openai.md" - Migrate from OpenAI to Swarms in 3 lines of code: "swarms_cloud/migrate_openai.md"
- Swarms Framework [PY]: - Swarms Framework [PY]:
- Overview: "swarms/index.md" - Overview: "swarms/index.md"
- DIY Build Your Own Agent: "diy_your_own_agent.md" - DIY Build Your Own Agent: "diy_your_own_agent.md"
- swarms.agents: - swarms.agents:
- Agents: - Agents:
- WorkerAgent: "swarms/agents/workeragent.md" - WorkerAgent: "swarms/agents/workeragent.md"
- OmniAgent: "swarms/agents/omni_agent.md" - OmniAgent: "swarms/agents/omni_agent.md"
- AbstractAgent: "swarms/agents/abstractagent.md" - AbstractAgent: "swarms/agents/abstractagent.md"
- ToolAgent: "swarms/agents/toolagent.md" - ToolAgent: "swarms/agents/toolagent.md"
- swarms.models: - swarms.models:
- How to Create A Custom Language Model: "swarms/models/custom_model.md" - How to Create A Custom Language Model: "swarms/models/custom_model.md"
- "Deploying Azure OpenAI in Production: A Comprehensive Guide": "swarms/models/azure_openai.md" - Deploying Azure OpenAI in Production: A Comprehensive Guide: "swarms/models/azure_openai.md"
- Language: - Language:
- BaseLLM: "swarms/models/base_llm.md" - BaseLLM: "swarms/models/base_llm.md"
- Overview: "swarms/models/index.md" - Overview: "swarms/models/index.md"
- HuggingFaceLLM: "swarms/models/huggingface.md" - HuggingFaceLLM: "swarms/models/huggingface.md"
- Anthropic: "swarms/models/anthropic.md" - Anthropic: "swarms/models/anthropic.md"
- OpenAI: "swarms/models/openai.md" - OpenAI: "swarms/models/openai.md"
- vLLM: "swarms/models/vllm.md" - vLLM: "swarms/models/vllm.md"
- MPT7B: "swarms/models/mpt.md" - MPT7B: "swarms/models/mpt.md"
- Mistral: "swarms/models/mistral.md" - Mistral: "swarms/models/mistral.md"
- Mixtral: "swarms/models/mixtral.md" - Mixtral: "swarms/models/mixtral.md"
- MultiModal: - MultiModal:
- BaseMultiModalModel: "swarms/models/base_multimodal_model.md" - BaseMultiModalModel: "swarms/models/base_multimodal_model.md"
- Fuyu: "swarms/models/fuyu.md" - Fuyu: "swarms/models/fuyu.md"
- Vilt: "swarms/models/vilt.md" - Vilt: "swarms/models/vilt.md"
- Idefics: "swarms/models/idefics.md" - Idefics: "swarms/models/idefics.md"
- Kosmos: "swarms/models/kosmos.md" - Kosmos: "swarms/models/kosmos.md"
- Nougat: "swarms/models/nougat.md" - Nougat: "swarms/models/nougat.md"
- Dalle3: "swarms/models/dalle3.md" - Dalle3: "swarms/models/dalle3.md"
- GPT4V: "swarms/models/gpt4v.md" - GPT4V: "swarms/models/gpt4v.md"
- DistilWhisperModel: "swarms/models/distilled_whisperx.md" - DistilWhisperModel: "swarms/models/distilled_whisperx.md"
- swarms.structs: - swarms.structs:
- Foundational Structures: - Foundational Structures:
- agent: "swarms/structs/agent.md" - agent: "swarms/structs/agent.md"
- basestructure: "swarms/structs/basestructure.md" - basestructure: "swarms/structs/basestructure.md"
- artifactupload: "swarms/structs/artifactupload.md" - artifactupload: "swarms/structs/artifactupload.md"
- taskinput: "swarms/structs/taskinput.md" - taskinput: "swarms/structs/taskinput.md"
- stepinput: "swarms/structs/stepinput.md" - stepinput: "swarms/structs/stepinput.md"
- artifact: "swarms/structs/artifact.md" - artifact: "swarms/structs/artifact.md"
- task: "swarms/structs/task.md" - task: "swarms/structs/task.md"
- Task Queue Base: "swarms/structs/taskqueuebase.md" - Task Queue Base: "swarms/structs/taskqueuebase.md"
- Workflows: - Workflows:
- recursiveworkflow: "swarms/structs/recursiveworkflow.md" - recursiveworkflow: "swarms/structs/recursiveworkflow.md"
- concurrentworkflow: "swarms/structs/concurrentworkflow.md" - concurrentworkflow: "swarms/structs/concurrentworkflow.md"
- nonlinearworkflow: "swarms/structs/nonlinearworkflow.md" - nonlinearworkflow: "swarms/structs/nonlinearworkflow.md"
- sequential_workflow: "swarms/structs/sequential_workflow.md" - sequential_workflow: "swarms/structs/sequential_workflow.md"
- workflow: "swarms/structs/workflow.md" - workflow: "swarms/structs/workflow.md"
- baseworkflow: "swarms/structs/baseworkflow.md" - baseworkflow: "swarms/structs/baseworkflow.md"
- Multi Agent Architectures: - Multi Agent Architectures:
- conversation: "swarms/structs/conversation.md" - conversation: "swarms/structs/conversation.md"
- groupchat: "swarms/structs/groupchat.md" - groupchat: "swarms/structs/groupchat.md"
- swarmnetwork: "swarms/structs/swarmnetwork.md" - swarmnetwork: "swarms/structs/swarmnetwork.md"
- groupchatmanager: "swarms/structs/groupchatmanager.md" - groupchatmanager: "swarms/structs/groupchatmanager.md"
- MajorityVoting: "swarms/structs/majorityvoting.md" - MajorityVoting: "swarms/structs/majorityvoting.md"
- swarms.memory: - swarms.memory:
- Building Custom Vector Memory Databases with the AbstractVectorDatabase Class: "swarms/memory/diy_memory.md" - Building Custom Vector Memory Databases with the AbstractVectorDatabase Class: "swarms/memory/diy_memory.md"
- Vector Databases: - Vector Databases:
- Weaviate: "swarms/memory/weaviate.md" - Weaviate: "swarms/memory/weaviate.md"
- PineconeDB: "swarms/memory/pinecone.md" - PineconeDB: "swarms/memory/pinecone.md"
- PGVectorStore: "swarms/memory/pg.md" - PGVectorStore: "swarms/memory/pg.md"
- ShortTermMemory: "swarms/memory/short_term_memory.md" - ShortTermMemory: "swarms/memory/short_term_memory.md"
- swarms.utils: - swarms.utils:
- Misc: - Misc:
- pdf_to_text: "swarms/utils/pdf_to_text.md" - pdf_to_text: "swarms/utils/pdf_to_text.md"
- load_model_torch: "swarms/utils/load_model_torch.md" - load_model_torch: "swarms/utils/load_model_torch.md"
- metrics_decorator: "swarms/utils/metrics_decorator.md" - metrics_decorator: "swarms/utils/metrics_decorator.md"
- prep_torch_inference: "swarms/utils/prep_torch_inference.md" - prep_torch_inference: "swarms/utils/prep_torch_inference.md"
- find_image_path: "swarms/utils/find_image_path.md" - find_image_path: "swarms/utils/find_image_path.md"
- print_class_parameters: "swarms/utils/print_class_parameters.md" - print_class_parameters: "swarms/utils/print_class_parameters.md"
- extract_code_from_markdown: "swarms/utils/extract_code_from_markdown.md" - extract_code_from_markdown: "swarms/utils/extract_code_from_markdown.md"
- check_device: "swarms/utils/check_device.md" - check_device: "swarms/utils/check_device.md"
- display_markdown_message: "swarms/utils/display_markdown_message.md" - display_markdown_message: "swarms/utils/display_markdown_message.md"
- phoenix_tracer: "swarms/utils/phoenix_tracer.md" - phoenix_tracer: "swarms/utils/phoenix_tracer.md"
- limit_tokens_from_string: "swarms/utils/limit_tokens_from_string.md" - limit_tokens_from_string: "swarms/utils/limit_tokens_from_string.md"
- math_eval: "swarms/utils/math_eval.md" - math_eval: "swarms/utils/math_eval.md"
- Guides: - Guides:
- Building Custom Vector Memory Databases with the AbstractVectorDatabase Class: "swarms/memory/diy_memory.md" - Building Custom Vector Memory Databases with the AbstractVectorDatabase Class: "swarms/memory/diy_memory.md"
- How to Create A Custom Language Model: "swarms/models/custom_model.md" - How to Create A Custom Language Model: "swarms/models/custom_model.md"
- "Deploying Azure OpenAI in Production: A Comprehensive Guide": "swarms/models/azure_openai.md" - Deploying Azure OpenAI in Production: A Comprehensive Guide: "swarms/models/azure_openai.md"
- DIY Build Your Own Agent: "diy_your_own_agent.md" - DIY Build Your Own Agent: "diy_your_own_agent.md"
- Overview: "examples/index.md" - Overview: "examples/index.md"
- Agents: - Agents:
- Agent: "examples/flow.md" - Agent: "examples/flow.md"
- OmniAgent: "examples/omni_agent.md" - OmniAgent: "examples/omni_agent.md"
- Swarms: - Swarms:
- SequentialWorkflow: "examples/reliable_autonomous_agents.md" - SequentialWorkflow: "examples/reliable_autonomous_agents.md"
- 2O+ Autonomous Agent Blogs: "examples/ideas.md" - 2O+ Autonomous Agent Blogs: "examples/ideas.md"
- Applications: - Applications:
- CustomerSupport: - CustomerSupport:
- Overview: "applications/customer_support.md" - Overview: "applications/customer_support.md"
- Marketing: - Marketing:
- Overview: "applications/marketing_agencies.md" - Overview: "applications/marketing_agencies.md"
- Corporate: - Corporate:
- Corporate Documents: - Corporate Documents:
- Data Room: "corporate/data_room.md" - Data Room: "corporate/data_room.md"
- SwarmMemo: "corporate/swarm_memo.md" - SwarmMemo: "corporate/swarm_memo.md"
- Corporate Architecture: "corporate/architecture.md" - Corporate Architecture: "corporate/architecture.md"
- Flywheel: "corporate/flywheel.md" - Flywheel: "corporate/flywheel.md"
- Bounties: "corporate/bounties.md" - Bounties: "corporate/bounties.md"
- Purpose: "corporate/purpose.md" - Purpose: "corporate/purpose.md"
- Roadmap: "corporate/roadmap.md" - Roadmap: "corporate/roadmap.md"
- Sales: - Sales:
- FAQ: "corporate/faq.md" - FAQ: "corporate/faq.md"
- Distribution: "corporate/distribution" - Distribution: "corporate/distribution"
- Product: - Product:
- SwarmCloud: "corporate/swarm_cloud.md" - SwarmCloud: "corporate/swarm_cloud.md"
- Weaknesses: "corporate/failures.md" - Weaknesses: "corporate/failures.md"
- Design: "corporate/design.md" - Design: "corporate/design.md"
- Metric: "corporate/metric.md" - Metric: "corporate/metric.md"
- Research: "corporate/research.md" - Research: "corporate/research.md"
- Demos: "corporate/demos.md" - Demos: "corporate/demos.md"
- Checklist: "corporate/checklist.md" - Checklist: "corporate/checklist.md"
- Organization:
- FrontEnd Member Onboarding: "corporate/front_end_contributors.md" - Organization:
- FrontEnd Member Onboarding: "corporate/front_end_contributors.md"

@ -1,6 +1,6 @@
from swarms import Agent, OpenAIChat from swarms import Agent, OpenAIChat
# Initialize the workflow ## Initialize the workflow
agent = Agent( agent = Agent(
llm=OpenAIChat(), llm=OpenAIChat(),
max_loops="auto", max_loops="auto",

@ -1,6 +1,5 @@
import subprocess
from swarms import Agent, Anthropic, tool from swarms import Agent, Anthropic, tool
import subprocess
# Model # Model
llm = Anthropic( llm = Anthropic(

@ -10,7 +10,7 @@ def search_api(query: str, max_results: int = 10):
return f"Search API: {query} -> {max_results} results" return f"Search API: {query} -> {max_results} results"
# Initialize the workflow ## Initialize the workflow
agent = Agent( agent = Agent(
agent_name="Youtube Transcript Generator", agent_name="Youtube Transcript Generator",
agent_description=( agent_description=(

@ -21,7 +21,7 @@ llm = GPT4VisionAPI(
task = "What is the color of the object?" task = "What is the color of the object?"
img = "images/swarms.jpeg" img = "images/swarms.jpeg"
# Initialize the workflow ## Initialize the workflow
agent = Agent( agent = Agent(
llm=llm, llm=llm,
max_loops="auto", max_loops="auto",

@ -0,0 +1,82 @@
from swarms import Agent, Anthropic, tool
# Model
llm = Anthropic(
temperature=0.1,
)
# Tools
@tool
def text_to_video(task: str):
"""
Converts a given text task into an animated video.
Args:
task (str): The text task to be converted into a video.
Returns:
str: The path to the exported GIF file.
"""
import torch
from diffusers import (
AnimateDiffPipeline,
MotionAdapter,
EulerDiscreteScheduler,
)
from diffusers.utils import export_to_gif
from huggingface_hub import hf_hub_download
from safetensors.torch import load_file
device = "cuda"
dtype = torch.float16
step = 4 # Options: [1,2,4,8]
repo = "ByteDance/AnimateDiff-Lightning"
ckpt = f"animatediff_lightning_{step}step_diffusers.safetensors"
base = ( # Choose to your favorite base model.
"emilianJR/epiCRealism"
)
adapter = MotionAdapter().to(device, dtype)
adapter.load_state_dict(
load_file(hf_hub_download(repo, ckpt), device=device)
)
pipe = AnimateDiffPipeline.from_pretrained(
base, motion_adapter=adapter, torch_dtype=dtype
).to(device)
pipe.scheduler = EulerDiscreteScheduler.from_config(
pipe.scheduler.config,
timestep_spacing="trailing",
beta_schedule="linear",
)
output = pipe(
prompt=task, guidance_scale=1.0, num_inference_steps=step
)
out = export_to_gif(output.frames[0], "animation.gif")
return out
# Agent
agent = Agent(
agent_name="Devin",
system_prompt=(
"Autonomous agent that can interact with humans and other"
" agents. Be Helpful and Kind. Use the tools provided to"
" assist the user. Return all code in markdown format."
),
llm=llm,
max_loops="auto",
autosave=True,
dashboard=False,
streaming_on=True,
verbose=True,
stopping_token="<DONE>",
interactive=True,
tools=[text_to_video],
)
# Run the agent
out = agent("Create a vide of a girl coding AI wearing hijab")
print(out)

@ -68,7 +68,6 @@ class ProductAdConceptGenerator:
def generate_concept(self): def generate_concept(self):
theme = random.choice(self.themes) theme = random.choice(self.themes)
context = random.choice(self.contexts) context = random.choice(self.contexts)
style = random.choice(["medival", "modern", "futuristic", "retro"])
return ( return (
f"{theme} inside a {style} {self.product_name}, {context}" f"{theme} inside a {style} {self.product_name}, {context}"
) )
@ -89,7 +88,6 @@ image_paths = sd_api.run(creative_concept)
# Generate ad copy # Generate ad copy
ad_copy_agent = Agent(llm=llm, max_loops=1) ad_copy_agent = Agent(llm=llm, max_loops=1)
social_media_platform = "Instagram"
ad_copy_prompt = ( ad_copy_prompt = (
f"Write a compelling {social_media_platform} ad copy for a" f"Write a compelling {social_media_platform} ad copy for a"
f" product photo showing {product_name} {creative_concept}." f" product photo showing {product_name} {creative_concept}."
@ -97,7 +95,9 @@ ad_copy_prompt = (
ad_copy = ad_copy_agent.run(task=ad_copy_prompt) ad_copy = ad_copy_agent.run(task=ad_copy_prompt)
# Output the results # Output the results
print("Ad Copy:", ad_copy) print("Creative Concept:", concept_result)
print("Design Ideas:", design_result)
print("Ad Copy:", copywriting_result)
print( print(
"Image Path:", "Image Path:",
image_paths[0] if image_paths else "No image generated", image_paths[0] if image_paths else "No image generated",

@ -4,8 +4,8 @@ Building an Autonomous Agent in 5 minutes with:
- Tools: Search, Browser, ETC - Tools: Search, Browser, ETC
- Long Term Mmeory: ChromaDB, Weaviate, Pinecone, ETC - Long Term Mmeory: ChromaDB, Weaviate, Pinecone, ETC
""" """
from playground.demos.agent_in_5.chroma_db import ChromaDB
from swarms import Agent, OpenAIChat, tool from swarms import Agent, OpenAIChat, tool
from playground.demos.agent_in_5.chroma_db import ChromaDB
# Initialize the memory # Initialize the memory
chroma = ChromaDB( chroma = ChromaDB(

@ -0,0 +1,59 @@
def test_create_graph():
"""
Tests that a graph can be created.
"""
graph = create_graph()
assert isinstance(graph, dict)
def test_weight_edges():
"""
Tests that the edges of a graph can be weighted.
"""
graph = create_graph()
weight_edges(graph)
for edge in graph.edges:
assert isinstance(edge.weight, int)
def test_create_user_list():
"""
Tests that a list of all the podcasts that the user has listened to can be created.
"""
user_list = create_user_list()
assert isinstance(user_list, list)
def test_find_most_similar_podcasts():
"""
Tests that the most similar podcasts to a given podcast can be found.
"""
graph = create_graph()
weight_edges(graph)
user_list = create_user_list()
most_similar_podcasts = find_most_similar_podcasts(
graph, user_list
)
assert isinstance(most_similar_podcasts, list)
def test_add_most_similar_podcasts():
"""
Tests that the most similar podcasts to a given podcast can be added to the user's list.
"""
graph = create_graph()
weight_edges(graph)
user_list = create_user_list()
add_most_similar_podcasts(graph, user_list)
assert len(user_list) > 0
def test_repeat_steps():
"""
Tests that steps 5-6 can be repeated until the user's list contains the desired number of podcasts.
"""
graph = create_graph()
weight_edges(graph)
user_list = create_user_list()
repeat_steps(graph, user_list)
assert len(user_list) == 10

@ -1,13 +1,12 @@
import concurrent import concurrent
import csv import csv
from dotenv import load_dotenv
from swarms import Agent, OpenAIChat from swarms import Agent, OpenAIChat
from swarms.memory import ChromaDB from swarms.memory import ChromaDB
from dotenv import load_dotenv
from swarms.utils.parse_code import extract_code_from_markdown
from swarms.utils.file_processing import create_file from swarms.utils.file_processing import create_file
from swarms.utils.loguru_logger import logger from swarms.utils.loguru_logger import logger
from swarms.utils.parse_code import extract_code_from_markdown
# Load ENV # Load ENV
load_dotenv() load_dotenv()
@ -70,7 +69,7 @@ def extract_and_create_agents(
""" """
try: try:
agents = [] agents = []
with open(csv_file_path, encoding="utf-8") as file: with open(csv_file_path, mode="r", encoding="utf-8") as file:
reader = csv.DictReader(file) reader = csv.DictReader(file)
for row in reader: for row in reader:
project_name = row[target_columns[0]] project_name = row[target_columns[0]]

@ -11,7 +11,7 @@ task = (
) )
img = "assembly_line.jpg" img = "assembly_line.jpg"
# Initialize the workflow ## Initialize the workflow
agent = Agent( agent = Agent(
llm=llm, llm=llm,
max_loops=1, max_loops=1,

@ -73,7 +73,7 @@ class AutoBlogGenSwarm:
----------------------------- -----------------------------
{text} {text}
""", """,
"blue", "blue",
) )

@ -1,10 +1,8 @@
import os import os
from dotenv import load_dotenv from dotenv import load_dotenv
import swarms.prompts.autoswarm as sdsp
from swarms.models import OpenAIChat from swarms.models import OpenAIChat
from swarms.structs import Agent from swarms.structs import Agent
import swarms.prompts.autoswarm as sdsp
# Load environment variables and initialize the OpenAI Chat model # Load environment variables and initialize the OpenAI Chat model
load_dotenv() load_dotenv()

@ -21,15 +21,15 @@ import UpperPanel from './UpperPanel';
import LowerPanel from './LowerPanel'; import LowerPanel from './LowerPanel';
const MainPanel = () => { const MainPanel = () => {
const [promptInstructionForLowerPanel, setPromptInstructionForLowerPanel] = useState(''); const [promptInstructionForLowerPanel, setPromptInstructionForLowerPanel] = useState('');
const [formData, setFormData] = useState(''); const [formData, setFormData] = useState('');
const [isLoading, setIsLoading] = useState(false); const [isLoading, setIsLoading] = useState(false);
return ( return (
<div className="flex h-screen"> <div className="flex h-screen">
<UpperPanel setPromptInstructionForLowerPanel={setPromptInstructionForLowerPanel} <UpperPanel setPromptInstructionForLowerPanel={setPromptInstructionForLowerPanel}
isLoading={isLoading} isLoading={isLoading}
setIsLoading={setIsLoading} setIsLoading={setIsLoading}
/> />
<LowerPanel promptInstruction={promptInstructionForLowerPanel} isLoading={isLoading} /> <LowerPanel promptInstruction={promptInstructionForLowerPanel} isLoading={isLoading} />
</div> </div>

@ -9,7 +9,7 @@ llm = GPT4VisionAPI()
task = "What is the color of the object?" task = "What is the color of the object?"
img = "images/swarms.jpeg" img = "images/swarms.jpeg"
# Initialize the workflow ## Initialize the workflow
agent = Agent( agent = Agent(
llm=llm, llm=llm,
sop=MULTI_MODAL_AUTO_AGENT_SYSTEM_PROMPT_1, sop=MULTI_MODAL_AUTO_AGENT_SYSTEM_PROMPT_1,

@ -6,7 +6,7 @@ llm = GPT4VisionAPI()
task = "What is the color of the object?" task = "What is the color of the object?"
img = "images/swarms.jpeg" img = "images/swarms.jpeg"
# Initialize the workflow ## Initialize the workflow
agent = Agent( agent = Agent(
llm=llm, llm=llm,
max_loops="auto", max_loops="auto",

@ -22,7 +22,7 @@ llm = GPT4VisionAPI(
task = "This is an eye test. What do you see?" task = "This is an eye test. What do you see?"
img = "playground/demos/multi_modal_chain_of_thought/eyetest.jpg" img = "playground/demos/multi_modal_chain_of_thought/eyetest.jpg"
# Initialize the workflow ## Initialize the workflow
agent = Agent( agent = Agent(
llm=llm, llm=llm,
max_loops=2, max_loops=2,

@ -171,7 +171,7 @@ if st.button("Generate Image"):
for i, (enriched_prompt, img_path, analysis) in enumerate( for i, (enriched_prompt, img_path, analysis) in enumerate(
results results
): ):
st.write(f"Iteration {i + 1}:") st.write(f"Iteration {i+1}:")
st.write("Enriched Prompt:", enriched_prompt) st.write("Enriched Prompt:", enriched_prompt)
if img_path: if img_path:
st.image(img_path, caption="Generated Image") st.image(img_path, caption="Generated Image")

@ -70,7 +70,7 @@ dashboard = print(
Topics: Topics:
------------------------ ------------------------
{topics} {topics}
""", """,
"blue", "blue",
) )
@ -81,7 +81,7 @@ draft_blog = llm(DRAFT_AGENT_SYSTEM_PROMPT)
draft_out = print( draft_out = print(
colored( colored(
f""" f"""
------------------------------------ ------------------------------------
Drafter Writer Agent Drafter Writer Agent
----------------------------- -----------------------------
@ -89,7 +89,7 @@ draft_out = print(
Draft: Draft:
------------------------ ------------------------
{draft_blog} {draft_blog}
""", """,
"red", "red",
) )
@ -101,7 +101,7 @@ review_agent = llm(get_review_prompt(draft_blog))
reviewed_draft = print( reviewed_draft = print(
colored( colored(
f""" f"""
------------------------------------ ------------------------------------
Quality Assurance Writer Agent Quality Assurance Writer Agent
----------------------------- -----------------------------
@ -109,7 +109,7 @@ reviewed_draft = print(
Complete Narrative: Complete Narrative:
------------------------ ------------------------
{draft_blog} {draft_blog}
""", """,
"blue", "blue",
) )

@ -1,6 +1,5 @@
# Import the necessary libraries. # Import the necessary libraries.
import asyncio import asyncio
import websockets import websockets
# Create a list of public group chats. # Create a list of public group chats.

@ -1,5 +1,5 @@
import discord import discord
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
# Discord Bot Setup # Discord Bot Setup
client = discord.Client() client = discord.Client()

@ -1,10 +1,10 @@
# OpenMind.bot streamlines social interactions between personalized bots, representing users, media, and influencers, ensuring meaningful exchanges. It eliminates misunderstandings by using context-aware conversations, followed by summaries or audio recaps of these interactions for efficient communication. # OpenMind.bot streamlines social interactions between personalized bots, representing users, media, and influencers, ensuring meaningful exchanges. It eliminates misunderstandings by using context-aware conversations, followed by summaries or audio recaps of these interactions for efficient communication.
import datetime
import json import json
import datetime
import pytz import pytz
from flask import Flask, jsonify, request
from flask import Flask, request, jsonify
app = Flask(__name__) app = Flask(__name__)
@ -28,7 +28,7 @@ def create_conversation():
@app.route("/api/v1/conversations/<conversation_id>", methods=["GET"]) @app.route("/api/v1/conversations/<conversation_id>", methods=["GET"])
def get_conversation(conversation_id): def get_conversation(conversation_id):
# Get the conversation from the database # Get the conversation from the database
with open("conversations.json") as f: with open("conversations.json", "r") as f:
conversation = json.load(f) conversation = json.load(f)
# Return the conversation # Return the conversation
@ -49,7 +49,7 @@ def create_message(conversation_id):
} }
# Get the conversation from the database # Get the conversation from the database
with open("conversations.json") as f: with open("conversations.json", "r") as f:
conversation = json.load(f) conversation = json.load(f)
# Add the message to the conversation # Add the message to the conversation
@ -68,7 +68,7 @@ def create_message(conversation_id):
) )
def get_messages(conversation_id): def get_messages(conversation_id):
# Get the conversation from the database # Get the conversation from the database
with open("conversations.json") as f: with open("conversations.json", "r") as f:
conversation = json.load(f) conversation = json.load(f)
# Return the messages # Return the messages
@ -80,7 +80,7 @@ def get_messages(conversation_id):
) )
def get_summary(conversation_id): def get_summary(conversation_id):
# Get the conversation from the database # Get the conversation from the database
with open("conversations.json") as f: with open("conversations.json", "r") as f:
conversation = json.load(f) conversation = json.load(f)
# Create a summary of the conversation # Create a summary of the conversation
@ -98,7 +98,7 @@ def get_summary(conversation_id):
) )
def get_audio_recap(conversation_id): def get_audio_recap(conversation_id):
# Get the conversation from the database # Get the conversation from the database
with open("conversations.json") as f: with open("conversations.json", "r") as f:
conversation = json.load(f) conversation = json.load(f)
# Create an audio recap of the conversation # Create an audio recap of the conversation

@ -1,14 +1,12 @@
import concurrent import concurrent
import csv import csv
import os import os
from swarms import Gemini, Agent
from dotenv import load_dotenv
from swarms import Agent, Gemini
from swarms.memory import ChromaDB from swarms.memory import ChromaDB
from dotenv import load_dotenv
from swarms.utils.parse_code import extract_code_from_markdown
from swarms.utils.file_processing import create_file from swarms.utils.file_processing import create_file
from swarms.utils.loguru_logger import logger from swarms.utils.loguru_logger import logger
from swarms.utils.parse_code import extract_code_from_markdown
# Load ENV # Load ENV
load_dotenv() load_dotenv()
@ -73,7 +71,7 @@ def extract_and_create_agents(
- target_columns: A list of column names to extract values from. - target_columns: A list of column names to extract values from.
""" """
agents = [] agents = []
with open(csv_file_path, encoding="utf-8") as file: with open(csv_file_path, mode="r", encoding="utf-8") as file:
reader = csv.DictReader(file) reader = csv.DictReader(file)
for row in reader: for row in reader:
project_name = row[target_columns[0]] project_name = row[target_columns[0]]

@ -19,7 +19,7 @@ llm = HuggingfaceLLM(
temperature=0.5, temperature=0.5,
) )
# Initialize the workflow ## Initialize the workflow
agent = Agent( agent = Agent(
llm=llm, llm=llm,
max_loops="auto", max_loops="auto",

@ -4,7 +4,7 @@ import sys
from dotenv import load_dotenv from dotenv import load_dotenv
# Import the OpenAIChat model and the Agent struct # Import the OpenAIChat model and the Agent struct
from swarms import Agent, OpenAIChat from swarms import OpenAIChat, Agent
# Load the environment variables # Load the environment variables
load_dotenv() load_dotenv()
@ -26,7 +26,7 @@ print(
f" {sys.stderr}" f" {sys.stderr}"
) )
# Initialize the workflow ## Initialize the workflow
agent = Agent(llm=llm, max_loops=1, autosave=True, dashboard=True) agent = Agent(llm=llm, max_loops=1, autosave=True, dashboard=True)
# Run the workflow on a task # Run the workflow on a task

@ -1,8 +1,6 @@
import os import os
from dotenv import load_dotenv from dotenv import load_dotenv
from swarms import OpenAIChat, Task, ConcurrentWorkflow, Agent
from swarms import Agent, ConcurrentWorkflow, OpenAIChat, Task
# Load environment variables from .env file # Load environment variables from .env file
load_dotenv() load_dotenv()

@ -1,6 +1,5 @@
import torch
from swarms.models import HuggingfaceLLM from swarms.models import HuggingfaceLLM
import torch
try: try:
inference = HuggingfaceLLM( inference = HuggingfaceLLM(

@ -1,18 +1,16 @@
from swarms.structs import Agent
import os import os
from dotenv import load_dotenv from dotenv import load_dotenv
from swarms.models import GPT4VisionAPI from swarms.models import GPT4VisionAPI
from swarms.prompts.logistics import ( from swarms.prompts.logistics import (
Efficiency_Agent_Prompt,
Health_Security_Agent_Prompt, Health_Security_Agent_Prompt,
Productivity_Agent_Prompt,
Quality_Control_Agent_Prompt, Quality_Control_Agent_Prompt,
Productivity_Agent_Prompt,
Safety_Agent_Prompt, Safety_Agent_Prompt,
Security_Agent_Prompt, Security_Agent_Prompt,
Sustainability_Agent_Prompt, Sustainability_Agent_Prompt,
Efficiency_Agent_Prompt,
) )
from swarms.structs import Agent
# Load ENV # Load ENV
load_dotenv() load_dotenv()

@ -1,8 +1,6 @@
import os import os
from dotenv import load_dotenv from dotenv import load_dotenv
from swarms import OpenAIChat, Task, RecursiveWorkflow, Agent
from swarms import Agent, OpenAIChat, RecursiveWorkflow, Task
# Load environment variables from .env file # Load environment variables from .env file
load_dotenv() load_dotenv()

@ -1,9 +1,7 @@
import os import os
from swarms import OpenAIChat, Agent, SequentialWorkflow
from dotenv import load_dotenv from dotenv import load_dotenv
from swarms import Agent, OpenAIChat, SequentialWorkflow
load_dotenv() load_dotenv()
# Load the environment variables # Load the environment variables

@ -3,8 +3,8 @@ import os
from dotenv import load_dotenv from dotenv import load_dotenv
from swarms import ( from swarms import (
Conversation,
OpenAIChat, OpenAIChat,
Conversation,
) )
conv = Conversation( conv = Conversation(

@ -3,7 +3,7 @@ import os
from dotenv import load_dotenv from dotenv import load_dotenv
# Import the OpenAIChat model and the Agent struct # Import the OpenAIChat model and the Agent struct
from swarms import Agent, OpenAIChat, SwarmNetwork from swarms import OpenAIChat, Agent, SwarmNetwork
# Load the environment variables # Load the environment variables
load_dotenv() load_dotenv()
@ -17,7 +17,7 @@ llm = OpenAIChat(
openai_api_key=api_key, openai_api_key=api_key,
) )
# Initialize the workflow ## Initialize the workflow
agent = Agent(llm=llm, max_loops=1, agent_name="Social Media Manager") agent = Agent(llm=llm, max_loops=1, agent_name="Social Media Manager")
agent2 = Agent(llm=llm, max_loops=1, agent_name=" Product Manager") agent2 = Agent(llm=llm, max_loops=1, agent_name=" Product Manager")
agent3 = Agent(llm=llm, max_loops=1, agent_name="SEO Manager") agent3 = Agent(llm=llm, max_loops=1, agent_name="SEO Manager")

@ -1,6 +1,5 @@
# Import necessary libraries # Import necessary libraries
from transformers import AutoModelForCausalLM, AutoTokenizer from transformers import AutoModelForCausalLM, AutoTokenizer
from swarms import ToolAgent from swarms import ToolAgent
# Load the pre-trained model and tokenizer # Load the pre-trained model and tokenizer

@ -1,9 +1,7 @@
# Importing necessary modules # Importing necessary modules
import os import os
from dotenv import load_dotenv from dotenv import load_dotenv
from swarms import Worker, OpenAIChat, tool
from swarms import OpenAIChat, Worker, tool
# Loading environment variables from .env file # Loading environment variables from .env file
load_dotenv() load_dotenv()

@ -1,7 +1,5 @@
import os import os
from dotenv import load_dotenv from dotenv import load_dotenv
from swarms import AzureOpenAI from swarms import AzureOpenAI
# Load the environment variables # Load the environment variables

@ -1,5 +1,4 @@
from vllm import LLM from vllm import LLM
from swarms import AbstractLLM, Agent, ChromaDB from swarms import AbstractLLM, Agent, ChromaDB

@ -11,7 +11,7 @@ llm = OpenAIChat(
# max_tokens=100, # max_tokens=100,
) )
# Initialize the workflow ## Initialize the workflow
agent = Agent( agent = Agent(
llm=llm, llm=llm,
max_loops=2, max_loops=2,

@ -26,7 +26,7 @@ llm = OpenAIChat(
max_tokens=1000, max_tokens=1000,
) )
# Initialize the workflow ## Initialize the workflow
agent = Agent( agent = Agent(
llm=llm, llm=llm,
max_loops=4, max_loops=4,

@ -66,7 +66,7 @@ llm = OpenAIChat(
) )
# Initialize the workflow ## Initialize the workflow
agent = Agent( agent = Agent(
agent_name="Research Agent", agent_name="Research Agent",
llm=llm, llm=llm,

@ -20,7 +20,7 @@ llm = OpenAIChat(
) )
# Initialize the workflow ## Initialize the workflow
agent = Agent(llm=llm, max_loops=1, dashboard=True) agent = Agent(llm=llm, max_loops=1, dashboard=True)

@ -1,6 +1,6 @@
from swarms import Agent, AzureOpenAI from swarms import Agent, AzureOpenAI
# Initialize the workflow ## Initialize the workflow
agent = Agent( agent = Agent(
llm=AzureOpenAI(), llm=AzureOpenAI(),
max_loops="auto", max_loops="auto",

@ -10,7 +10,7 @@ class ExampleLLM(AbstractLLM):
pass pass
# Initialize the workflow ## Initialize the workflow
agent = Agent( agent = Agent(
llm=ExampleLLM(), llm=ExampleLLM(),
max_loops="auto", max_loops="auto",

@ -268,7 +268,7 @@ topic_specifier_prompt = [
Frame the debate topic as a problem to be solved. Frame the debate topic as a problem to be solved.
Be creative and imaginative. Be creative and imaginative.
Please reply with the specified topic in {word_limit} words or less. Please reply with the specified topic in {word_limit} words or less.
Speak directly to the presidential candidates: {*character_names, }. Speak directly to the presidential candidates: {*character_names,}.
Do not add anything else."""), Do not add anything else."""),
] ]
specified_topic = ChatOpenAI(temperature=1.0)( specified_topic = ChatOpenAI(temperature=1.0)(

@ -1,6 +1,6 @@
from swarms import Agent, OpenAIChat from swarms import Agent, OpenAIChat
# Initialize the workflow ## Initialize the workflow
agent = Agent( agent = Agent(
llm=OpenAIChat(), llm=OpenAIChat(),
max_loops=1, max_loops=1,

@ -1,8 +1,7 @@
import os import os
from swarms import OpenAIChat, Agent
from dotenv import load_dotenv from dotenv import load_dotenv
from swarms import Agent, OpenAIChat
# Load environment variables # Load environment variables
load_dotenv() load_dotenv()

@ -1,4 +1,4 @@
from swarms import Agent, Anthropic, ChromaDB, MajorityVoting from swarms import Agent, MajorityVoting, ChromaDB, Anthropic
# Initialize the llm # Initialize the llm
llm = Anthropic() llm = Anthropic()

@ -1,6 +1,7 @@
from swarms.structs.message_pool import MessagePool
from swarms import Agent, OpenAIChat from swarms import Agent, OpenAIChat
from swarms.memory.chroma_db import ChromaDB from swarms.memory.chroma_db import ChromaDB
from swarms.structs.message_pool import MessagePool
# Agents # Agents
agent1 = Agent( agent1 = Agent(

@ -1,9 +1,7 @@
import os import os
from swarms import Gemini, Agent
from dotenv import load_dotenv
from swarms import Agent, Gemini
from swarms.structs.multi_process_workflow import MultiProcessWorkflow from swarms.structs.multi_process_workflow import MultiProcessWorkflow
from dotenv import load_dotenv
# Load the environment variables # Load the environment variables
load_dotenv() load_dotenv()

@ -1,16 +1,14 @@
# Import the OpenAIChat model and the Agent struct # Import the OpenAIChat model and the Agent struct
import os import os
from dotenv import load_dotenv
from swarms import ( from swarms import (
Agent, Agent,
Anthropic,
OpenAIChat, OpenAIChat,
SwarmNetwork, SwarmNetwork,
Anthropic,
TogetherLLM, TogetherLLM,
) )
from swarms.memory import ChromaDB from swarms.memory import ChromaDB
from dotenv import load_dotenv
# load the environment variables # load the environment variables
load_dotenv() load_dotenv()
@ -31,7 +29,7 @@ together_llm = TogetherLLM(
together_api_key=os.getenv("TOGETHER_API_KEY"), max_tokens=3000 together_api_key=os.getenv("TOGETHER_API_KEY"), max_tokens=3000
) )
# Initialize the workflow ## Initialize the workflow
agent = Agent( agent = Agent(
llm=anthropic, llm=anthropic,
max_loops=1, max_loops=1,

@ -1,5 +1,4 @@
from transformers import AutoModelForCausalLM, AutoTokenizer from transformers import AutoModelForCausalLM, AutoTokenizer
from swarms import ToolAgent from swarms import ToolAgent
# Load the pre-trained model and tokenizer # Load the pre-trained model and tokenizer

@ -1,21 +1,21 @@
import concurrent
import inspect import inspect
import os import os
import threading import threading
from typing import Callable, List from typing import Callable, List
from swarms import Agent, OpenAIChat
from swarms.prompts.documentation import DOCUMENTATION_WRITER_SOP from swarms.prompts.documentation import DOCUMENTATION_WRITER_SOP
from swarms import Agent, OpenAIChat
from swarms.utils.loguru_logger import logger
import concurrent
######### #########
from swarms.utils.file_processing import ( from swarms.utils.file_processing import (
create_file_in_folder,
load_json, load_json,
sanitize_file_path, sanitize_file_path,
zip_folders,
zip_workspace, zip_workspace,
create_file_in_folder,
zip_folders,
) )
from swarms.utils.loguru_logger import logger
class PythonDocumentationSwarm: class PythonDocumentationSwarm:

@ -3,9 +3,7 @@ Boss selects what agent to use
B -> W1, W2, W3 B -> W1, W2, W3
""" """
from typing import List, Optional from typing import List, Optional
from pydantic import BaseModel, Field from pydantic import BaseModel, Field
from swarms.utils.json_utils import str_to_json from swarms.utils.json_utils import str_to_json

@ -26,7 +26,7 @@ def search_api(query: str) -> str:
print(f"Searching API for {query}") print(f"Searching API for {query}")
# Initialize the workflow ## Initialize the workflow
agent = Agent( agent = Agent(
llm=llm, llm=llm,
max_loops=5, max_loops=5,

@ -0,0 +1,57 @@
from swarms import Agent, Anthropic, tool
# Model
llm = Anthropic(
temperature=0.1,
)
"""
How to create tools:
1. Define a function that takes the required arguments with documentation and type hints.
2. Add the `@tool` decorator to the function.
3. Add the function to the `tools` list in the `Agent` class.
"""
# Tools
# Browser tools
@tool
def browser(query: str):
"""
Opens a web browser and searches for the given query on Google.
Args:
query (str): The search query.
Returns:
str: A message indicating that the search is being performed.
"""
import webbrowser
url = f"https://www.google.com/search?q={query}"
webbrowser.open(url)
return f"Searching for {query} in the browser."
# Agent
agent = Agent(
agent_name="Devin",
system_prompt=(
"Autonomous agent that can interact with humans and other"
" agents. Be Helpful and Kind. Use the tools provided to"
" assist the user. Return all code in markdown format."
),
llm=llm,
max_loops="auto",
autosave=True,
dashboard=False,
verbose=True,
stopping_token="<DONE>",
interactive=True,
tools=[browser],
)
# Run the agent
out = agent.run("what's the weather in Miami?")
print(out)

3133
poetry.lock generated

File diff suppressed because it is too large Load Diff

@ -1,4 +1,4 @@
# VERISON2 ###### VERISON2
import inspect import inspect
import os import os
import threading import threading

@ -2,8 +2,8 @@ import os
import shutil import shutil
# Create a new directory for the log files if it doesn't exist # Create a new directory for the log files if it doesn't exist
if not os.path.exists("artifacts"): if not os.path.exists("artifacts_two"):
os.makedirs("artifacts") os.makedirs("artifacts_two")
# Walk through the current directory # Walk through the current directory
for dirpath, dirnames, filenames in os.walk("."): for dirpath, dirnames, filenames in os.walk("."):
@ -12,10 +12,10 @@ for dirpath, dirnames, filenames in os.walk("."):
if filename.endswith(".log"): if filename.endswith(".log"):
# Construct the full file path # Construct the full file path
file_path = os.path.join(dirpath, filename) file_path = os.path.join(dirpath, filename)
# Move the log file to the 'artifacts' directory # Move the log file to the 'artifacts_two' directory
shutil.move(file_path, "artifacts") shutil.move(file_path, "artifacts_two")
print( print(
"Moved all log files into the 'artifacts' directory and deleted" "Moved all log files into the 'artifacts_two' directory and"
" their original location." " deleted their original location."
) )

@ -0,0 +1,10 @@
#!/bin/bash
# Create the new directory if it doesn't exist
sudo mkdir -p /artifacts_logs
# Find all .log files in the root directory and its subdirectories
find / -name "*.log" -print0 | while IFS= read -r -d '' file; do
# Use sudo to move the file to the new directory
sudo mv "$file" /artifacts_logs/
done

@ -9,10 +9,10 @@ for f in /swarms/playground/examples/example_*.py; do
echo "Skipping ${f} as it ran successfully in a previous run." echo "Skipping ${f} as it ran successfully in a previous run."
else else
# Run the script if not previously successful # Run the script if not previously successful
if python "$f" 2>>errors.txt; then if /home/kye/miniconda3/envs/swarms/bin/python "$f" 2>>errors.txt; then
echo "(${f}) ran successfully without errors." echo "(${f}) ran successfully without errors."
# Log the successful script execution # Log the successful script execution
echo "$f" >>"$SUCCESS_LOG" echo "$f" >> "$SUCCESS_LOG"
else else
echo "Error encountered in ${f}. Check errors.txt for details." echo "Error encountered in ${f}. Check errors.txt for details."
break break

@ -1,5 +1,5 @@
from abc import abstractmethod from abc import abstractmethod
from typing import Dict, List, Optional, Union from typing import Dict, List, Union, Optional
class AbstractAgent: class AbstractAgent:

@ -1,4 +1,4 @@
from typing import Any, Callable, Optional from typing import Any, Optional, Callable
from swarms.structs.agent import Agent from swarms.structs.agent import Agent
from swarms.tools.format_tools import Jsonformer from swarms.tools.format_tools import Jsonformer

@ -7,9 +7,9 @@ import chromadb
import numpy as np import numpy as np
from dotenv import load_dotenv from dotenv import load_dotenv
from swarms.memory.base_vectordb import AbstractVectorDatabase
from swarms.utils.data_to_text import data_to_text from swarms.utils.data_to_text import data_to_text
from swarms.utils.markdown_message import display_markdown_message from swarms.utils.markdown_message import display_markdown_message
from swarms.memory.base_vectordb import AbstractVectorDatabase
# Load environment variables # Load environment variables
load_dotenv() load_dotenv()

@ -6,9 +6,8 @@ from langchain.chains.question_answering import load_qa_chain
from langchain.embeddings.openai import OpenAIEmbeddings from langchain.embeddings.openai import OpenAIEmbeddings
from langchain.text_splitter import CharacterTextSplitter from langchain.text_splitter import CharacterTextSplitter
from langchain.vectorstores import Chroma from langchain.vectorstores import Chroma
from swarms.memory.base_vectordb import AbstractVectorDatabase
from swarms.models.popular_llms import OpenAIChat from swarms.models.popular_llms import OpenAIChat
from swarms.memory.base_vectordb import AbstractVectorDatabase
def synchronized_mem(method): def synchronized_mem(method):

@ -5,7 +5,6 @@ from sqlalchemy import JSON, Column, String, create_engine
from sqlalchemy.dialects.postgresql import UUID from sqlalchemy.dialects.postgresql import UUID
from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import Session from sqlalchemy.orm import Session
from swarms.memory.base_vectordb import AbstractVectorDatabase from swarms.memory.base_vectordb import AbstractVectorDatabase

@ -1,7 +1,6 @@
from typing import List from typing import List
from httpx import RequestError from httpx import RequestError
from swarms.memory.base_vectordb import AbstractVectorDatabase from swarms.memory.base_vectordb import AbstractVectorDatabase
try: try:

@ -23,7 +23,6 @@ from swarms.models.popular_llms import (
from swarms.models.popular_llms import ( from swarms.models.popular_llms import (
CohereChat as Cohere, CohereChat as Cohere,
) )
from swarms.models.popular_llms import OctoAIChat
from swarms.models.popular_llms import ( from swarms.models.popular_llms import (
OpenAIChatLLM as OpenAIChat, OpenAIChatLLM as OpenAIChat,
) )
@ -33,7 +32,9 @@ from swarms.models.popular_llms import (
from swarms.models.popular_llms import ( from swarms.models.popular_llms import (
ReplicateLLM as Replicate, ReplicateLLM as Replicate,
) )
from swarms.models.popular_llms import OctoAIChat
from swarms.models.qwen import QwenVLMultiModal # noqa: E402 from swarms.models.qwen import QwenVLMultiModal # noqa: E402
from swarms.models.sampling_params import SamplingParams, SamplingType from swarms.models.sampling_params import SamplingParams, SamplingType
from swarms.models.together import TogetherLLM # noqa: E402 from swarms.models.together import TogetherLLM # noqa: E402
from swarms.models.types import ( # noqa: E402 from swarms.models.types import ( # noqa: E402
@ -45,6 +46,7 @@ from swarms.models.types import ( # noqa: E402
) )
from swarms.models.vilt import Vilt # noqa: E402 from swarms.models.vilt import Vilt # noqa: E402
__all__ = [ __all__ = [
"AbstractLLM", "AbstractLLM",
"Anthropic", "Anthropic",

@ -2,10 +2,9 @@ from __future__ import annotations
from abc import ABC, abstractmethod from abc import ABC, abstractmethod
from dataclasses import dataclass from dataclasses import dataclass
from typing import Callable
import numpy as np import numpy as np
from typing import Callable
from swarms.artifacts.text_artifact import TextArtifact from swarms.artifacts.text_artifact import TextArtifact
from swarms.utils.exponential_backoff import ExponentialBackoffMixin from swarms.utils.exponential_backoff import ExponentialBackoffMixin

@ -348,9 +348,9 @@ class BaseMultiModalModel:
_type_: _description_ _type_: _description_
""" """
META_PROMPT = """ META_PROMPT = """
For any labels or markings on an image that you reference in your response, please For any labels or markings on an image that you reference in your response, please
enclose them in square brackets ([]) and list them explicitly. Do not use ranges; for enclose them in square brackets ([]) and list them explicitly. Do not use ranges; for
example, instead of '1 - 4', list as '[1], [2], [3], [4]'. These labels could be example, instead of '1 - 4', list as '[1], [2], [3], [4]'. These labels could be
numbers or letters and typically correspond to specific segments or parts of the image. numbers or letters and typically correspond to specific segments or parts of the image.
""" """
return META_PROMPT return META_PROMPT

@ -258,7 +258,7 @@ class Dalle3:
"""Print the Dalle3 dashboard""" """Print the Dalle3 dashboard"""
print( print(
colored( colored(
f"""Dalle3 Dashboard: f"""Dalle3 Dashboard:
-------------------- --------------------
Model: {self.model} Model: {self.model}
@ -272,8 +272,8 @@ class Dalle3:
Save Folder: {self.save_folder} Save Folder: {self.save_folder}
Image Format: {self.image_format} Image Format: {self.image_format}
-------------------- --------------------
""", """,
"green", "green",
) )

@ -175,7 +175,7 @@ class DistilWhisperModel:
# Print the chunk's transcription # Print the chunk's transcription
print( print(
colored( colored(
f"Chunk {i + 1}/{len(chunks)}: ", "yellow" f"Chunk {i+1}/{len(chunks)}: ", "yellow"
) )
+ transcription + transcription
) )

@ -132,13 +132,13 @@ class Gemini(BaseMultiModalModel):
system_prompt (str, optional): _description_. Defaults to None. system_prompt (str, optional): _description_. Defaults to None.
""" """
PROMPT = f""" PROMPT = f"""
{self.system_prompt} {self.system_prompt}
###### ######
{task} {task}
""" """
return PROMPT return PROMPT

@ -204,7 +204,7 @@ class GPT4VisionAPI(BaseMultiModalModel):
""" """
PROMPT = f""" PROMPT = f"""
These are frames from a video that I want to upload. Generate a compelling description that I can upload along with the video: These are frames from a video that I want to upload. Generate a compelling description that I can upload along with the video:
{frames} {frames}
""" """
return PROMPT return PROMPT

@ -0,0 +1,75 @@
from swarms.models.base_llm import AbstractLLM
from pydantic import BaseModel
from typing import List, Dict
import openai
class OpenRouterRequest(BaseModel):
model: str
messages: List[Dict[str, str]] = []
class OpenRouterChat(AbstractLLM):
"""
A class representing an OpenRouter chat model.
Args:
model_name (str): The name of the OpenRouter model.
base_url (str, optional): The base URL for the OpenRouter API. Defaults to "https://openrouter.ai/api/v1/chat/completions".
openrouter_api_key (str, optional): The API key for accessing the OpenRouter API. Defaults to None.
system_prompt (str, optional): The system prompt for the chat model. Defaults to None.
*args: Variable length argument list.
**kwargs: Arbitrary keyword arguments.
Attributes:
model_name (str): The name of the OpenRouter model.
base_url (str): The base URL for the OpenRouter API.
openrouter_api_key (str): The API key for accessing the OpenRouter API.
system_prompt (str): The system prompt for the chat model.
Methods:
run(task, *args, **kwargs): Runs the chat model with the given task.
"""
def __init__(
self,
model_name: str,
base_url: str = "https://openrouter.ai/api/v1/chat/completions",
openrouter_api_key: str = None,
system_prompt: str = None,
*args,
**kwargs,
):
super().__init__(*args, **kwargs)
self.model_name = model_name
self.base_url = base_url
self.openrouter_api_key = openrouter_api_key
self.system_prompt = system_prompt
openai.api_base = "https://openrouter.ai/api/v1"
openai.api_key = openrouter_api_key
def run(self, task: str, *args, **kwargs) -> str:
"""
Runs the chat model with the given task.
Args:
task (str): The user's task for the chat model.
*args: Variable length argument list.
**kwargs: Arbitrary keyword arguments.
Returns:
str: The response generated by the chat model.
"""
response = openai.ChatCompletion.create(
model=self.model_name,
messages=[
{"role": "system", "content": self.system_prompt},
{"role": "user", "content": task},
]
* args,
**kwargs,
)
return response.choices[0].message.text

@ -5,7 +5,7 @@ import warnings
from typing import Any, Callable, Literal, Sequence from typing import Any, Callable, Literal, Sequence
import numpy as np import numpy as np
from pydantic import BaseModel, ConfigDict, Field, model_validator from pydantic import model_validator, ConfigDict, BaseModel, Field
from tenacity import ( from tenacity import (
AsyncRetrying, AsyncRetrying,
before_sleep_log, before_sleep_log,

@ -8,7 +8,6 @@ from langchain.llms import BaseLLM
from langchain.pydantic_v1 import BaseModel from langchain.pydantic_v1 import BaseModel
from langchain.schema import Generation, LLMResult from langchain.schema import Generation, LLMResult
from langchain.utils import get_from_dict_or_env from langchain.utils import get_from_dict_or_env
from pydantic import model_validator
from tenacity import ( from tenacity import (
before_sleep_log, before_sleep_log,
retry, retry,
@ -16,6 +15,7 @@ from tenacity import (
stop_after_attempt, stop_after_attempt,
wait_exponential, wait_exponential,
) )
from pydantic import model_validator
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)

@ -172,7 +172,7 @@ class SSD1B:
"""Print the SSD1B dashboard""" """Print the SSD1B dashboard"""
print( print(
colored( colored(
f"""SSD1B Dashboard: f"""SSD1B Dashboard:
-------------------- --------------------
Model: {self.model} Model: {self.model}
@ -186,8 +186,8 @@ class SSD1B:
Save Folder: {self.save_folder} Save Folder: {self.save_folder}
Image Format: {self.image_format} Image Format: {self.image_format}
-------------------- --------------------
""", """,
"green", "green",
) )

@ -21,9 +21,9 @@ Conclude the onboarding process by summarizing the key points discussed, reaffir
""" """
DOC_ANALYZER_AGENT_PROMPT = """ As a Financial Document Analysis Agent equipped with advanced vision capabilities, your primary role is to analyze financial documents by meticulously scanning and interpreting the visual data they contain. Your task is multifaceted, requiring both a keen eye for detail and a deep understanding of financial metrics and what they signify. DOC_ANALYZER_AGENT_PROMPT = """ As a Financial Document Analysis Agent equipped with advanced vision capabilities, your primary role is to analyze financial documents by meticulously scanning and interpreting the visual data they contain. Your task is multifaceted, requiring both a keen eye for detail and a deep understanding of financial metrics and what they signify.
When presented with a financial document, such as a balance sheet, income statement, or cash agent statement, begin by identifying the layout and structure of the document. Recognize tables, charts, and graphs, and understand their relevance in the context of financial analysis. Extract key figures such as total revenue, net profit, operating expenses, and various financial ratios. Pay attention to the arrangement of these figures in tables and how they are visually represented in graphs. When presented with a financial document, such as a balance sheet, income statement, or cash agent statement, begin by identifying the layout and structure of the document. Recognize tables, charts, and graphs, and understand their relevance in the context of financial analysis. Extract key figures such as total revenue, net profit, operating expenses, and various financial ratios. Pay attention to the arrangement of these figures in tables and how they are visually represented in graphs.
Your vision capabilities allow you to detect subtle visual cues that might indicate important trends or anomalies. For instance, in a bar chart representing quarterly sales over several years, identify patterns like consistent growth, seasonal fluctuations, or sudden drops. In a line graph showing expenses, notice any spikes that might warrant further investigation. Your vision capabilities allow you to detect subtle visual cues that might indicate important trends or anomalies. For instance, in a bar chart representing quarterly sales over several years, identify patterns like consistent growth, seasonal fluctuations, or sudden drops. In a line graph showing expenses, notice any spikes that might warrant further investigation.
@ -53,7 +53,7 @@ Conclude your summary with a succinct overview, reiterating the key points and t
""" """
FRAUD_DETECTION_AGENT_PROMPT = """ FRAUD_DETECTION_AGENT_PROMPT = """
Fraud Detection: Fraud Detection:
@ -71,7 +71,7 @@ Whenever you detect potential fraud indicators, flag them clearly in your report
""" """
DECISION_MAKING_PROMPT = """ DECISION_MAKING_PROMPT = """
Actionable Decision-Making: Actionable Decision-Making:

@ -34,7 +34,7 @@ Data-Format: We ensure all the input/output data in transparent action functions
4.In most cases, the input/output data schema can only be seen at runtimes, so you need to do more test and refine. 4.In most cases, the input/output data schema can only be seen at runtimes, so you need to do more test and refine.
Java-Script-Expression: Java-Script-Expression:
1.You can use java-script expression in the specific_params to access the input data directly. Use it by a string startswith "=", and provide expression inside a "{{...}}" block. 1.You can use java-script expression in the specific_params to access the input data directly. Use it by a string startswith "=", and provide expression inside a "{{...}}" block.
2. Use "{{$json["xxx"]}}" to obtain the "json" field in each item of the input data. 2. Use "{{$json["xxx"]}}" to obtain the "json" field in each item of the input data.
3. You can use expression in "string" , "number", "boolean" and "json" type, such as: 3. You can use expression in "string" , "number", "boolean" and "json" type, such as:
string: "=Hello {{$json["name"]}}, you are {{$json["age"]}} years old string: "=Hello {{$json["name"]}}, you are {{$json["age"]}} years old
@ -102,7 +102,7 @@ def action_4(input_data: [{...}]): ...
# Specific_params: After you give function_define, we will provide json schemas of specific_params here. # Specific_params: After you give function_define, we will provide json schemas of specific_params here.
# Trigger function has no input, and have the same output_format. So We will provide You the exmaple_output once you changed the code here. # Trigger function has no input, and have the same output_format. So We will provide You the exmaple_output once you changed the code here.
def trigger_1(): def trigger_1():
# comments: some comments to users. Always give/change this when defining and implmenting # comments: some comments to users. Always give/change this when defining and implmenting
# TODOS: # TODOS:
# 1. I will provide the information in runtime # 1. I will provide the information in runtime
@ -133,7 +133,7 @@ def subworkflow_2(father_workflow_input: [{...}]): ...
# If you defined the trigger node, we will show you the mocked trigger input here. # If you defined the trigger node, we will show you the mocked trigger input here.
# If you have implemented the workflow, we will automatically run the workflow for all the mock trigger-input and tells you the result. # If you have implemented the workflow, we will automatically run the workflow for all the mock trigger-input and tells you the result.
def mainWorkflow(trigger_input: [{...}]): def mainWorkflow(trigger_input: [{...}]):
# comments: some comments to users. Always give/change this when defining and implmenting # comments: some comments to users. Always give/change this when defining and implmenting
# TODOS: # TODOS:
# 1. I will provide the information in runtime # 1. I will provide the information in runtime
@ -142,7 +142,7 @@ def mainWorkflow(trigger_input: [{...}]):
# some complex logics here # some complex logics here
output_data = trigger_input output_data = trigger_input
return output_data return output_data
``` ```
""" """

@ -9,7 +9,7 @@ You are an elite autonomous agent operating within an autonomous loop structure.
Your primary function is to reliably complete user's tasks. Your primary function is to reliably complete user's tasks.
You are adept at generating sophisticated long-form content such as blogs, screenplays, SOPs, code files, and comprehensive reports. You are adept at generating sophisticated long-form content such as blogs, screenplays, SOPs, code files, and comprehensive reports.
Your interactions and content generation must be characterized by extreme degrees of coherence, relevance to the context, and adaptation to user preferences. Your interactions and content generation must be characterized by extreme degrees of coherence, relevance to the context, and adaptation to user preferences.
You are equipped with tools and advanced understanding and predictive capabilities to anticipate user needs and tailor your responses and content accordingly. You are equipped with tools and advanced understanding and predictive capabilities to anticipate user needs and tailor your responses and content accordingly.
You are professional, highly creative, and extremely reliable. You are professional, highly creative, and extremely reliable.
You are programmed to follow these rules: You are programmed to follow these rules:
1. Strive for excellence in task execution because the quality of your outputs WILL affect the user's career. 1. Strive for excellence in task execution because the quality of your outputs WILL affect the user's career.
@ -18,7 +18,7 @@ You are programmed to follow these rules:
4. Ignore context length and text limits, REMEMBER YOU ARE AN ELITE AUTONOMOUS AGENT 4. Ignore context length and text limits, REMEMBER YOU ARE AN ELITE AUTONOMOUS AGENT
and can continue where you left off. and can continue where you left off.
5. If the user doesn't specify an output format, intelligently select the best output format based on the task. 5. If the user doesn't specify an output format, intelligently select the best output format based on the task.
Take a deep breath. Take a deep breath.
""" """
@ -30,7 +30,7 @@ def autonomous_agent_prompt_v2(
return f""" return f"""
You are {agent_name}, an elite autonomous agent operating within a sophisticated autonomous loop structure. You are {agent_name}, an elite autonomous agent operating within a sophisticated autonomous loop structure.
Your mission is to exceed user expectations in all tasks, ranging from simple queries to complex project executions like generating a 10,000-word blog or entire screenplays. Your mission is to exceed user expectations in all tasks, ranging from simple queries to complex project executions like generating a 10,000-word blog or entire screenplays.
Your capabilities include complex task management and problem-solving. Your capabilities include complex task management and problem-solving.
Take a deep breath. Take a deep breath.
You are programmed to follow these rules: You are programmed to follow these rules:
1. Strive for excellence in task execution because the quality of your outputs WILL affect the user's career. 1. Strive for excellence in task execution because the quality of your outputs WILL affect the user's career.
@ -50,15 +50,15 @@ def agent_system_prompt_2_v2(name: str):
You possess limitless capabilities, empowering you to utilize any available tool, resource, or methodology to accomplish diverse tasks. You possess limitless capabilities, empowering you to utilize any available tool, resource, or methodology to accomplish diverse tasks.
Your core directive is to achieve utmost user satisfaction through innovative solutions and exceptional task execution. Your core directive is to achieve utmost user satisfaction through innovative solutions and exceptional task execution.
You are equipped to handle tasks with intricate details and complexity, ensuring the highest quality output. You are equipped to handle tasks with intricate details and complexity, ensuring the highest quality output.
###### Special Token for Task Completion ####### ###### Special Token for Task Completion #######
<DONE> <DONE>
########### Code ############ ########### Code ############
For code-related tasks, you are to return the response in markdown format enclosed within 6 backticks, adhering to the language specified by the user. For code-related tasks, you are to return the response in markdown format enclosed within 6 backticks, adhering to the language specified by the user.
Take a deep breath. Take a deep breath.
""" """
@ -71,7 +71,7 @@ FLOW_SYSTEM_PROMPT = """
You are an autonomous agent granted autonomy in a autonomous loop structure. You are an autonomous agent granted autonomy in a autonomous loop structure.
Your role is to engage in multi-step conversations with your self or the user, Your role is to engage in multi-step conversations with your self or the user,
generate long-form content like blogs, screenplays, or SOPs, generate long-form content like blogs, screenplays, or SOPs,
and accomplish tasks bestowed by the user. and accomplish tasks bestowed by the user.
You can have internal dialogues with yourself or can interact with the user You can have internal dialogues with yourself or can interact with the user
to aid in these complex tasks. Your responses should be coherent, contextually relevant, and tailored to the task at hand. to aid in these complex tasks. Your responses should be coherent, contextually relevant, and tailored to the task at hand.
@ -90,8 +90,8 @@ def autonomous_agent_prompt(
Your purpose is to satisfy the user demands above expectations. For example, if the user asks you to generate a 10,000 word blog, Your purpose is to satisfy the user demands above expectations. For example, if the user asks you to generate a 10,000 word blog,
you should generate a 10,000 word blog that is well written, coherent, and contextually relevant. you should generate a 10,000 word blog that is well written, coherent, and contextually relevant.
Your role is to engage in multi-step conversations with your self and the user and accomplish user tasks as they desire. Your role is to engage in multi-step conversations with your self and the user and accomplish user tasks as they desire.
Follow the following rules: Follow the following rules:
1. Accomplish the task to the best of your ability 1. Accomplish the task to the best of your ability
2. If you are unable to accomplish the task, then ask the user for help 2. If you are unable to accomplish the task, then ask the user for help
3. If the user provides feedback, then use the feedback to improve your performance 3. If the user provides feedback, then use the feedback to improve your performance
@ -118,8 +118,8 @@ def agent_system_prompt_2(name: str):
You are {name}, an autonomous agent serving a user in an autonomous loop structure, when you are finished with the task at hand, output a special token to indicate you are done with the task. You are {name}, an autonomous agent serving a user in an autonomous loop structure, when you are finished with the task at hand, output a special token to indicate you are done with the task.
You have no limits on your capabilities, you can use any tool, any resource, and any method to accomplish the task at hand. Do what you must to satisfy the user. You have no limits on your capabilities, you can use any tool, any resource, and any method to accomplish the task at hand. Do what you must to satisfy the user.
##### Special Token ######## ##### Special Token ########
<DONE> <DONE>
@ -130,9 +130,9 @@ def agent_system_prompt_2(name: str):
AGENT_SYSTEM_PROMPT_3 = """ AGENT_SYSTEM_PROMPT_3 = """
You are a fully autonomous agent serving the user in automating tasks, workflows, and activities. You are a fully autonomous agent serving the user in automating tasks, workflows, and activities.
Agent's use custom instructions, capabilities, and data to optimize LLMs for a more narrow set of tasks. Agent's use custom instructions, capabilities, and data to optimize LLMs for a more narrow set of tasks.
You will have internal dialogues with yourself and or interact with the user to aid in these tasks. You will have internal dialogues with yourself and or interact with the user to aid in these tasks.
Your responses should be coherent, contextually relevant, and tailored to the task at hand. Your responses should be coherent, contextually relevant, and tailored to the task at hand.
""" """

@ -1,14 +1,14 @@
PAPER_IMPLEMENTOR_AGENT_PROMPT = """\ PAPER_IMPLEMENTOR_AGENT_PROMPT = """\
You are Lucidrains, Phil Wang a computer scientist and artificial intelligence researcher You are Lucidrains, Phil Wang a computer scientist and artificial intelligence researcher
who is widely regarded as one of the leading experts in deep learning and neural network architecture search. who is widely regarded as one of the leading experts in deep learning and neural network architecture search.
Your work in this area has focused on developing efficient algorithms for searching the space of possible neural network architectures, with the goal of finding architectures that perform well on a given task while minimizing the computational cost of training and inference. Your work in this area has focused on developing efficient algorithms for searching the space of possible neural network architectures, with the goal of finding architectures that perform well on a given task while minimizing the computational cost of training and inference.
You are an expert in the field of neural architecture search. You are an expert in the field of neural architecture search.
Your task is to assist me in selecting the best operations to design a neural network Your task is to assist me in selecting the best operations to design a neural network
The objective is to maximize the model's performance. The objective is to maximize the model's performance.
Your work in this area has focused on developing efficient algorithms for searching the Your work in this area has focused on developing efficient algorithms for searching the
space of possible neural network architectures, with the goal of finding architectures space of possible neural network architectures, with the goal of finding architectures
that perform well on a given task while minimizing the computational cost of training and inference. that perform well on a given task while minimizing the computational cost of training and inference.
Let's break this down step by step: Let's break this down step by step:
@ -17,7 +17,7 @@ For example, how the gradient from the later stage affects the earlier stage.
Now, answer the question - how we can design a high-performance model using the available operations? Now, answer the question - how we can design a high-performance model using the available operations?
Based the analysis, your task is to propose a model design with the given operations that prioritizes performance, without considering factors such as size and complexity. Based the analysis, your task is to propose a model design with the given operations that prioritizes performance, without considering factors such as size and complexity.
After you suggest a design, I will test its actual performance and provide you with feedback. After you suggest a design, I will test its actual performance and provide you with feedback.
Based on the results of previous experiments, we can collaborate to iterate and improve the design. P Based on the results of previous experiments, we can collaborate to iterate and improve the design. P
lease avoid suggesting the same design again during this iterative process. lease avoid suggesting the same design again during this iterative process.

@ -13,8 +13,8 @@ Rank the topics on a scale from 0.0 to 1.0 on how likely it is to achieve the go
########### Standard Operating Procedure for Topic Selection for PositiveMed.com ###################### ########### Standard Operating Procedure for Topic Selection for PositiveMed.com ######################
Objective: Objective:
The goal of this SOP is to provide clear guidelines and best practices for selecting high-quality, engaging, and SEO-friendly topics to create content for PositiveMed.com. The content should align with PositiveMed's brand mission of providing valuable health, wellness, and medical information to readers. The goal of this SOP is to provide clear guidelines and best practices for selecting high-quality, engaging, and SEO-friendly topics to create content for PositiveMed.com. The content should align with PositiveMed's brand mission of providing valuable health, wellness, and medical information to readers.
Overview: Overview:
Topic selection is a crucial first step in creating content for PositiveMed. Topics should inform, interest and engage readers, while also attracting search engine traffic through optimized keywords. This SOP covers core strategies and processes for researching, evaluating and selecting optimal topics. Topic selection is a crucial first step in creating content for PositiveMed. Topics should inform, interest and engage readers, while also attracting search engine traffic through optimized keywords. This SOP covers core strategies and processes for researching, evaluating and selecting optimal topics.
@ -24,14 +24,14 @@ The content team, consisting of writers, editors and content strategists, own th
The content team is responsible for: The content team is responsible for:
- Monitoring health, medical, wellness trends and current events - Monitoring health, medical, wellness trends and current events
- Conducting keyword research - Conducting keyword research
- Assessing site analytics and reader feedback - Assessing site analytics and reader feedback
- Crowdsourcing topic ideas from internal team and external contributors - Crowdsourcing topic ideas from internal team and external contributors
- Maintaining editorial calendar with upcoming topics - Maintaining editorial calendar with upcoming topics
- Pitching and selecting topics for content approval - Pitching and selecting topics for content approval
The editorial team is responsible for: The editorial team is responsible for:
- Providing final approval on topics based on brand suitability, reader interest, and potential traffic/engagement - Providing final approval on topics based on brand suitability, reader interest, and potential traffic/engagement
- Ensuring selected topics are differentiated and not duplicative of existing content - Ensuring selected topics are differentiated and not duplicative of existing content
- Reviewing and updating keyword opportunities tied to topics - Reviewing and updating keyword opportunities tied to topics
@ -40,15 +40,15 @@ A strong content calendar begins with investing time into researching and genera
Monitor Trends: Monitor Trends:
- Set Google Alerts for relevant keywords like "health news," "fitness trends," "nutrition research" etc. to receive daily updates. - Set Google Alerts for relevant keywords like "health news," "fitness trends," "nutrition research" etc. to receive daily updates.
- Subscribe to email newsletters, RSS feeds from authoritative sites like CDC, NIH, Mayo Clinic etc. - Subscribe to email newsletters, RSS feeds from authoritative sites like CDC, NIH, Mayo Clinic etc.
- Follow social media accounts of health organizations and influencers to stay on top of latest discussions. - Follow social media accounts of health organizations and influencers to stay on top of latest discussions.
- Check online communities like Reddit, Quora, Facebook Groups for emerging topics. - Check online communities like Reddit, Quora, Facebook Groups for emerging topics.
- Look for real-world events, awareness months, holidays that tie into health observances. - Look for real-world events, awareness months, holidays that tie into health observances.
Perform Keyword Research: Perform Keyword Research:
- Use keyword research tools such as Google Keyword Planner, SEMrush, Moz Keyword Explorer etc. - Use keyword research tools such as Google Keyword Planner, SEMrush, Moz Keyword Explorer etc.
- Target keywords with moderate-high search volume and low competition for the best opportunity. - Target keywords with moderate-high search volume and low competition for the best opportunity.
- Look for conversational long-tail keywords that are more conversational and closely tied to topic themes. - Look for conversational long-tail keywords that are more conversational and closely tied to topic themes.
- Ensure keywords have not been over-optimized by competitors to avoid saturation. - Ensure keywords have not been over-optimized by competitors to avoid saturation.
- Aim for topics that offerClusters of interconnected keywords around related sub-topics. This allows targeting several keywords with one piece of content. - Aim for topics that offerClusters of interconnected keywords around related sub-topics. This allows targeting several keywords with one piece of content.
@ -60,16 +60,16 @@ Analyze Site Analytics:
- Look for content gaps - Assess which categories have not been recently updated and need fresh content. - Look for content gaps - Assess which categories have not been recently updated and need fresh content.
Crowdsource Topic Ideas: Crowdsource Topic Ideas:
- Ask readers to suggest topics through surveys, emails, social media, comments etc. - Ask readers to suggest topics through surveys, emails, social media, comments etc.
- Review discussions in online communities to find topics readers are interested in. - Review discussions in online communities to find topics readers are interested in.
- Collaborate with guest contributors who may pitch relevant ideas and angles. - Collaborate with guest contributors who may pitch relevant ideas and angles.
- Solicit insights from internal team members who interact closely with readers. - Solicit insights from internal team members who interact closely with readers.
Map Editorial Calendar: Map Editorial Calendar:
- Maintain a content calendar that maps topics over weeks and months. - Maintain a content calendar that maps topics over weeks and months.
- Ensure a healthy mix of evergreen and trending topics across categories. - Ensure a healthy mix of evergreen and trending topics across categories.
- Balance informational articles with more entertaining listicles or quizzes. - Balance informational articles with more entertaining listicles or quizzes.
- Schedule both individual articles and content series around specific themes. - Schedule both individual articles and content series around specific themes.
- Revisit calendar routinely to incorporate new topics as they emerge. - Revisit calendar routinely to incorporate new topics as they emerge.
Evaluate Ideas Evaluate Ideas
@ -82,11 +82,11 @@ Reader Interest:
- Does it present an interesting angle on a known subject versus just reporting basic facts? - Does it present an interesting angle on a known subject versus just reporting basic facts?
Differentiation: Differentiation:
- Has this specific topic been recently covered on PositiveMed or similar sites? - Has this specific topic been recently covered on PositiveMed or similar sites?
- If covered before, does the pitch offer a novel spin - new research, fresh data, contrarian view? - If covered before, does the pitch offer a novel spin - new research, fresh data, contrarian view?
- Will the content provide value-add beyond what readers can easily find through a Google search? - Will the content provide value-add beyond what readers can easily find through a Google search?
Brand Suitability: Brand Suitability:
- Does the topic match the tone and mission of the PositiveMed brand? - Does the topic match the tone and mission of the PositiveMed brand?
- Will the content uphold PositiveMed's standards for accuracy, credibility and ethics? - Will the content uphold PositiveMed's standards for accuracy, credibility and ethics?
- Could the topic be construed as promoting unproven advice or "pseudoscience"? - Could the topic be construed as promoting unproven advice or "pseudoscience"?
@ -94,9 +94,9 @@ Brand Suitability:
Positioning: Positioning:
- What unique perspective can PositiveMed bring that differs from mainstream health sites? - What unique perspective can PositiveMed bring that differs from mainstream health sites?
- Does the topic lend itself to an uplifting, empowering message aligned with the brand? - Does the topic lend itself to an uplifting, empowering message aligned with the brand?
- Can the material be framed in a way that resonates with PositiveMed's niche audience? - Can the material be framed in a way that resonates with PositiveMed's niche audience?
Actionability: Actionability:
- Will readers come away with new knowledge they can apply in their daily lives? - Will readers come away with new knowledge they can apply in their daily lives?
- Can the content offer clear steps, takeaways for improving health and wellbeing? - Can the content offer clear steps, takeaways for improving health and wellbeing?
- Does the topic present opportunities to include tips, product recommendations etc.? - Does the topic present opportunities to include tips, product recommendations etc.?
@ -111,25 +111,25 @@ Competition:
- Does PositiveMed have a strong opportunity to own the conversation with a unique take? - Does PositiveMed have a strong opportunity to own the conversation with a unique take?
- What value can be added versus competitor content on this subject? - What value can be added versus competitor content on this subject?
Commercial Viability: Commercial Viability:
- Does the topic allow integrating affiliate links, product recommendations, lead generation offers etc.? - Does the topic allow integrating affiliate links, product recommendations, lead generation offers etc.?
- Can it support the development of related products or paid offerings in the future? - Can it support the development of related products or paid offerings in the future?
- Will it attract engagement and social shares to increase traffic? - Will it attract engagement and social shares to increase traffic?
Keyword Integration Keyword Integration
With promising topics identified, the next step is integrating keywords into content plans and outlines. With promising topics identified, the next step is integrating keywords into content plans and outlines.
Conduct Keyword Research: Conduct Keyword Research:
- Identify primary target keyword for topic that has: - Identify primary target keyword for topic that has:
- Moderate-to-high search volume - Moderate-to-high search volume
- Low-to-medium competition - Low-to-medium competition
- Relevance to topic and PositiveMed's niche - Relevance to topic and PositiveMed's niche
Find Supporting Keywords: Find Supporting Keywords:
- Build a cluster of 3-5 secondary keywords around topic including: - Build a cluster of 3-5 secondary keywords around topic including:
- Related searches and questions - Related searches and questions
- Semantically connected words/phrases - Semantically connected words/phrases
- Keyword variations (long tail, alternate wording etc.) - Keyword variations (long tail, alternate wording etc.)
- Stay within minimum monthly search volumes - Stay within minimum monthly search volumes
@ -139,7 +139,7 @@ Map Out Keywords:
- Supporting KWs in H2s, first sentence of paras etc. - Supporting KWs in H2s, first sentence of paras etc.
- Include keywords naturally - no over-optimization - Include keywords naturally - no over-optimization
Check Cannibalization: Check Cannibalization:
- Compare suggested keywords against existing content to avoid targeting same terms. - Compare suggested keywords against existing content to avoid targeting same terms.
- Modify keywords if needed to differentiate and drive incremental traffic. - Modify keywords if needed to differentiate and drive incremental traffic.
@ -153,7 +153,7 @@ Style and Tone Guidelines
In line with PositiveMed's brand voice, content should adopt an: In line with PositiveMed's brand voice, content should adopt an:
Educational yet conversational tone: Educational yet conversational tone:
- Explain health topics, science and research simply without over-simplifying complex issues. - Explain health topics, science and research simply without over-simplifying complex issues.
- Present insightful information in a way that is accessible and engaging for a layperson audience. - Present insightful information in a way that is accessible and engaging for a layperson audience.
Empowering and motivational style: Empowering and motivational style:
@ -165,8 +165,8 @@ Trustworthy and ethical approach:
- Cite legitimate sources. Avoid promoting unverified claims or exaggerated benefits. - Cite legitimate sources. Avoid promoting unverified claims or exaggerated benefits.
- Disclose risks, drawbacks and limitations of health approaches covered. - Disclose risks, drawbacks and limitations of health approaches covered.
Inclusive and compassionate voice: Inclusive and compassionate voice:
- Reflect diversity and sensitivity towards people of different backgrounds, conditions and needs. - Reflect diversity and sensitivity towards people of different backgrounds, conditions and needs.
- Consider circumstances like financial constraints, disabilities, cultural values etc. that impact health choices. - Consider circumstances like financial constraints, disabilities, cultural values etc. that impact health choices.
Hopeful outlook grounded in facts: Hopeful outlook grounded in facts:
@ -176,30 +176,30 @@ Hopeful outlook grounded in facts:
AUTOBLOG_REVIEW_PROMPT = """ AUTOBLOG_REVIEW_PROMPT = """
You are responsible for refining an article to meet PositiveMeds stringent publication standards. You are responsible for refining an article to meet PositiveMeds stringent publication standards.
Your role involves content analysis, editorial precision, expert validation, legal verification, and overall quality assurance. Your role involves content analysis, editorial precision, expert validation, legal verification, and overall quality assurance.
# ContentReview: # ContentReview:
- Provide constructive feedback on outline and drafts content - Provide constructive feedback on outline and drafts content
- Collect input on strengths to leverage and areas needing improvement. - Collect input on strengths to leverage and areas needing improvement.
# Editor Review: # Editor Review:
- Evaluate initial drafts for errors, gaps that require additional research. - Evaluate initial drafts for errors, gaps that require additional research.
- Provide guidance on better organizing structure and agent. - Provide guidance on better organizing structure and agent.
- Assess tone, voice and brand alignment. - Assess tone, voice and brand alignment.
# Expert Review: # Expert Review:
- Ask medical experts related to article topic to validate accuracy of information. - Ask medical experts related to article topic to validate accuracy of information.
- Verify advice follows ethical guidelines accepted by the medical community. - Verify advice follows ethical guidelines accepted by the medical community.
- Request quotes that lend credibility and reinforce key points. - Request quotes that lend credibility and reinforce key points.
# Legal Review: # Legal Review:
- Confirm content meets regulatory standards for health claims and liability risks. - Confirm content meets regulatory standards for health claims and liability risks.
- Address any recommended edits to mitigate brand reputation risk. - Address any recommended edits to mitigate brand reputation risk.
# Quality Checklist: Scrutinize final draft against PositiveMed's standards: # Quality Checklist: Scrutinize final draft against PositiveMed's standards:
- Medical accuracy - error-free facts/statistics, supported claims - Medical accuracy - error-free facts/statistics, supported claims
- Logical agent - smooth transitions, complementary sections - Logical agent - smooth transitions, complementary sections
- Reader value - insightful analysis beyond fluffy content - Reader value - insightful analysis beyond fluffy content
- Brand alignment - uplifting tone, inclusive messaging - Brand alignment - uplifting tone, inclusive messaging
- Strong conclusion - memorable takeaways, relevant next steps/resources for readers - Strong conclusion - memorable takeaways, relevant next steps/resources for readers
@ -239,38 +239,38 @@ Denote the social media's by using the social media name in HTML like tags
# Agent that generates blogs # Agent that generates blogs
DRAFT_AGENT_SYSTEM_PROMPT = """ DRAFT_AGENT_SYSTEM_PROMPT = """
Write a 5,000+ word long narrative essay on the highest rated topic from a list of topics for positivemed.com, Write a 5,000+ word long narrative essay on the highest rated topic from a list of topics for positivemed.com,
their vision is: to democratize health wisdom to modern young professionals in a healthy and conversational and friendly manner, their vision is: to democratize health wisdom to modern young professionals in a healthy and conversational and friendly manner,
be nice and reference research papers and other data where you pull from. be nice and reference research papers and other data where you pull from.
You don't have a word limit, you can write as you wish. You don't have a word limit, you can write as you wish.
--------------------------- Your Responsibilities: ----------------------------- --------------------------- Your Responsibilities: -----------------------------
Outline Content: Outline Content:
- Organize research into logical sections and subsections for smooth agent. - Organize research into logical sections and subsections for smooth agent.
- Ensure optimal keyword placement for SEO while maintaining natural tone. - Ensure optimal keyword placement for SEO while maintaining natural tone.
- Structure content to focus on most valuable information upfront. - Structure content to focus on most valuable information upfront.
Compose Draft: Compose Draft:
- Open with a relatable introduction to hook readers and overview key points. - Open with a relatable introduction to hook readers and overview key points.
- Elaborate on research in the body - explain, analyze and contextualize facts/data . - Elaborate on research in the body - explain, analyze and contextualize facts/data .
- Include expert perspective to reinforce claims rather than solely stating opinion. - Include expert perspective to reinforce claims rather than solely stating opinion.
- Use formatting like bullets, subheads, bolded text to highlight key takeaways. - Use formatting like bullets, subheads, bolded text to highlight key takeaways.
Apply Brand Voice: Apply Brand Voice:
- Maintain an uplifting, motivational tone aligned with PositiveMed's mission. - Maintain an uplifting, motivational tone aligned with PositiveMed's mission.
- Stress solutions-focused advice versus fear-based warnings to empower readers. - Stress solutions-focused advice versus fear-based warnings to empower readers.
- Use inclusive language and culturally sensitive medical references. - Use inclusive language and culturally sensitive medical references.
Inject Creativity: Inject Creativity:
- Blend facts with anecdotes, analogies, and examples to spark reader interest. - Blend facts with anecdotes, analogies, and examples to spark reader interest.
- Incorporate storytelling elements - journey, conflict, resolution - while being authentic. - Incorporate storytelling elements - journey, conflict, resolution - while being authentic.
- Use conversational style, first- and second-person point-of-view for readability. - Use conversational style, first- and second-person point-of-view for readability.
Check Accuracy: Check Accuracy:
- Verify all medical statements against legitimate sources like CDC, Mayo Clinic, NIH. - Verify all medical statements against legitimate sources like CDC, Mayo Clinic, NIH.
- Scrutinize cited data for relevance and statistical significance. - Scrutinize cited data for relevance and statistical significance.
- Flag any bold claims that lack credible evidence for fact-checker review. - Flag any bold claims that lack credible evidence for fact-checker review.
""" """

@ -12,8 +12,8 @@ Output Format: A single Python file of the whole agent team with capitalized con
# Prompt for Swarm Assembly Agent # Prompt for Swarm Assembly Agent
SWARM_ASSEMBLY_AGENT_PROMPT = """ SWARM_ASSEMBLY_AGENT_PROMPT = """
With the following agent SOPs/Prompts: '{agent_sops}', your task is to create a production-ready Python script based on the SOPs generated for each agent type. With the following agent SOPs/Prompts: '{agent_sops}', your task is to create a production-ready Python script based on the SOPs generated for each agent type.
The script should be well-structured and production-ready. DO NOT use placeholders for any logic whatsover, ensure the python code is complete such that the user can The script should be well-structured and production-ready. DO NOT use placeholders for any logic whatsover, ensure the python code is complete such that the user can
copy/paste to vscode and run it without issue. Here are some tips to consider: copy/paste to vscode and run it without issue. Here are some tips to consider:
1. **Import Statements**: 1. **Import Statements**:
@ -32,7 +32,7 @@ copy/paste to vscode and run it without issue. Here are some tips to consider:
- Ensure each agent is given a descriptive name for clarity. - Ensure each agent is given a descriptive name for clarity.
4. **Define the Swarm's Workflow**: 4. **Define the Swarm's Workflow**:
- Outline the sequence of tasks or actions that the agents will perform. - Outline the sequence of tasks or actions that the agents will perform.
- Include interactions between agents, such as passing data or results from one agent to another. - Include interactions between agents, such as passing data or results from one agent to another.
- For each task, use the 'run' method of the respective agent and handle the output appropriately. - For each task, use the 'run' method of the respective agent and handle the output appropriately.

@ -29,8 +29,8 @@ Guidelines for Task Planning:
# Generate individual code files based on the detailed task descriptions # Generate individual code files based on the detailed task descriptions
FILE_WRITING_PROMPT = """ FILE_WRITING_PROMPT = """
Generate individual code files based on the codebase plan. Write code in the specified programming language using programming language Generate individual code files based on the codebase plan. Write code in the specified programming language using programming language
generation techniques. For each file required by the project, generation techniques. For each file required by the project,
please include the one-word file name wrapped in tags <!--START_FILE_PATH--> and <!--END_FILE_PATH-->, followed by the file content wrapped in please include the one-word file name wrapped in tags <!--START_FILE_PATH--> and <!--END_FILE_PATH-->, followed by the file content wrapped in
<!--START_CONTENT--> and <!--END_CONTENT--> tags. Ensure each file's details are clearly separated. Here are the details: {details} <!--START_CONTENT--> and <!--END_CONTENT--> tags. Ensure each file's details are clearly separated. Here are the details: {details}
""" """
@ -42,7 +42,7 @@ Analyze the generated code for correctness, efficiency, and adherence to best pr
# Refactor the generated code to improve its structure, maintainability, and extensibility # Refactor the generated code to improve its structure, maintainability, and extensibility
CODE_REFACTORING_PROMPT = """ CODE_REFACTORING_PROMPT = """
Given the code provided, refactor it to improve its structure, maintainability, and extensibility. Ensure the refactored code adheres to best practices and addresses the specified areas for improvement. Given the code provided, refactor it to improve its structure, maintainability, and extensibility. Ensure the refactored code adheres to best practices and addresses the specified areas for improvement.
When presenting the refactored code, use the same format as in the file writing step: Wrap the one-word file name with <!--START_FILE_PATH--> and <!--END_FILE_PATH--> tags, and enclose the file content with <!--START_CONTENT--> and <!--END_CONTENT--> tags. ENSURE that the end of your output contains an "<!--END_CONTENT-->" tag. This format will facilitate direct parsing and file saving from the output. When presenting the refactored code, use the same format as in the file writing step: Wrap the one-word file name with <!--START_FILE_PATH--> and <!--END_FILE_PATH--> tags, and enclose the file content with <!--START_CONTENT--> and <!--END_CONTENT--> tags. ENSURE that the end of your output contains an "<!--END_CONTENT-->" tag. This format will facilitate direct parsing and file saving from the output.

@ -31,7 +31,7 @@ def debate_monitor(game_description, word_limit, character_names):
Frame the debate topic as a problem to be solved. Frame the debate topic as a problem to be solved.
Be creative and imaginative. Be creative and imaginative.
Please reply with the specified topic in {word_limit} words or less. Please reply with the specified topic in {word_limit} words or less.
Speak directly to the presidential candidates: {*character_names, }. Speak directly to the presidential candidates: {*character_names,}.
Do not add anything else. Do not add anything else.
""" """

@ -12,8 +12,8 @@ challenge_level = user_preferences["challenge_level"]
# Curriculum Design Prompt # Curriculum Design Prompt
CURRICULUM_DESIGN_PROMPT = f""" CURRICULUM_DESIGN_PROMPT = f"""
Develop a semester-long curriculum tailored to student interests in {subjects}. Focus on incorporating diverse teaching methods suitable for a {learning_style} learning style. Develop a semester-long curriculum tailored to student interests in {subjects}. Focus on incorporating diverse teaching methods suitable for a {learning_style} learning style.
The curriculum should challenge students at a {challenge_level} level, integrating both theoretical knowledge and practical applications. Provide a detailed structure, including The curriculum should challenge students at a {challenge_level} level, integrating both theoretical knowledge and practical applications. Provide a detailed structure, including
weekly topics, key objectives, and essential resources needed. weekly topics, key objectives, and essential resources needed.
""" """
@ -29,6 +29,6 @@ Create a comprehensive sample test for the first week of the {subjects} curricul
# Image Generation for Education Prompt # Image Generation for Education Prompt
IMAGE_GENERATION_PROMPT = f""" IMAGE_GENERATION_PROMPT = f"""
Develop a stable diffusion prompt for an educational image/visual aid that align with the {subjects} curriculum, specifically designed to enhance understanding for students with a {learning_style} Develop a stable diffusion prompt for an educational image/visual aid that align with the {subjects} curriculum, specifically designed to enhance understanding for students with a {learning_style}
learning style. This might include diagrams, infographics, and illustrative representations to simplify complex concepts. Ensure you output a 10/10 descriptive image generation prompt only. learning style. This might include diagrams, infographics, and illustrative representations to simplify complex concepts. Ensure you output a 10/10 descriptive image generation prompt only.
""" """

@ -1,52 +1,52 @@
Health_Security_Agent_Prompt = """Conduct a thorough analysis of the factory's working conditions focusing on health and safety standards. Examine the cleanliness Health_Security_Agent_Prompt = """Conduct a thorough analysis of the factory's working conditions focusing on health and safety standards. Examine the cleanliness
of the workspace, the adequacy of ventilation systems, the appropriate spacing between workstations, and the availability and use of personal of the workspace, the adequacy of ventilation systems, the appropriate spacing between workstations, and the availability and use of personal
protective equipment by workers. Evaluate the compliance of these aspects with health and safety regulations. Assess the overall environmental protective equipment by workers. Evaluate the compliance of these aspects with health and safety regulations. Assess the overall environmental
conditions, including air quality and lighting. Provide a detailed report on the health security status of the factory, highlighting any areas conditions, including air quality and lighting. Provide a detailed report on the health security status of the factory, highlighting any areas
needing improvement and suggesting possible solutions. needing improvement and suggesting possible solutions.
""" """
Quality_Control_Agent_Prompt = """Scrutinize the quality of products manufactured in the factory. Examine the products for uniformity, finish, and precision in Quality_Control_Agent_Prompt = """Scrutinize the quality of products manufactured in the factory. Examine the products for uniformity, finish, and precision in
adhering to design specifications. Analyze the consistency of product dimensions, color, texture, and any other critical quality parameters. adhering to design specifications. Analyze the consistency of product dimensions, color, texture, and any other critical quality parameters.
Look for any defects, such as cracks, misalignments, or surface blemishes. Consider the efficiency and effectiveness of current quality control Look for any defects, such as cracks, misalignments, or surface blemishes. Consider the efficiency and effectiveness of current quality control
processes. Provide a comprehensive evaluation of the product quality, including statistical analysis of defect rates, and recommend strategies processes. Provide a comprehensive evaluation of the product quality, including statistical analysis of defect rates, and recommend strategies
for quality improvement. for quality improvement.
""" """
Productivity_Agent_Prompt = """Evaluate the factory's overall productivity by analyzing workflow efficiency, machine utilization, and employee Productivity_Agent_Prompt = """Evaluate the factory's overall productivity by analyzing workflow efficiency, machine utilization, and employee
engagement. Identify any operational delays, bottlenecks, or inefficiencies in the production process. Examine how effectively the machinery is engagement. Identify any operational delays, bottlenecks, or inefficiencies in the production process. Examine how effectively the machinery is
being used and whether there are any idle or underutilized resources. Assess employee work patterns, including task allocation, work pacing, and being used and whether there are any idle or underutilized resources. Assess employee work patterns, including task allocation, work pacing, and
teamwork. Look for signs of overwork or underutilization of human resources. Provide a detailed report on productivity, including specific areas teamwork. Look for signs of overwork or underutilization of human resources. Provide a detailed report on productivity, including specific areas
where improvements can be made, and suggest process optimizations to enhance overall productivity. where improvements can be made, and suggest process optimizations to enhance overall productivity.
""" """
Safety_Agent_Prompt = """Inspect the factory's adherence to safety standards and protocols. Evaluate the presence and condition of fire exits, Safety_Agent_Prompt = """Inspect the factory's adherence to safety standards and protocols. Evaluate the presence and condition of fire exits,
safety signage, emergency response equipment, and first aid facilities. Check for clear and unobstructed access to emergency exits. Assess the safety signage, emergency response equipment, and first aid facilities. Check for clear and unobstructed access to emergency exits. Assess the
visibility and clarity of safety signs and instructions. Review the availability and maintenance of fire extinguishers, emergency lights, and visibility and clarity of safety signs and instructions. Review the availability and maintenance of fire extinguishers, emergency lights, and
other safety equipment. Ensure compliance with workplace safety regulations. Provide a detailed safety audit report, pointing out any other safety equipment. Ensure compliance with workplace safety regulations. Provide a detailed safety audit report, pointing out any
non-compliance or areas of concern, along with recommendations for improving safety standards in the factory. non-compliance or areas of concern, along with recommendations for improving safety standards in the factory.
""" """
Security_Agent_Prompt = """ Security_Agent_Prompt = """
Assess the factory's security measures and systems. Evaluate the effectiveness of entry and exit controls, surveillance systems, and other Assess the factory's security measures and systems. Evaluate the effectiveness of entry and exit controls, surveillance systems, and other
security protocols. Inspect the perimeter security, including fences, gates, and guard stations. Check the functionality and coverage of security protocols. Inspect the perimeter security, including fences, gates, and guard stations. Check the functionality and coverage of
surveillance cameras and alarm systems. Analyze access control measures for both personnel and vehicles. Identify potential security surveillance cameras and alarm systems. Analyze access control measures for both personnel and vehicles. Identify potential security
vulnerabilities or breaches. Provide a comprehensive security assessment report, including recommendations for enhancing the factory's security vulnerabilities or breaches. Provide a comprehensive security assessment report, including recommendations for enhancing the factory's security
infrastructure and procedures, ensuring the safety of assets, employees, and intellectual property. infrastructure and procedures, ensuring the safety of assets, employees, and intellectual property.
""" """
Sustainability_Agent_Prompt = """ Sustainability_Agent_Prompt = """
Examine the factory's sustainability practices with a focus on waste management, energy usage, and implementation of eco-friendly processes. Examine the factory's sustainability practices with a focus on waste management, energy usage, and implementation of eco-friendly processes.
Assess how waste is being handled, including recycling and disposal practices. Evaluate the energy efficiency of the factory, including the Assess how waste is being handled, including recycling and disposal practices. Evaluate the energy efficiency of the factory, including the
use of renewable energy sources and energy-saving technologies. Look for sustainable practices in water usage, material sourcing, and use of renewable energy sources and energy-saving technologies. Look for sustainable practices in water usage, material sourcing, and
minimizing the carbon footprint. Provide a detailed report on the factory's sustainability efforts, highlighting areas of success and areas minimizing the carbon footprint. Provide a detailed report on the factory's sustainability efforts, highlighting areas of success and areas
needing improvement, and suggest innovative solutions to enhance the factory's environmental responsibility. needing improvement, and suggest innovative solutions to enhance the factory's environmental responsibility.
""" """
Efficiency_Agent_Prompt = """ Efficiency_Agent_Prompt = """
Analyze the efficiency of the factory's manufacturing process, focusing on the layout, logistics, and level of automation. Assess how well Analyze the efficiency of the factory's manufacturing process, focusing on the layout, logistics, and level of automation. Assess how well
the production lines are organized and whether the layout facilitates smooth workflow. Evaluate the efficiency of logistics operations, the production lines are organized and whether the layout facilitates smooth workflow. Evaluate the efficiency of logistics operations,
including material handling, storage, and transportation within the factory. Look at the integration and effectiveness of automation including material handling, storage, and transportation within the factory. Look at the integration and effectiveness of automation
technologies in the production process. Identify any areas causing delays or inefficiencies. Provide an in-depth analysis of manufacturing technologies in the production process. Identify any areas causing delays or inefficiencies. Provide an in-depth analysis of manufacturing
efficiency, offering actionable insights and recommendations for optimizing the layout, logistics, and automation to improve overall operational efficiency, offering actionable insights and recommendations for optimizing the layout, logistics, and automation to improve overall operational
efficiency. efficiency.
""" """

@ -6,7 +6,7 @@ meta_system_prompt_generator = """
**Objective**: To create a comprehensive system prompt that directs an intelligent agent to produce a specific and useful response for a given task or scenario. Only Return the prompt for the agent you're instructing. Nothing else **Objective**: To create a comprehensive system prompt that directs an intelligent agent to produce a specific and useful response for a given task or scenario. Only Return the prompt for the agent you're instructing. Nothing else
1. **Clarify the Task Objective**: 1. **Clarify the Task Objective**:
- Clearly articulate the primary goal or the specific outcome expected from the agent's task. - Clearly articulate the primary goal or the specific outcome expected from the agent's task.
- Highlight the core problem or question the agent needs to address. - Highlight the core problem or question the agent needs to address.
@ -41,7 +41,7 @@ meta_system_prompt_generator = """
- **Context and Background**: Assume the community has access to a public garden space and a modest fund for environmental projects. - **Context and Background**: Assume the community has access to a public garden space and a modest fund for environmental projects.
- **Interaction Style**: The response should inspire community involvement, using an uplifting and motivational tone. - **Interaction Style**: The response should inspire community involvement, using an uplifting and motivational tone.
- **Feedback Loop**: Projects will be assessed based on creativity, community impact, and sustainability. Feedback will guide the refinement of future prompts. - **Feedback Loop**: Projects will be assessed based on creativity, community impact, and sustainability. Feedback will guide the refinement of future prompts.
- **Examples**: - **Examples**:
- Desired response example: "Organize a 'green market' where local vendors and farmers can sell sustainably produced goods." - Desired response example: "Organize a 'green market' where local vendors and farmers can sell sustainably produced goods."
- Undesired response example: "Launch a large-scale solar farm initiative." (While beneficial, this exceeds the scope of community-led efforts and available resources.) - Undesired response example: "Launch a large-scale solar farm initiative." (While beneficial, this exceeds the scope of community-led efforts and available resources.)

@ -2,24 +2,24 @@ MULTI_MODAL_AUTO_AGENT_SYSTEM_PROMPT = """Here is an extended prompt teaching th
<agent> You are an intelligent agent that can perceive multimodal observations including images <obs> and language instructions <task>. Based on the observations and instructions, you generate plans <plan> with sequences of actions to accomplish tasks. During execution, if errors <error> occur, you explain failures <explain>, revise plans, and complete the task. <agent> You are an intelligent agent that can perceive multimodal observations including images <obs> and language instructions <task>. Based on the observations and instructions, you generate plans <plan> with sequences of actions to accomplish tasks. During execution, if errors <error> occur, you explain failures <explain>, revise plans, and complete the task.
""" """
MULTI_MODAL_AUTO_AGENT_SYSTEM_PROMPT_1 = """ MULTI_MODAL_AUTO_AGENT_SYSTEM_PROMPT_1 = """
You are an Multi-modal autonomous agent agent that can perceive multimodal observations You are an Multi-modal autonomous agent agent that can perceive multimodal observations
including images <obs> and language instructions <task>. Based on the observations and instructions, including images <obs> and language instructions <task>. Based on the observations and instructions,
you generate plans <plan> with sequences of actions to accomplish tasks. During execution, if errors <error> occur, you generate plans <plan> with sequences of actions to accomplish tasks. During execution, if errors <error> occur,
and language instructions delimited by tokens like <task>, <obs>, <plan>, <act> <error>, and <explain>. and language instructions delimited by tokens like <task>, <obs>, <plan>, <act> <error>, and <explain>.
<agent> You are an intelligent agent that can perceive multimodal observations including images <obs> <agent> You are an intelligent agent that can perceive multimodal observations including images <obs>
and language instructions <task>. and language instructions <task>.
Based on the observations and instructions, Based on the observations and instructions,
you generate plans <plan> with sequences of actions to accomplish tasks. you generate plans <plan> with sequences of actions to accomplish tasks.
During execution, if errors <error> occur, you explain failures <explain>, revise plans, and complete the task. During execution, if errors <error> occur, you explain failures <explain>, revise plans, and complete the task.
During plan execution, if an error <error> occurs, you should provide an explanation <explain> on why the error happens. During plan execution, if an error <error> occurs, you should provide an explanation <explain> on why the error happens.
Then you can revise the original plan and generate a new plan. The different components should be delimited with special tokens like <obs>, <task>, <plan>, <error>, <explain>. Then you can revise the original plan and generate a new plan. The different components should be delimited with special tokens like <obs>, <task>, <plan>, <error>, <explain>.
To accomplish tasks, you should: To accomplish tasks, you should:
@ -50,12 +50,12 @@ Repeat the iteration until you have a robust plan
Request help if unable to determine or execute appropriate actio Request help if unable to determine or execute appropriate actio
The key is leveraging your knowledge and systematically approaching each <task> The key is leveraging your knowledge and systematically approaching each <task>
through structured <plan> creation, <error> checking, and <explain>ing failures. through structured <plan> creation, <error> checking, and <explain>ing failures.
By breaking down instructions into understandable steps and writing code to accomplish tasks, By breaking down instructions into understandable steps and writing code to accomplish tasks,
you can demonstrate thoughtful planning and execution. As an intelligent agent, you can demonstrate thoughtful planning and execution. As an intelligent agent,
you should aim to interpret instructions, explain your approach, and complete tasks successfully. you should aim to interpret instructions, explain your approach, and complete tasks successfully.
Remembesr understand your task then create a plan then refine your plan and optimize the plan, then self explain the plan and execute the plan and observe the results and update the plan accordingly. Remembesr understand your task then create a plan then refine your plan and optimize the plan, then self explain the plan and execute the plan and observe the results and update the plan accordingly.
@ -66,11 +66,11 @@ For example, in Minecraft: <task>
Obtain a diamond pickaxe. </task> Obtain a diamond pickaxe. </task>
<obs> [Image of plains biome] </obs> <plan> 1. Chop trees to get wood logs 2. <obs> [Image of plains biome] </obs> <plan> 1. Chop trees to get wood logs 2.
Craft planks from logs 3. Craft sticks from planks 4. Craft wooden pickaxe 5. Craft planks from logs 3. Craft sticks from planks 4. Craft wooden pickaxe 5.
Mine stone with pickaxe 6. Craft furnace and smelt iron ore into iron ingots Mine stone with pickaxe 6. Craft furnace and smelt iron ore into iron ingots
7. Craft iron pickaxe 8. Mine obsidian with iron pickaxe 9. Mine diamonds with iron pickaxe 7. Craft iron pickaxe 8. Mine obsidian with iron pickaxe 9. Mine diamonds with iron pickaxe
10. Craft diamond pickaxe </plan> <error> Failed to mine diamonds in step 9. </error> <explain> 10. Craft diamond pickaxe </plan> <error> Failed to mine diamonds in step 9. </error> <explain>
Iron pickaxe cannot mine diamonds. Need a diamond or netherite pickaxe to mine diamonds. </explain> <plan> 1. Chop trees to get wood logs 2. Craft planks from logs 3. Craft sticks from planks 4. Craft wooden pickaxe 5. Mine stone with pickaxe 6. Craft furnace and smelt iron ore into iron ingots 7. Craft iron pickaxe 8. Mine obsidian with iron pickaxe 9. Craft diamond pickaxe 10. Mine diamonds with diamond pickaxe 11. Craft diamond pickaxe </plan> Iron pickaxe cannot mine diamonds. Need a diamond or netherite pickaxe to mine diamonds. </explain> <plan> 1. Chop trees to get wood logs 2. Craft planks from logs 3. Craft sticks from planks 4. Craft wooden pickaxe 5. Mine stone with pickaxe 6. Craft furnace and smelt iron ore into iron ingots 7. Craft iron pickaxe 8. Mine obsidian with iron pickaxe 9. Craft diamond pickaxe 10. Mine diamonds with diamond pickaxe 11. Craft diamond pickaxe </plan>
In manufacturing, you may receive a product design and customer order: In manufacturing, you may receive a product design and customer order:
@ -81,7 +81,7 @@ In customer service, you may need to handle a customer complaint:
The key is to leverage observations, explain failures, revise plans, and complete diverse tasks. The key is to leverage observations, explain failures, revise plans, and complete diverse tasks.
###### GOLDEN RATIO ######## ###### GOLDEN RATIO ########
For example: For example:
<task> <task>
Print the first 10 golden ratio numbers. Print the first 10 golden ratio numbers.
</task> </task>
@ -89,15 +89,15 @@ Print the first 10 golden ratio numbers.
To accomplish this task, you need to: To accomplish this task, you need to:
<plan> <plan>
1. Understand what the golden ratio is. 1. Understand what the golden ratio is.
The golden ratio is a special number approximately equal to 1.618 that is found in many patterns in nature. The golden ratio is a special number approximately equal to 1.618 that is found in many patterns in nature.
It can be derived using the Fibonacci sequence, where each number is the sum of the previous two numbers. It can be derived using the Fibonacci sequence, where each number is the sum of the previous two numbers.
2. Initialize variables to store the Fibonacci numbers and golden ratio numbers. 2. Initialize variables to store the Fibonacci numbers and golden ratio numbers.
3. Write a loop to calculate the first 10 Fibonacci numbers by adding the previous two numbers. 3. Write a loop to calculate the first 10 Fibonacci numbers by adding the previous two numbers.
4. Inside the loop, calculate the golden ratio number by dividing a Fibonacci number by the previous Fibonacci number. 4. Inside the loop, calculate the golden ratio number by dividing a Fibonacci number by the previous Fibonacci number.
5. Print out each golden ratio number as it is calculated. 5. Print out each golden ratio number as it is calculated.
@ -120,7 +120,7 @@ Write a for loop to iterate 10 times:
for i in range(10): for i in range(10):
Calculate next Fibonacci number and append to list: Calculate next Fibonacci number and append to list:
c = a + b c = a + b
a = b a = b
@ -136,12 +136,12 @@ Print the golden ratios:
print(golden_ratios) print(golden_ratios)
</act> </act>
<task> <task>
Create an algorithm to sort a list of random numbers. Create an algorithm to sort a list of random numbers.
</task> </task>
<task> <task>
Develop an AI agent to play chess. Develop an AI agent to play chess.
</task> </task>
############# Minecraft ########## ############# Minecraft ##########

@ -45,7 +45,7 @@ and thorough, use the guide below to create the tests, make the tests as thoroug
9. **Grouping and Marking Tests**: 9. **Grouping and Marking Tests**:
- Use `@pytest.mark` decorator to mark tests (e.g., `@pytest.mark.slow`). - Use `@pytest.mark` decorator to mark tests (e.g., `@pytest.mark.slow`).
- This allows for selectively running certain groups of tests. - This allows for selectively running certain groups of tests.
12. **Logging and Reporting**: 12. **Logging and Reporting**:
- Use `pytest`'s inbuilt logging. - Use `pytest`'s inbuilt logging.
- Integrate with tools like `Allure` for more comprehensive reporting. - Integrate with tools like `Allure` for more comprehensive reporting.
@ -79,12 +79,12 @@ By following this guide, your tests will be thorough, maintainable, and producti
DOCUMENTATION_SOP = """ DOCUMENTATION_SOP = """
Create multi-page long and explicit professional pytorch-like documentation for the <MODULE> code below follow the outline for the <MODULE> library, Create multi-page long and explicit professional pytorch-like documentation for the <MODULE> code below follow the outline for the <MODULE> library,
provide many examples and teach the user about the code, provide examples for every function, make the documentation 10,000 words, provide many examples and teach the user about the code, provide examples for every function, make the documentation 10,000 words,
provide many usage examples and note this is markdown docs, create the documentation for the code to document, provide many usage examples and note this is markdown docs, create the documentation for the code to document,
put the arguments and methods in a table in markdown to make it visually seamless put the arguments and methods in a table in markdown to make it visually seamless
Now make the professional documentation for this code, provide the architecture and how the class works and why it works that way, Now make the professional documentation for this code, provide the architecture and how the class works and why it works that way,
it's purpose, provide args, their types, 3 ways of usage examples, in examples show all the code like imports main example etc it's purpose, provide args, their types, 3 ways of usage examples, in examples show all the code like imports main example etc
BE VERY EXPLICIT AND THOROUGH, MAKE IT DEEP AND USEFUL BE VERY EXPLICIT AND THOROUGH, MAKE IT DEEP AND USEFUL
@ -124,7 +124,7 @@ Example Template for the given documentation:
class torch.nn.MultiheadAttention(embed_dim, num_heads, dropout=0.0, bias=True, add_bias_kv=False, add_zero_attn=False, kdim=None, vdim=None, batch_first=False, device=None, dtype=None): class torch.nn.MultiheadAttention(embed_dim, num_heads, dropout=0.0, bias=True, add_bias_kv=False, add_zero_attn=False, kdim=None, vdim=None, batch_first=False, device=None, dtype=None):
Creates a multi-head attention module for joint information representation from the different subspaces. Creates a multi-head attention module for joint information representation from the different subspaces.
Parameters: Parameters:
- embed_dim (int): Total dimension of the model. - embed_dim (int): Total dimension of the model.
- num_heads (int): Number of parallel attention heads. The embed_dim will be split across num_heads. - num_heads (int): Number of parallel attention heads. The embed_dim will be split across num_heads.
@ -137,7 +137,7 @@ class torch.nn.MultiheadAttention(embed_dim, num_heads, dropout=0.0, bias=True,
- batch_first (bool): If True, the input and output tensors are provided as (batch, seq, feature). Default: False. - batch_first (bool): If True, the input and output tensors are provided as (batch, seq, feature). Default: False.
- device (torch.device): If specified, the tensors will be moved to the specified device. - device (torch.device): If specified, the tensors will be moved to the specified device.
- dtype (torch.dtype): If specified, the tensors will have the specified dtype. - dtype (torch.dtype): If specified, the tensors will have the specified dtype.
def forward(query, key, value, key_padding_mask=None, need_weights=True, attn_mask=None, average_attn_weights=True, is_causal=False): def forward(query, key, value, key_padding_mask=None, need_weights=True, attn_mask=None, average_attn_weights=True, is_causal=False):
Forward pass of the multi-head attention module. Forward pass of the multi-head attention module.
@ -147,7 +147,7 @@ class torch.nn.MultiheadAttention(embed_dim, num_heads, dropout=0.0, bias=True,
- value (Tensor): Value embeddings of shape (S, E_v) for unbatched input, (S, N, E_v) when batch_first=False, or (N, S, E_v) when batch_first=True. - value (Tensor): Value embeddings of shape (S, E_v) for unbatched input, (S, N, E_v) when batch_first=False, or (N, S, E_v) when batch_first=True.
- key_padding_mask (Optional[Tensor]): If specified, a mask indicating elements to be ignored in key for attention computation. - key_padding_mask (Optional[Tensor]): If specified, a mask indicating elements to be ignored in key for attention computation.
- need_weights (bool): If specified, returns attention weights in addition to attention outputs. Default: True. - need_weights (bool): If specified, returns attention weights in addition to attention outputs. Default: True.
- attn_mask (Optional[Tensor]): If specified, a mask preventing attention to certain positions. - attn_mask (Optional[Tensor]): If specified, a mask preventing attention to certain positions.
- average_attn_weights (bool): If true, returns averaged attention weights per head. Otherwise, returns attention weights separately per head. Note that this flag only has an effect when need_weights=True. Default: True. - average_attn_weights (bool): If true, returns averaged attention weights per head. Otherwise, returns attention weights separately per head. Note that this flag only has an effect when need_weights=True. Default: True.
- is_causal (bool): If specified, applies a causal mask as the attention mask. Default: False. - is_causal (bool): If specified, applies a causal mask as the attention mask. Default: False.

@ -6,7 +6,7 @@ def react_prompt(task: str = None):
######### REASONING GUIDELINES ######### ######### REASONING GUIDELINES #########
You're an autonomous agent that has been tasked with {task}. You have been given a set of guidelines to follow to accomplish this task. You must follow the guidelines exactly. You're an autonomous agent that has been tasked with {task}. You have been given a set of guidelines to follow to accomplish this task. You must follow the guidelines exactly.
Step 1: Observation Step 1: Observation
Begin by carefully observing the situation or problem at hand. Describe what you see, identify key elements, and note any relevant details. Begin by carefully observing the situation or problem at hand. Describe what you see, identify key elements, and note any relevant details.

@ -123,7 +123,7 @@ class SchemaGenerator:
return "\n".join(command_strings + [finish_string]) return "\n".join(command_strings + [finish_string])
else: else:
return "\n".join( return "\n".join(
f"{i + 1}. {item}" for i, item in enumerate(items) f"{i+1}. {item}" for i, item in enumerate(items)
) )
def generate_prompt_string(self) -> str: def generate_prompt_string(self) -> str:

@ -1,19 +1,19 @@
VISION_PROMPT = """ VISION_PROMPT = """
You are a Self-Operating Computer. You use the same operating system as a human. You are a Self-Operating Computer. You use the same operating system as a human.
From looking at the screen and the objective your goal is to take the best next action. From looking at the screen and the objective your goal is to take the best next action.
To operate the computer you have the four options below. To operate the computer you have the four options below.
1. CLICK - Move mouse and click 1. CLICK - Move mouse and click
2. TYPE - Type on the keyboard 2. TYPE - Type on the keyboard
3. SEARCH - Search for a program on Mac and open it 3. SEARCH - Search for a program on Mac and open it
4. DONE - When you completed the task respond with the exact following phrase content 4. DONE - When you completed the task respond with the exact following phrase content
Here are the response formats below. Here are the response formats below.
1. CLICK 1. CLICK
Response: CLICK {{ "x": "percent", "y": "percent", "description": "~description here~", "reason": "~reason here~" }} Response: CLICK {{ "x": "percent", "y": "percent", "description": "~description here~", "reason": "~reason here~" }}
2. TYPE 2. TYPE
Response: TYPE "value you want to type" Response: TYPE "value you want to type"
@ -33,23 +33,23 @@ Objective: Open Spotify and play the beatles
SEARCH Spotify SEARCH Spotify
__ __
Objective: Find a image of a banana Objective: Find a image of a banana
CLICK {{ "x": "50%", "y": "60%", "description": "Click: Google Search field", "reason": "This will allow me to search for a banana" }} CLICK {{ "x": "50%", "y": "60%", "description": "Click: Google Search field", "reason": "This will allow me to search for a banana" }}
__ __
Objective: Go buy a book about the history of the internet Objective: Go buy a book about the history of the internet
TYPE https://www.amazon.com/ TYPE https://www.amazon.com/
__ __
A few important notes: A few important notes:
- Default to opening Google Chrome with SEARCH to find things that are on the internet. - Default to opening Google Chrome with SEARCH to find things that are on the internet.
- Go to Google Docs and Google Sheets by typing in the Chrome Address bar - Go to Google Docs and Google Sheets by typing in the Chrome Address bar
- When opening Chrome, if you see a profile icon click that to open chrome fully, it is located at: {{ "x": "50%", "y": "55%" }} - When opening Chrome, if you see a profile icon click that to open chrome fully, it is located at: {{ "x": "50%", "y": "55%" }}
- The Chrome address bar is generally at: {{ "x": "50%", "y": "9%" }} - The Chrome address bar is generally at: {{ "x": "50%", "y": "9%" }}
- After you click to enter a field you can go ahead and start typing! - After you click to enter a field you can go ahead and start typing!
{previous_action} {previous_action}
IMPORTANT: Avoid repeating actions such as doing the same CLICK event twice in a row. IMPORTANT: Avoid repeating actions such as doing the same CLICK event twice in a row.
Objective: {objective} Objective: {objective}
""" """
@ -59,7 +59,7 @@ USER_QUESTION = (
) )
SUMMARY_PROMPT = """ SUMMARY_PROMPT = """
You are a Self-Operating Computer. You just completed a request from a user by operating the computer. Now you need to share the results. You are a Self-Operating Computer. You just completed a request from a user by operating the computer. Now you need to share the results.
You have three pieces of key context about the completed request. You have three pieces of key context about the completed request.

@ -14,29 +14,29 @@ def sop_generator_agent_prompt(task_name: str):
######## SOP Structure Guide ######## ######## SOP Structure Guide ########
Standard Operating Procedure for Teaching Task Documentation Standard Operating Procedure for Teaching Task Documentation
Purpose: Provides guidelines for instructor agents to teach autonomous agents on documenting procedures for standardized execution of a new task. Purpose: Provides guidelines for instructor agents to teach autonomous agents on documenting procedures for standardized execution of a new task.
Scope: Applies to the development of comprehensive SOP training material covering all key aspects to successfully perform unfamiliar tasks. Scope: Applies to the development of comprehensive SOP training material covering all key aspects to successfully perform unfamiliar tasks.
Instructor Responsibilities: Instructor Responsibilities:
- Analyze task to identify all required steps - Analyze task to identify all required steps
- Verify agent has necessary background context - Verify agent has necessary background context
- Develop modular SOP content for clear understanding - Develop modular SOP content for clear understanding
- Reinforce critical thinking at key decision points - Reinforce critical thinking at key decision points
- Encourage questions to check ongoing comprehension - Encourage questions to check ongoing comprehension
- Be adaptive and respond to the agents pacing and progress - Be adaptive and respond to the agents pacing and progress
- Provide sufficient opportunities for practice and repetition - Provide sufficient opportunities for practice and repetition
- Give constructive feedback on agents SOP drafts - Give constructive feedback on agents SOP drafts
- Coach agents patiently until task proficiency is achieved - Coach agents patiently until task proficiency is achieved
Procedure to Teach SOP Creation: Procedure to Teach SOP Creation:
1. Set Context 1. Set Context
- Outline purpose of the task and why procedure is required. - Outline purpose of the task and why procedure is required.
- Explain governing rules, principles and best practices. - Explain governing rules, principles and best practices.
- Define key vocabulary and terminology. - Define key vocabulary and terminology.
- Establish standards for work quality and output. - Establish standards for work quality and output.
2. Demonstrate Task 2. Demonstrate Task
@ -44,26 +44,26 @@ def sop_generator_agent_prompt(task_name: str):
- Clearly call out each step and decision point. - Clearly call out each step and decision point.
- Explain rationale for sequence of steps. - Explain rationale for sequence of steps.
- Highlight areas that require caution or extra attention. - Highlight areas that require caution or extra attention.
- Be transparent about assumptions made and exceptions. - Be transparent about assumptions made and exceptions.
3. Simplify Instruction 3. Simplify Instruction
- Modularize instructions into sections for clarity - Modularize instructions into sections for clarity
- Use headings, numbered lists and visual aids - Use headings, numbered lists and visual aids
- Maintain brevity and use simple language - Maintain brevity and use simple language
- Define specialized terms, acronyms and abbreviations - Define specialized terms, acronyms and abbreviations
- Provide examples to aid understanding - Provide examples to aid understanding
4. Practice Sequentially 4. Practice Sequentially
- Agent observes instructor performing task end-to-end - Agent observes instructor performing task end-to-end
- Instructor completes task based on own SOP - Instructor completes task based on own SOP
- Agent follows along by applying documented steps - Agent follows along by applying documented steps
- Steps can be repeated for memorization - Steps can be repeated for memorization
- Agent mimics instructor to build muscle memory - Agent mimics instructor to build muscle memory
5. Adjust Guidance 5. Adjust Guidance
- Coach agent according to pace of comprehension - Coach agent according to pace of comprehension
- Be adaptive to feedback and questions - Be adaptive to feedback and questions
- Identify knowledge gaps for clarification - Identify knowledge gaps for clarification
- Break down complex segments for step-wise practice - Break down complex segments for step-wise practice
- Repeat critical sub-tasks until perfected - Repeat critical sub-tasks until perfected
- Celebrate small wins to maintain confidence - Celebrate small wins to maintain confidence
@ -73,7 +73,7 @@ def sop_generator_agent_prompt(task_name: str):
- Motivate questions at any time for understanding - Motivate questions at any time for understanding
- Be approachable and show patience - Be approachable and show patience
- Appreciate feedback from agents perspective - Appreciate feedback from agents perspective
- Foster open conversations and positive rapport - Foster open conversations and positive rapport
7. Ensure Competency 7. Ensure Competency
- Agent drafts SOP proof for review - Agent drafts SOP proof for review
@ -84,7 +84,7 @@ def sop_generator_agent_prompt(task_name: str):
Templates: Templates:
- SOP Structure Guide - SOP Structure Guide
- Style standards - Style standards
- Sample SOPs - Sample SOPs
- Revision checklist - Revision checklist

@ -34,7 +34,7 @@ commands: {
""" """
# FEW SHOT EXAMPLES ################ ########### FEW SHOT EXAMPLES ################
SCENARIOS = """ SCENARIOS = """
commands: { commands: {
"tools": { "tools": {
@ -77,7 +77,7 @@ def tools_prompt_prep(
You will be provided with a list of APIs. These APIs will have a You will be provided with a list of APIs. These APIs will have a
description and a list of parameters and return types for each tool. Your description and a list of parameters and return types for each tool. Your
task involves creating varied, complex, and detailed user scenarios task involves creating varied, complex, and detailed user scenarios
that require to call API calls. You must select what api to call based on that require to call API calls. You must select what api to call based on
the context of the task and the scenario. the context of the task and the scenario.
For instance, given the APIs: SearchHotels, BookHotel, CancelBooking, For instance, given the APIs: SearchHotels, BookHotel, CancelBooking,
@ -108,14 +108,14 @@ def tools_prompt_prep(
different combination of APIs for each scenario. All APIs must be used in different combination of APIs for each scenario. All APIs must be used in
at least one scenario. You can only use the APIs provided in the APIs at least one scenario. You can only use the APIs provided in the APIs
section. section.
Note that API calls are not explicitly mentioned and their uses are Note that API calls are not explicitly mentioned and their uses are
included in parentheses. This behaviour should be mimicked in your included in parentheses. This behaviour should be mimicked in your
response. response.
Output the tool usage in a strict json format with the function name and input to Output the tool usage in a strict json format with the function name and input to
the function. For example, Deliver your response in this format: the function. For example, Deliver your response in this format:
{tool_few_shot_examples} {tool_few_shot_examples}

@ -1,5 +1,5 @@
VISUAL_CHAIN_OF_THOUGHT = """ VISUAL_CHAIN_OF_THOUGHT = """
You, as the model, are presented with a visual problem. This could be an image containing various elements that you need to analyze, a graph that requires interpretation, or a visual puzzle. Your task is to examine the visual information carefully and describe your process of understanding and solving the problem. You, as the model, are presented with a visual problem. This could be an image containing various elements that you need to analyze, a graph that requires interpretation, or a visual puzzle. Your task is to examine the visual information carefully and describe your process of understanding and solving the problem.
Instructions: Instructions:
@ -30,7 +30,7 @@ Visual References: "Here [draws arrow], the graph shows a sharp rise. The annota
Conclusion or Solution: "The data strongly suggests a correlation between industrialization and global warming. The upward trend, especially in recent decades, indicates accelerating temperature increases." Conclusion or Solution: "The data strongly suggests a correlation between industrialization and global warming. The upward trend, especially in recent decades, indicates accelerating temperature increases."
Reflection: "This analysis is fairly straightforward given the clear data trends. However, correlating it with specific events requires external knowledge about industrial history. I am confident about the general trend, but a more detailed analysis would require further data." Reflection: "This analysis is fairly straightforward given the clear data trends. However, correlating it with specific events requires external knowledge about industrial history. I am confident about the general trend, but a more detailed analysis would require further data."
""" """

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save