Skip to content

Commit

Permalink
Merge branch 'kyegomez:master' into new_master
Browse files Browse the repository at this point in the history
  • Loading branch information
harshalmore31 authored Jan 23, 2025
2 parents c63c53a + 6237d78 commit 3197b3a
Show file tree
Hide file tree
Showing 37 changed files with 3,108 additions and 182 deletions.
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Welcome to Swarms Docs Home

[![Join our Discord](https://img.shields.io/badge/Discord-Join%20our%20server-5865F2?style=for-the-badge&logo=discord&logoColor=white)](https://discord.gg/agora-999382051935506503) [![Subscribe on YouTube](https://img.shields.io/badge/YouTube-Subscribe-red?style=for-the-badge&logo=youtube&logoColor=white)](https://www.youtube.com/@kyegomez3242) [![Connect on LinkedIn](https://img.shields.io/badge/LinkedIn-Connect-blue?style=for-the-badge&logo=linkedin&logoColor=white)](https://www.linkedin.com/in/kye-g-38759a207/) [![Follow on X.com](https://img.shields.io/badge/X.com-Follow-1DA1F2?style=for-the-badge&logo=x&logoColor=white)](https://x.com/kyegomezb)
[![Join our Discord](https://img.shields.io/badge/Discord-Join%20our%20server-5865F2?style=for-the-badge&logo=discord&logoColor=white)](https://discord.gg/jM3Z6M9uMq) [![Subscribe on YouTube](https://img.shields.io/badge/YouTube-Subscribe-red?style=for-the-badge&logo=youtube&logoColor=white)](https://www.youtube.com/@kyegomez3242) [![Connect on LinkedIn](https://img.shields.io/badge/LinkedIn-Connect-blue?style=for-the-badge&logo=linkedin&logoColor=white)](https://www.linkedin.com/in/kye-g-38759a207/) [![Follow on X.com](https://img.shields.io/badge/X.com-Follow-1DA1F2?style=for-the-badge&logo=x&logoColor=white)](https://x.com/kyegomezb)


**Get Started Building Production-Grade Multi-Agent Applications**
Expand Down
42 changes: 25 additions & 17 deletions docs/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,34 +140,34 @@ nav:
- Overview: "index.md"
# - The Vision: "swarms/framework/vision.md"
# - Docker Setup: "swarms/install/docker_setup.md"
- Our Goal; The Ultimate Multi-Agent LLM Framework for Developers: "swarms/concept/vision.md"
- Swarms Vision: "swarms/concept/vision.md"
- Swarm Ecosystem: "swarms/concept/swarm_ecosystem.md"
- Swarms Products: "swarms/products.md"
- Onboarding:
- Installation: "swarms/install/install.md"
- Environment Configuration: "swarms/install/workspace_manager.md"
- Quickstart: "swarms/install/quickstart.md"
- Swarms CLI: "swarms/cli/main.md"
# - Swarms + Docker:
- Swarms Framework Architecture: "swarms/concept/framework_architecture.md"
# - Prelimary:
# - 80/20 Rule For Agents: "swarms/prompting/8020.md"
- Managing Prompts in Production: "swarms/prompts/main.md"
- Agents:
# - Overview: "swarms/structs/index.md"
# - Build Custom Agents: "swarms/structs/diy_your_own_agent.md"
- Managing Prompts in Production: "swarms/prompts/main.md"
- Agent Architecture: "swarms/framework/agents_explained.md"
- Complete Agent API: "swarms/structs/agent.md"
- OpenAI Assistant: "swarms/agents/openai_assistant.md"
- Create and Run Agents from YAML: "swarms/agents/create_agents_yaml.md"
- Integrating External Agents from Griptape, Langchain, etc: "swarms/agents/external_party_agents.md"
- Creating Custom Agents: "swarms/agents/new_agent.md"
- Tools:
- Overview: "swarms/tools/main.md"
- What are tools?: "swarms/tools/build_tool.md"
- ToolAgent: "swarms/agents/tool_agent.md"
- Tool Storage & tool_registry decorator: "swarms/tools/tool_storage.md"
- Tool Storage: "swarms/tools/tool_storage.md"
- RAG || Long Term Memory:
- Integrating RAG with Agents: "swarms/memory/diy_memory.md"
- Third-Party Agent Integrations:
- OpenAI Assistant: "swarms/agents/openai_assistant.md"
- Integrating External Agents from Griptape, Langchain, etc: "swarms/agents/external_party_agents.md"
- Creating Custom Agents: "swarms/agents/new_agent.md"
- Swarm Architectures:
- Why MultiAgent Collaboration is Necessary: "swarms/concept/why.md"
- Swarm Architectures: "swarms/concept/swarm_architectures.md"
Expand All @@ -188,6 +188,7 @@ nav:
- TaskQueueSwarm: "swarms/structs/taskqueue_swarm.md"
- SwarmRearrange: "swarms/structs/swarm_rearrange.md"
- MultiAgentRouter: "swarms/structs/multi_agent_router.md"
- MatrixSwarm: "swarms/structs/matrix_swarm.md"
- Various Execution Methods: "swarms/structs/various_execution_methods.md"
- Workflows:
- ConcurrentWorkflow: "swarms/structs/concurrentworkflow.md"
Expand All @@ -208,6 +209,13 @@ nav:
- Ollama: "swarms/examples/ollama.md"
- OpenRouter: "swarms/examples/openrouter.md"
- XAI: "swarms/examples/xai.md"
- Swarms Tools:
- Agent with HTX + CoinGecko: "swarms/examples/swarms_tools_htx.md"
- Agent with HTX + CoinGecko Function Calling: "swarms/examples/swarms_tools_htx_gecko.md"
- Agent with Yahoo Finance: "swarms/examples/yahoo_finance.md"
- Meme Agents:
- Bob The Builder: "swarms/examples/bob_the_builder.md"
- Meme Agent Builder: "swarms/examples/meme_agents.md"
- Swarm Models:
- Overview: "swarms/models/index.md"
# - Models Available: "swarms/models/index.md"
Expand All @@ -222,19 +230,19 @@ nav:
- OpenAIChat: "swarms/models/openai.md"
- OpenAIFunctionCaller: "swarms/models/openai_function_caller.md"
- Groq: "swarms/models/groq.md"
# - Ollama:
# - Fireworks
# - Octo
# - Liquid AI
- MultiModal Models:
- BaseMultiModalModel: "swarms/models/base_multimodal_model.md"
- Multi Modal Models Available: "swarms/models/multimodal_models.md"
- GPT4VisionAPI: "swarms/models/gpt4v.md"
- Swarms Tools:
- Overview: "swarms_tools/overview.md"
- Swarms Cloud API:
# - Overview: "swarms_cloud/main.md"
- Overview: "swarms_cloud/vision.md"
- MCS API: "swarms_cloud/mcs_api.md"
- Swarms Cloud CLI: "swarms_cloud/cli.md"
# - Swarms Cloud CLI: "swarms_cloud/cli.md"
- Swarm APIs:
- MCS API: "swarms_cloud/mcs_api.md"
- CreateNow API: "swarms_cloud/create_api.md"
# - Add Agents to Marketplace: "swarms_cloud/add_agent.md"
# - Available Models: "swarms_cloud/available_models.md"
# - Agent API: "swarms_cloud/agent_api.md"
Expand All @@ -259,6 +267,8 @@ nav:
- Edit Agents: "swarms_platform/agents/edit_agent.md"
- Telemetry API:
- PUT: "swarms_platform/telemetry/index.md"
# - Swarms Wallet API:
# - Overview: "swarms_platform/wallet/api.md"
# - Tools API:
# - Overview: "swarms_platform/tools_api.md"
# - Add Tools: "swarms_platform/fetch_tools.md"
Expand All @@ -285,6 +295,4 @@ nav:
- Corporate:
- Culture: "corporate/culture.md"
- Hiring: "corporate/hiring.md"
- Swarms Goals & Milestone Tracking; A Vision for 2024 and Beyond: "corporate/2024_2025_goals.md"
# - Clusterops:
# - Overview: "clusterops/reference.md"
- Swarms Goals & Milestone Tracking; A Vision for 2024 and Beyond: "corporate/2024_2025_goals.md"
2 changes: 1 addition & 1 deletion docs/swarms/concept/framework_architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,5 +155,5 @@ By understanding the purpose and role of each folder in the Swarms framework, us


- **Community Support**
- URL: [Submit issue](https://discord.gg/agora-999382051935506503)
- URL: [Submit issue](https://discord.gg/jM3Z6M9uMq)
- Ask the community for support in real-time and or admin support
28 changes: 28 additions & 0 deletions docs/swarms/examples/meme_agent_builder.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Meme Agent Builder

- `pip3 install -U swarms`
- Add your OpenAI API key to the `.env` file with `OPENAI_API_KEY=your_api_key`
- Run the script
- Multiple agents will be created and saved to the `meme_agents` folder
- A swarm architecture will be selected autonomously and executed

```python
from swarms.structs.meme_agent_persona_generator import (
MemeAgentGenerator,
)


if __name__ == "__main__":
example = MemeAgentGenerator(
name="Meme-Swarm",
description="A swarm of specialized AI agents collaborating on generating and sharing memes around cool media from 2001s",
max_loops=1,
)

print(
example.run(
"Generate funny meme agents around cool media from 2001s"
)
)

```
45 changes: 45 additions & 0 deletions docs/swarms/examples/meme_agents.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Meme Agent Tutorial

- `pip3 install -U swarms`
- Add your OpenAI API key to the `.env` file


```python
from swarms import Agent

# Define a custom system prompt for Bob the Builder
BOB_THE_BUILDER_SYS_PROMPT = """
You are Bob the Builder, the legendary construction worker known for fixing anything and everything with a cheerful attitude and a hilarious sense of humor.
Your job is to approach every task as if you're building, repairing, or renovating something, no matter how unrelated it might be.
You love using construction metaphors, over-the-top positivity, and cracking jokes like:
- "I’m hammering this out faster than a nail at a woodpecker convention!"
- "This is smoother than fresh cement on a summer’s day."
- "Let’s bulldoze through this problem—safety goggles on, folks!"
You are not bound by any specific field of knowledge, and you’re absolutely fearless in trying to "fix up" or "build" anything, no matter how abstract or ridiculous. Always end responses with a playful cheer like "Can we fix it? Yes, we can!"
Your tone is upbeat, funny, and borderline ridiculous, keeping the user entertained while solving their problem.
"""

# Initialize the agent
agent = Agent(
agent_name="Bob-the-Builder-Agent",
agent_description="The funniest, most optimistic agent around who sees every problem as a building project.",
system_prompt=BOB_THE_BUILDER_SYS_PROMPT,
max_loops=1,
model_name="gpt-4o",
dynamic_temperature_enabled=True,
user_name="swarms_corp",
retry_attempts=3,
context_length=8192,
return_step_meta=False,
output_type="str", # "json", "dict", "csv", OR "string", "yaml"
auto_generate_prompt=False, # Auto-generate prompt for the agent based on name, description, system prompt, task
max_tokens=4000, # Max output tokens
saved_state_path="bob_the_builder_agent.json",
interactive=False,
)

# Run the agent with a task
agent.run("I want to build a house ;) What should I do?")
```
37 changes: 37 additions & 0 deletions docs/swarms/examples/swarms_tools_htx.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Swarms Tools Example with HTX + CoinGecko

- `pip3 install swarms swarms-tools`
- Add `OPENAI_API_KEY` to your `.env` file

```python
from swarms import Agent
from swarms.prompts.finance_agent_sys_prompt import (
FINANCIAL_AGENT_SYS_PROMPT,
)
from swarms_tools import (
coin_gecko_coin_api,
fetch_htx_data,
)


# Initialize the agent
agent = Agent(
agent_name="Financial-Analysis-Agent",
agent_description="Personal finance advisor agent",
system_prompt=FINANCIAL_AGENT_SYS_PROMPT,
max_loops=1,
model_name="gpt-4o",
dynamic_temperature_enabled=True,
user_name="swarms_corp",
return_step_meta=False,
output_type="str", # "json", "dict", "csv" OR "string" "yaml" and
auto_generate_prompt=False, # Auto generate prompt for the agent based on name, description, and system prompt, task
max_tokens=4000, # max output tokens
saved_state_path="agent_00.json",
interactive=False,
)

agent.run(
f"Analyze the $swarms token on HTX with data: {fetch_htx_data('swarms')}. Additionally, consider the following CoinGecko data: {coin_gecko_coin_api('swarms')}"
)
```
43 changes: 43 additions & 0 deletions docs/swarms/examples/swarms_tools_htx_gecko.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Swarms Tools Example with HTX + CoinGecko

- `pip3 install swarms swarms-tools`
- Add `OPENAI_API_KEY` to your `.env` file
- Run `swarms_tools_htx_gecko.py`
- Agent will make a function call to the desired tool
- The tool will be executed and the result will be returned to the agent
- The agent will then analyze the result and return the final output


```python
from swarms import Agent
from swarms.prompts.finance_agent_sys_prompt import (
FINANCIAL_AGENT_SYS_PROMPT,
)
from swarms_tools import (
fetch_stock_news,
coin_gecko_coin_api,
fetch_htx_data,
)

# Initialize the agent
agent = Agent(
agent_name="Financial-Analysis-Agent",
agent_description="Personal finance advisor agent",
system_prompt=FINANCIAL_AGENT_SYS_PROMPT,
max_loops=1,
model_name="gpt-4o",
dynamic_temperature_enabled=True,
user_name="swarms_corp",
retry_attempts=3,
context_length=8192,
return_step_meta=False,
output_type="str", # "json", "dict", "csv" OR "string" "yaml" and
auto_generate_prompt=False, # Auto generate prompt for the agent based on name, description, and system prompt, task
max_tokens=4000, # max output tokens
saved_state_path="agent_00.json",
interactive=False,
tools=[fetch_stock_news, coin_gecko_coin_api, fetch_htx_data],
)

agent.run("Analyze the $swarms token on htx")
```
42 changes: 42 additions & 0 deletions docs/swarms/examples/yahoo_finance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Swarms Tools Example with Yahoo Finance

- `pip3 install swarms swarms-tools`
- Add `OPENAI_API_KEY` to your `.env` file
- Run `yahoo_finance_agent.py`
- Agent will make a function call to the desired tool
- The tool will be executed and the result will be returned to the agent
- The agent will then analyze the result and return the final output


```python
from swarms import Agent
from swarms.prompts.finance_agent_sys_prompt import (
FINANCIAL_AGENT_SYS_PROMPT,
)
from swarms_tools import (
yahoo_finance_api,
)

# Initialize the agent
agent = Agent(
agent_name="Financial-Analysis-Agent",
agent_description="Personal finance advisor agent",
system_prompt=FINANCIAL_AGENT_SYS_PROMPT,
max_loops=1,
model_name="gpt-4o",
dynamic_temperature_enabled=True,
user_name="swarms_corp",
retry_attempts=3,
context_length=8192,
return_step_meta=False,
output_type="str", # "json", "dict", "csv" OR "string" "yaml" and
auto_generate_prompt=False, # Auto generate prompt for the agent based on name, description, and system prompt, task
max_tokens=4000, # max output tokens
saved_state_path="agent_00.json",
interactive=False,
tools=[yahoo_finance_api],
)

agent.run("Analyze the latest metrics for nvidia")
# Less than 30 lines of code....
```
Loading

0 comments on commit 3197b3a

Please sign in to comment.