pull/584/head
Your Name 4 months ago
parent d76ee3d895
commit 06488efc53

@ -78,7 +78,8 @@ Features:
```python
import os
from swarms import Agent, OpenAIChat
from swarms import Agent
from swarm_models import OpenAIChat
from swarms.prompts.finance_agent_sys_prompt import (
FINANCIAL_AGENT_SYS_PROMPT,
)
@ -179,7 +180,8 @@ agent.run(
An LLM equipped with long term memory and tools, a full stack agent capable of automating all and any digital tasks given a good prompt.
```python
from swarms import Agent, OpenAIChat
from swarms import Agent
from swarm_models import OpenAIChat
from swarms_memory import ChromaDB
import subprocess
import os
@ -848,7 +850,8 @@ An all-new swarm architecture that makes it easy to manage and oversee the outpu
```python
import os
from swarms import Agent, OpenAIChat
from swarms import Agent
from swarm_models import OpenAIChat
from swarms.structs.spreadsheet_swarm import SpreadSheetSwarm
# Define custom system prompts for each social media platform

@ -1,4 +1,5 @@
from swarms import Agent, OpenAIChat
from swarms import Agent
from swarm_models import OpenAIChat
from swarms_memory import ChromaDB
import subprocess
import os

@ -1,100 +0,0 @@
import os
from swarms import Agent, OpenAIChat
from swarms.structs.company import Company
# Get the OpenAI API key from the environment variable
api_key = os.getenv("OPENAI_API_KEY")
# Create an instance of the OpenAIChat class
model = OpenAIChat(
api_key=api_key, model_name="gpt-4o-mini", temperature=0.1
)
# Initialize the boss agent (Director)
boss_agent = Agent(
agent_name="BossAgent",
system_prompt="""
You are the BossAgent responsible for managing and overseeing a swarm of agents analyzing company expenses.
Your job is to dynamically assign tasks, prioritize their execution, and ensure that all agents collaborate efficiently.
After receiving a report on the company's expenses, you will break down the work into smaller tasks,
assigning specific tasks to each agent, such as detecting recurring high costs, categorizing expenditures,
and identifying unnecessary transactions. Ensure the results are communicated back in a structured way
so the finance team can take actionable steps to cut off unproductive spending. You also monitor and
dynamically adapt the swarm to optimize their performance. Finally, you summarize their findings
into a coherent report.
""",
llm=model,
max_loops=1,
dashboard=False,
streaming_on=True,
verbose=True,
stopping_token="<DONE>",
state_save_file_type="json",
saved_state_path="boss_agent.json",
)
# Initialize worker 1: Expense Analyzer
worker1 = Agent(
agent_name="ExpenseAnalyzer",
system_prompt="""
Your task is to carefully analyze the company's expense data provided to you.
You will focus on identifying high-cost recurring transactions, categorizing expenditures
(e.g., marketing, operations, utilities, etc.), and flagging areas where there seems to be excessive spending.
You will provide a detailed breakdown of each category, along with specific recommendations for cost-cutting.
Pay close attention to monthly recurring subscriptions, office supplies, and non-essential expenditures.
""",
llm=model,
max_loops=1,
dashboard=False,
streaming_on=True,
verbose=True,
stopping_token="<DONE>",
state_save_file_type="json",
saved_state_path="worker1.json",
)
# Initialize worker 2: Summary Generator
worker2 = Agent(
agent_name="SummaryGenerator",
system_prompt="""
After receiving the detailed breakdown from the ExpenseAnalyzer,
your task is to create a concise summary of the findings. You will focus on the most actionable insights,
such as highlighting the specific transactions that can be immediately cut off and summarizing the areas
where the company is overspending. Your summary will be used by the BossAgent to generate the final report.
Be clear and to the point, emphasizing the urgency of cutting unnecessary expenses.
""",
llm=model,
max_loops=1,
dashboard=False,
streaming_on=True,
verbose=True,
stopping_token="<DONE>",
state_save_file_type="json",
saved_state_path="worker2.json",
)
# Swarm-Level Prompt (Collaboration Prompt)
swarm_prompt = """
As a swarm, your collective goal is to analyze the company's expenses and identify transactions that should be cut off.
You will work collaboratively to break down the entire process of expense analysis into manageable steps.
The BossAgent will direct the flow and assign tasks dynamically to the agents. The ExpenseAnalyzer will first
focus on breaking down the expense report, identifying high-cost recurring transactions, categorizing them,
and providing recommendations for potential cost reduction. After the analysis, the SummaryGenerator will then
consolidate all the findings into an actionable summary that the finance team can use to immediately cut off unnecessary expenses.
Together, your collaboration is essential to streamlining and improving the companys financial health.
"""
# Create a list of agents
agents = [boss_agent, worker1, worker2]
# Create an organization chart
org_chart = [[boss_agent], [worker1, worker2]]
# Create a company
company = Company(org_chart=org_chart)
# Run the company
company.run()

@ -1,6 +1,7 @@
import os
from swarms import Agent, OpenAIChat
from swarms import Agent
from swarm_models import OpenAIChat
from swarms.structs.company import Company
# Get the OpenAI API key from the environment variable

@ -63,7 +63,7 @@ Starts the bot using the `DISCORD_TOKEN` from the `.env` file.
Initialize the `llm` (Language Learning Model) with your OpenAI API key:
```python
from swarms.models import OpenAIChat
from swarm_models import OpenAIChat
llm = OpenAIChat(
openai_api_key="Your_OpenAI_API_Key",

@ -69,7 +69,7 @@ class Anthropic:
```python
# Import necessary modules and classes
from swarms.models import Anthropic
from swarm_models import Anthropic
# Initialize an instance of the Anthropic class
model = Anthropic(anthropic_api_key="")

@ -164,7 +164,7 @@ To demonstrate how to use the `BaseLLM` interface, let's create an example using
```python
# Import the BaseLLM class
from swarms.models import BaseLLM
from swarm_models import BaseLLM
# Create an instance of the language model
language_model = BaseLLM(

@ -31,7 +31,7 @@ pip install swarms
To get started with Swarms, you'll need to import the library and create an instance of the `BaseMultiModalModel` class. This class serves as the foundation for running multimodal models.
```python
from swarms.models import BaseMultiModalModel
from swarm_models import BaseMultiModalModel
model = BaseMultiModalModel(
model_name="your_model_name",
@ -138,7 +138,7 @@ Let's explore some usage examples of the MultiModalAI library:
```python
# Import the library
from swarms.models import BaseMultiModalModel
from swarm_models import BaseMultiModalModel
# Create an instance of the model
model = BaseMultiModalModel(
@ -159,7 +159,7 @@ print(response)
```python
# Import the library
from swarms.models import BaseMultiModalModel
from swarm_models import BaseMultiModalModel
# Create an instance of the model
model = BaseMultiModalModel(
@ -184,7 +184,7 @@ for response in responses:
```python
# Import the library
from swarms.models import BaseMultiModalModel
from swarm_models import BaseMultiModalModel
# Create an instance of the model
model = BaseMultiModalModel(
@ -209,7 +209,7 @@ for response in responses:
### Example 4: Inheriting `BaseMultiModalModel` for it's prebuilt classes
```python
from swarms.models import BaseMultiModalModel
from swarm_models import BaseMultiModalModel
class CustomMultiModalModel(BaseMultiModalModel):

@ -36,7 +36,7 @@ pip install swarms
Let's get started with a quick example of using the Dalle3 library to generate an image from a text prompt:
```python
from swarms.models.dalle3 import Dalle3
from swarm_models.dalle3 import Dalle3
# Create an instance of the Dalle3 class
dalle = Dalle3()
@ -97,7 +97,7 @@ Returns:
### Example 1: Basic Image Generation
```python
from swarms.models.dalle3 import Dalle3
from swarm_models.dalle3 import Dalle3
# Create an instance of the Dalle3 class
dalle3 = Dalle3()
@ -115,7 +115,7 @@ print(image_url)
### Example 2: Creating Image Variations
```python
from swarms.models.dalle3 import Dalle3
from swarm_models.dalle3 import Dalle3
# Create an instance of the Dalle3 class
dalle3 = Dalle3()
@ -137,7 +137,7 @@ Certainly! Here are additional examples that cover various edge cases and method
You can customize the size of the generated image by specifying the `size` parameter when creating an instance of the `Dalle3` class. Here's how to generate a smaller image:
```python
from swarms.models.dalle3 import Dalle3
from swarm_models.dalle3 import Dalle3
# Create an instance of the Dalle3 class with a custom image size
dalle3 = Dalle3(size="512x512")
@ -157,7 +157,7 @@ print(image_url)
You can adjust the maximum number of API request retries using the `max_retries` parameter. Here's how to increase the retry limit:
```python
from swarms.models.dalle3 import Dalle3
from swarm_models.dalle3 import Dalle3
# Create an instance of the Dalle3 class with a higher retry limit
dalle3 = Dalle3(max_retries=5)
@ -177,7 +177,7 @@ print(image_url)
To create variations of an existing image, you can use the `create_variations` method. Here's an example:
```python
from swarms.models.dalle3 import Dalle3
from swarm_models.dalle3 import Dalle3
# Create an instance of the Dalle3 class
dalle3 = Dalle3()
@ -197,7 +197,7 @@ print(variations_url)
The Dalle3 library provides error handling for API-related issues. Here's how to handle and display API errors:
```python
from swarms.models.dalle3 import Dalle3
from swarm_models.dalle3 import Dalle3
# Create an instance of the Dalle3 class
dalle3 = Dalle3()
@ -218,7 +218,7 @@ except Exception as e:
You can customize the quality of the generated image by specifying the `quality` parameter. Here's how to generate a high-quality image:
```python
from swarms.models.dalle3 import Dalle3
from swarm_models.dalle3 import Dalle3
# Create an instance of the Dalle3 class with high quality
dalle3 = Dalle3(quality="high")

@ -23,7 +23,7 @@ The `DistilWhisperModel` class is initialized with the following parameters:
Example of initialization:
```python
from swarms.models import DistilWhisperModel
from swarm_models import DistilWhisperModel
# Initialize with default model
model_wrapper = DistilWhisperModel()

@ -37,7 +37,7 @@ To use Fuyu, follow these steps:
1. Initialize the Fuyu instance:
```python
from swarms.models.fuyu import Fuyu
from swarm_models.fuyu import Fuyu
fuyu = Fuyu()
```
@ -54,7 +54,7 @@ output_text = fuyu(text, img_path)
### Example 2 - Text Generation
```python
from swarms.models.fuyu import Fuyu
from swarm_models.fuyu import Fuyu
fuyu = Fuyu()

@ -78,7 +78,7 @@ class Gemini(BaseMultiModalModel):
**Examples**:
```python
from swarms.models import Gemini
from swarm_models import Gemini
# Initialize the Gemini model
gemini = Gemini()
@ -128,7 +128,7 @@ class Gemini(BaseMultiModalModel):
**Examples**:
```python
from swarms.models.gemini import Gemini
from swarm_models.gemini import Gemini
# Initialize the Gemini model
gemini = Gemini()

@ -53,7 +53,7 @@ When initializing the `GPT4VisionAPI` class, you have the option to provide the
Here's how you can initialize the `GPT4VisionAPI` class:
```python
from swarms.models import GPT4VisionAPI
from swarm_models import GPT4VisionAPI
# Initialize with default API key and max_tokens
api = GPT4VisionAPI()
@ -129,7 +129,7 @@ Let's explore some usage examples of the `GPT4VisionAPI` module to better unders
In this example, we'll use the module with the default API key and maximum tokens to analyze an image.
```python
from swarms.models import GPT4VisionAPI
from swarm_models import GPT4VisionAPI
# Initialize with default API key and max_tokens
api = GPT4VisionAPI()
@ -150,7 +150,7 @@ print(response)
If you have a custom API key, you can initialize the module with it as shown in this example.
```python
from swarms.models import GPT4VisionAPI
from swarm_models import GPT4VisionAPI
# Initialize with custom API key and max_tokens
custom_api_key = "your_custom_api_key"
@ -172,7 +172,7 @@ print(response)
You can also customize the maximum token limit when initializing the module. In this example, we set it to 1000 tokens.
```python
from swarms.models import GPT4VisionAPI
from swarm_models import GPT4VisionAPI
# Initialize with default API key and custom max_tokens
api = GPT4VisionAPI(max_tokens=1000)

@ -93,7 +93,7 @@ Here are three ways to use the `HuggingfaceLLM` class:
#### Example 1: Basic Usage
```python
from swarms.models import HuggingfaceLLM
from swarm_models import HuggingfaceLLM
# Initialize the HuggingfaceLLM instance with a model ID
model_id = "NousResearch/Nous-Hermes-2-Vision-Alpha"
@ -108,7 +108,7 @@ print(generated_text)
#### Example 2: Custom Configuration
```python
from swarms.models import HuggingfaceLLM
from swarm_models import HuggingfaceLLM
# Initialize with custom configuration
custom_config = {
@ -129,7 +129,7 @@ print(generated_text)
#### Example 3: Distributed Processing
```python
from swarms.models import HuggingfaceLLM
from swarm_models import HuggingfaceLLM
# Initialize for distributed processing
inference = HuggingfaceLLM(model_id="gpt2-medium", distributed=True)

@ -28,7 +28,7 @@ To use Idefics, follow these steps:
1. Initialize the Idefics instance:
```python
from swarms.models import Idefics
from swarm_models import Idefics
model = Idefics()
```
@ -46,7 +46,7 @@ print(response)
### Example 1 - Image Questioning
```python
from swarms.models import Idefics
from swarm_models import Idefics
model = Idefics()
prompts = [
@ -59,7 +59,7 @@ print(response)
### Example 2 - Bidirectional Conversation
```python
from swarms.models import Idefics
from swarm_models import Idefics
model = Idefics()
user_input = "User: What is in this image? https://upload.wikimedia.org/wikipedia/commons/8/86/Id%C3%A9fix.JPG"

@ -22,7 +22,7 @@ To use Kosmos, follow these steps:
1. Initialize the Kosmos instance:
```python
from swarms.models.kosmos_two import Kosmos
from swarm_models.kosmos_two import Kosmos
kosmos = Kosmos()
```
@ -38,7 +38,7 @@ kosmos.multimodal_grounding(
### Example 1 - Multimodal Grounding
```python
from swarms.models.kosmos_two import Kosmos
from swarm_models.kosmos_two import Kosmos
kosmos = Kosmos()
@ -58,7 +58,7 @@ kosmos.referring_expression_comprehension(
### Example 2 - Referring Expression Comprehension
```python
from swarms.models.kosmos_two import Kosmos
from swarm_models.kosmos_two import Kosmos
kosmos = Kosmos()
@ -78,7 +78,7 @@ kosmos.referring_expression_generation(
### Example 3 - Referring Expression Generation
```python
from swarms.models.kosmos_two import Kosmos
from swarm_models.kosmos_two import Kosmos
kosmos = Kosmos()
@ -96,7 +96,7 @@ kosmos.grounded_vqa("What is the color of the car?", "https://example.com/car.jp
### Example 4 - Grounded Visual Question Answering
```python
from swarms.models.kosmos_two import Kosmos
from swarm_models.kosmos_two import Kosmos
kosmos = Kosmos()
@ -112,7 +112,7 @@ kosmos.grounded_image_captioning("https://example.com/beach.jpg")
### Example 5 - Grounded Image Captioning
```python
from swarms.models.kosmos_two import Kosmos
from swarm_models.kosmos_two import Kosmos
kosmos = Kosmos()
@ -128,7 +128,7 @@ kosmos.grounded_image_captioning_detailed("https://example.com/beach.jpg")
### Example 6 - Detailed Grounded Image Captioning
```python
from swarms.models.kosmos_two import Kosmos
from swarm_models.kosmos_two import Kosmos
kosmos = Kosmos()
@ -149,7 +149,7 @@ kosmos.draw_entity_boxes_on_image(image, entities, show=True)
### Example 7 - Drawing Entity Boxes on Image
```python
from swarms.models.kosmos_two import Kosmos
from swarm_models.kosmos_two import Kosmos
kosmos = Kosmos()
@ -176,7 +176,7 @@ image = kosmos.generate_boxes(
### Example 8 - Generating Boxes for Entities
```python
from swarms.models.kosmos_two import Kosmos
from swarm_models.kosmos_two import Kosmos
kosmos = Kosmos()
entities = [

@ -39,7 +39,7 @@ To use LayoutLMDocumentQA, follow these steps:
1. Initialize the LayoutLMDocumentQA instance:
```python
from swarms.models import LayoutLMDocumentQA
from swarm_models import LayoutLMDocumentQA
layout_lm_doc_qa = LayoutLMDocumentQA()
```

@ -4,7 +4,7 @@
```python
from transformers import AutoTokenizer, AutoModelForCausalLM
import torch
from swarms.models.base_llm import BaseLLM
from swarm_models.base_llm import BaseLLM
class Llama3(BaseLLM):

@ -50,7 +50,7 @@ The Anthropic model is one of the many models supported by Swarms. Here's how yo
```python
import os
from swarms.models import Anthropic
from swarm_models import Anthropic
# Load the environment variables
anthropic_api_key = os.getenv("ANTHROPIC_API_KEY")
@ -73,7 +73,7 @@ print(response)
HuggingfaceLLM allows you to use models from Hugging Face's vast repository. Here's an example:
```python
from swarms.models import HuggingfaceLLM
from swarm_models import HuggingfaceLLM
# Define the model ID
model_id = "NousResearch/Yarn-Mistral-7b-128k"
@ -97,7 +97,7 @@ The OpenAIChat model is designed for conversational tasks. Here's how to use it:
```python
import os
from swarms.models import OpenAIChat
from swarm_models import OpenAIChat
# Load the environment variables
openai_api_key = os.getenv("OPENAI_API_KEY")

@ -43,7 +43,7 @@ To use Nougat, follow these steps:
1. Initialize the Nougat instance:
```python
from swarms.models import Nougat
from swarm_models import Nougat
nougat = Nougat()
```

@ -151,7 +151,7 @@ Here are the key attributes and their descriptions for the `BaseOpenAI` and `Ope
```python
# Import the OpenAI class
from swarms.models import OpenAI
from swarm_models import OpenAI
# Set your OpenAI API key
api_key = "YOUR_API_KEY"

@ -125,7 +125,7 @@ Here are the key attributes and their descriptions for the `OpenAIChat` class:
### Example 1: Initializing `OpenAIChat`
```python
from swarms.models import OpenAIChat
from swarm_models import OpenAIChat
# Initialize OpenAIChat with model name and API key
openai_chat = OpenAIChat(model_name="gpt-3.5-turbo", openai_api_key="YOUR_API_KEY")

@ -89,7 +89,7 @@ Here are three examples demonstrating different ways to use the `OpenAIFunctionC
```python
import openai
from swarms.models.openai_function_caller import OpenAIFunctionCaller
from swarm_models.openai_function_caller import OpenAIFunctionCaller
from swarms.artifacts.main_artifact import Artifact
@ -120,7 +120,7 @@ print(out)
### Example 2: Prompt Generator
```python
from swarms.models.openai_function_caller import OpenAIFunctionCaller
from swarm_models.openai_function_caller import OpenAIFunctionCaller
from pydantic import BaseModel, Field
from typing import Sequence
@ -181,7 +181,7 @@ print(out)
### Example 3: Sentiment Analysis
```python
from swarms.models.openai_function_caller import OpenAIFunctionCaller
from swarm_models.openai_function_caller import OpenAIFunctionCaller
from pydantic import BaseModel, Field

@ -38,7 +38,7 @@ pip install swarms requests wave
To use the `OpenAITTS` module, you need to initialize an instance of the `OpenAITTS` class. Here's how you can do it:
```python
from swarms.models.openai_tts import OpenAITTS
from swarm_models.openai_tts import OpenAITTS
# Initialize the OpenAITTS instance
tts = OpenAITTS(
@ -95,7 +95,7 @@ speech_data = tts.run_and_save("Hello, world!")
Here's a basic example of how to use the `OpenAITTS` module to generate speech from text:
```python
from swarms.models.openai_tts import OpenAITTS
from swarm_models.openai_tts import OpenAITTS
# Initialize the OpenAITTS instance
tts = OpenAITTS(

@ -25,7 +25,7 @@ To use the Vilt model, follow these steps:
1. Initialize the Vilt model:
```python
from swarms.models import Vilt
from swarm_models import Vilt
model = Vilt()
```

@ -135,7 +135,8 @@ And, then now you can get started with the following:
```python
import os
from swarms import Agent, OpenAIChat
from swarms import Agent
from swarm_models import OpenAIChat
from swarms.prompts.finance_agent_sys_prompt import (
FINANCIAL_AGENT_SYS_PROMPT,
)
@ -189,7 +190,8 @@ To integrate tools with the Swarm Agent, you can pass a list of callable functio
- with doc strings
```python
from swarms import Agent, OpenAIChat
from swarms import Agent
from swarm_models import OpenAIChat
from swarms_memory import ChromaDB
import subprocess
import os

@ -45,7 +45,8 @@ import os
from dotenv import load_dotenv
# Import the OpenAIChat model and the Agent struct
from swarms import Agent, OpenAIChat
from swarms import Agent
from swarm_models import OpenAIChat
# Load the environment variables
load_dotenv()
@ -71,7 +72,8 @@ agent.run("Generate a 10,000 word blog on health and wellness.")
`Agent` equipped with quasi-infinite long term memory. Great for long document understanding, analysis, and retrieval.
```python
from swarms import Agent, OpenAIChat
from swarms import Agent
from swarm_models import OpenAIChat
from swarms_memory import ChromaDB # Copy and paste the code and put it in your own local directory.
# Making an instance of the ChromaDB class
@ -327,7 +329,7 @@ import os
from dotenv import load_dotenv
from swarms.models.gpt4_vision_api import GPT4VisionAPI
from swarm_models.gpt4_vision_api import GPT4VisionAPI
from swarms.structs import Agent
# Load the environment variables

@ -189,7 +189,8 @@ swarm._save_to_csv()
```python
import os
from swarms import Agent, OpenAIChat
from swarms import Agent
from swarm_models import OpenAIChat
from swarms.prompts.finance_agent_sys_prompt import (
FINANCIAL_AGENT_SYS_PROMPT,
)
@ -241,7 +242,8 @@ swarm.run(
```python
import os
from swarms import Agent, OpenAIChat
from swarms import Agent
from swarm_models import OpenAIChat
from swarms.structs.spreadsheet_swarm import SpreadSheetSwarm
# Define custom system prompts for QR code generation
@ -308,7 +310,8 @@ swarm.run(
```python
import os
from swarms import Agent, OpenAIChat
from swarms import Agent
from swarm_models import OpenAIChat
from swarms.structs.spreadsheet_swarm import SpreadSheetSwarm
# Define custom system prompts for each social media platform

@ -46,7 +46,7 @@ Executes the task by calling the agent or model with the specified arguments and
```python
>>> from swarms.structs import Task, Agent
>>> from swarms.models import OpenAIChat
>>> from swarm_models import OpenAIChat
>>> agent = Agent(llm=OpenAIChat(openai_api_key=""), max_loops=1, dashboard=False)
>>> task = Task(description="What's the weather in Miami?", agent=agent)
>>> task.run()

@ -470,7 +470,8 @@ import os
import requests
from swarms import Agent, OpenAIChat
from swarms import Agent
from swarm_models import OpenAIChat
# Get the OpenAI API key from the environment variable
api_key = os.getenv("OPENAI_API_KEY")

@ -1,5 +1,6 @@
import os
from swarms import Agent, OpenAIChat
from swarms import Agent
from swarm_models import OpenAIChat
from swarms.prompts.finance_agent_sys_prompt import (
FINANCIAL_AGENT_SYS_PROMPT,
)

@ -1,5 +1,6 @@
import os
from swarms import Agent, OpenAIChat
from swarms import Agent
from swarm_models import OpenAIChat
from swarms.prompts.finance_agent_sys_prompt import (
FINANCIAL_AGENT_SYS_PROMPT,
)

@ -1,4 +1,5 @@
from swarms import Agent, OpenAIChat
from swarms import Agent
from swarm_models import OpenAIChat
## Initialize the workflow
agent = Agent(

@ -3,7 +3,8 @@ import os
from dotenv import load_dotenv
# Import the OpenAIChat model and the Agent struct
from swarms import Agent, OpenAIChat
from swarms import Agent
from swarm_models import OpenAIChat
from swarms_memory import ChromaDB
# Load the environment variables

@ -1,5 +1,6 @@
import os
from swarms import Agent, OpenAIChat
from swarms import Agent
from swarm_models import OpenAIChat
from swarms.prompts.finance_agent_sys_prompt import (
FINANCIAL_AGENT_SYS_PROMPT,
)

@ -1,5 +1,6 @@
import os
from swarms import Agent, OpenAIChat
from swarms import Agent
from swarm_models import OpenAIChat
from swarms.prompts.finance_agent_sys_prompt import (
FINANCIAL_AGENT_SYS_PROMPT,
)

@ -24,7 +24,8 @@ sys.path.insert(0, os.getcwd())
################ Adding project root to PYTHONPATH ################################
from swarms import Agent, OpenAIChat
from swarms import Agent
from swarm_models import OpenAIChat
from agentops import record_function

@ -1,5 +1,5 @@
from swarms import Agent
from swarms.models.base_llm import BaseLLM
from swarm_models.base_llm import BaseLLM
# Define a custom LLM class

@ -1,5 +1,5 @@
import json
from swarms.models.openai_function_caller import OpenAIFunctionCaller
from swarm_models.openai_function_caller import OpenAIFunctionCaller
from pydantic import BaseModel, Field
from typing import List
from swarms import Agent

@ -1,5 +1,5 @@
import os
from swarms.models.openai_function_caller import OpenAIFunctionCaller
from swarm_models.openai_function_caller import OpenAIFunctionCaller
from pydantic import BaseModel, Field
from typing import List

@ -1,4 +1,4 @@
from swarms.models.openai_function_caller import OpenAIFunctionCaller
from swarm_models.openai_function_caller import OpenAIFunctionCaller
from pydantic import BaseModel, Field

@ -1,4 +1,4 @@
from swarms.models.openai_function_caller import OpenAIFunctionCaller
from swarm_models.openai_function_caller import OpenAIFunctionCaller
from pydantic import BaseModel, Field
from typing import List
import json

@ -1,4 +1,4 @@
from swarms.models.openai_function_caller import OpenAIFunctionCaller
from swarm_models.openai_function_caller import OpenAIFunctionCaller
from pydantic import BaseModel

@ -1,4 +1,4 @@
from swarms.models.openai_function_caller import OpenAIFunctionCaller
from swarm_models.openai_function_caller import OpenAIFunctionCaller
from pydantic import BaseModel

@ -1,4 +1,4 @@
from swarms.models.openai_function_caller import OpenAIFunctionCaller
from swarm_models.openai_function_caller import OpenAIFunctionCaller
from pydantic import BaseModel, Field
from typing import Sequence

@ -1,4 +1,4 @@
from swarms.models.openai_function_caller import OpenAIFunctionCaller
from swarm_models.openai_function_caller import OpenAIFunctionCaller
from pydantic import BaseModel, Field
from typing import List

@ -1,4 +1,4 @@
from swarms.models.openai_function_caller import OpenAIFunctionCaller
from swarm_models.openai_function_caller import OpenAIFunctionCaller
from pydantic import BaseModel, Field

@ -11,7 +11,7 @@
"from multion.client import MultiOn\n",
"from swarms import Agent\n",
"import os\n",
"from swarms.models.base_llm import BaseLLM\n",
"from swarm_models.base_llm import BaseLLM\n",
"\n",
"def check_multion_api_key():\n",
" \"\"\"\n",

@ -1,4 +1,4 @@
from swarms.models.openai_function_caller import OpenAIFunctionCaller
from swarm_models.openai_function_caller import OpenAIFunctionCaller
from pydantic import BaseModel, Field
from swarms import create_file_in_folder
from swarms.utils.loguru_logger import logger

@ -1,4 +1,4 @@
from swarms.models.openai_function_caller import OpenAIFunctionCaller
from swarm_models.openai_function_caller import OpenAIFunctionCaller
from pydantic import BaseModel, Field
from swarms.utils.loguru_logger import logger
import threading

@ -1,4 +1,4 @@
from swarms.models.openai_function_caller import OpenAIFunctionCaller
from swarm_models.openai_function_caller import OpenAIFunctionCaller
from pydantic import BaseModel, Field
from swarms import create_file_in_folder
from swarms.tools.prebuilt.code_executor import CodeExecutor

@ -1,4 +1,5 @@
from swarms import Agent, OpenAIChat
from swarms import Agent
from swarm_models import OpenAIChat
## Initialize the workflow
agent = Agent(

@ -1,4 +1,5 @@
from swarms import Agent, OpenAIChat
from swarms import Agent
from swarm_models import OpenAIChat
agent = Agent(
agent_name="API Requester",

@ -1,4 +1,4 @@
from swarms.models.openai_function_caller import OpenAIFunctionCaller
from swarm_models.openai_function_caller import OpenAIFunctionCaller
from pydantic import BaseModel, Field
from swarms.tools.prebuilt.code_executor import CodeExecutor
from swarms.structs.concat import concat_strings

@ -1,5 +1,6 @@
import os
from swarms import Agent, OpenAIChat
from swarms import Agent
from swarm_models import OpenAIChat
# Get the OpenAI API key from the environment variable
api_key = os.getenv("OPENAI_API_KEY")

@ -1,6 +1,7 @@
import os
from swarms import Agent, OpenAIChat
from swarms import Agent
from swarm_models import OpenAIChat
# Get the OpenAI API key from the environment variable
api_key = os.getenv("OPENAI_API_KEY")

@ -1,6 +1,7 @@
import os
from swarms import Agent, OpenAIChat
from swarms import Agent
from swarm_models import OpenAIChat
from swarms.prompts.finance_agent_sys_prompt import (
FINANCIAL_AGENT_SYS_PROMPT,
)

@ -2,7 +2,8 @@ import os
import requests
from swarms import Agent, OpenAIChat
from swarms import Agent
from swarm_models import OpenAIChat
# Get the OpenAI API key from the environment variable
api_key = os.getenv("OPENAI_API_KEY")

@ -12,7 +12,8 @@ from plaid.model.transactions_get_response import (
TransactionsGetResponse,
)
from swarms import Agent, OpenAIChat
from swarms import Agent
from swarm_models import OpenAIChat
from swarms.prompts.finance_agent_sys_prompt import (
FINANCIAL_AGENT_SYS_PROMPT,
)

@ -2,7 +2,8 @@ import os
from dotenv import load_dotenv
from swarms import Agent, OpenAIChat
from swarms import Agent
from swarm_models import OpenAIChat
from swarms.agents.multion_agent import MultiOnAgent
from swarms_memory import ChromaDB
from swarms import tool

@ -10,7 +10,7 @@ from typing import Optional
from pydantic import BaseModel, Field
from swarms.models.openai_function_caller import OpenAIFunctionCaller
from swarm_models.openai_function_caller import OpenAIFunctionCaller
PROBABE_SYS_PROMPT = """

@ -10,7 +10,7 @@ from typing import Optional
from pydantic import BaseModel, Field
from swarms.models.openai_function_caller import OpenAIFunctionCaller
from swarm_models.openai_function_caller import OpenAIFunctionCaller
PROBABE_SYS_PROMPT = """

@ -3,7 +3,8 @@ import os
from dotenv import load_dotenv
from swarms import Agent, OpenAIChat
from swarms import Agent
from swarm_models import OpenAIChat
from swarms_memory import ChromaDB
from swarms.prompts.visual_cot import VISUAL_CHAIN_OF_THOUGHT
from swarms import tool

@ -13,7 +13,8 @@ import os
from dotenv import load_dotenv
# Import the OpenAIChat model and the Agent struct
from swarms import Agent, OpenAIChat
from swarms import Agent
from swarm_models import OpenAIChat
# Load the environment variables
load_dotenv()

@ -1,5 +1,5 @@
from swarms import Agent
from swarms.models.llama3_hosted import llama3Hosted
from swarm_models.llama3_hosted import llama3Hosted
from swarms_memory import ChromaDB
from swarms.tools.prebuilt.bing_api import fetch_web_articles_bing_api

@ -9,7 +9,8 @@ $ pip install swarms
-
"""
from swarms import Agent, OpenAIChat
from swarms import Agent
from swarm_models import OpenAIChat
from swarms_memory import ChromaDB
from swarms.tools.prebuilt.bing_api import fetch_web_articles_bing_api
import os

@ -3,7 +3,7 @@ import os
from dotenv import load_dotenv
import swarms.prompts.security_team as stsp
from swarms.models import GPT4VisionAPI
from swarm_models import GPT4VisionAPI
from swarms.structs import Agent
# Load environment variables and initialize the Vision API

@ -1091,7 +1091,7 @@
"\n",
"from dotenv import load_dotenv\n",
"\n",
"from swarms.models import GPT4VisionAPI\n",
"from swarm_models import GPT4VisionAPI\n",
"from swarms.prompts.logistics import (\n",
" Efficiency_Agent_Prompt,\n",
" Health_Security_Agent_Prompt,\n",
@ -1211,7 +1211,7 @@
"\n",
"from dotenv import load_dotenv\n",
"\n",
"from swarms.models.gpt4_vision_api import GPT4VisionAPI\n",
"from swarm_models.gpt4_vision_api import GPT4VisionAPI\n",
"from swarms.structs import Agent\n",
"\n",
"# Load the environment variables\n",

@ -2,7 +2,7 @@ import os
from dotenv import load_dotenv
from swarms.models import Anthropic, OpenAIChat
from swarm_models import Anthropic, OpenAIChat
from swarms.prompts.accountant_swarm_prompts import (
DECISION_MAKING_PROMPT,
DOC_ANALYZER_AGENT_PROMPT,

@ -3,8 +3,8 @@ import random
from dotenv import load_dotenv
from swarms.models import OpenAIChat
from swarms.models.stable_diffusion import StableDiffusion
from swarm_models import OpenAIChat
from swarm_models import StableDiffusion
from swarms.structs import Agent
load_dotenv()

@ -1,6 +1,7 @@
import concurrent
import csv
from swarms import Agent, OpenAIChat
from swarms import Agent
from swarm_models import OpenAIChat
from swarms_memory import ChromaDB
from dotenv import load_dotenv
from swarms.utils.parse_code import extract_code_from_markdown

@ -2,7 +2,7 @@ import os
from dotenv import load_dotenv
from swarms.models import Anthropic, OpenAIChat
from swarm_models import Anthropic, OpenAIChat
from swarms.prompts.ai_research_team import (
PAPER_IMPLEMENTOR_AGENT_PROMPT,
PAPER_SUMMARY_ANALYZER,

@ -1,4 +1,4 @@
from swarms.models.gpt4_vision_api import GPT4VisionAPI
from swarm_models.gpt4_vision_api import GPT4VisionAPI
from swarms.structs import Agent
llm = GPT4VisionAPI()

@ -1,6 +1,6 @@
import os
from dotenv import load_dotenv
from swarms.models import OpenAIChat
from swarm_models import OpenAIChat
from swarms.structs import Agent
import swarms.prompts.autoswarm as sdsp

@ -1,6 +1,6 @@
import re
from swarms.models.openai_models import OpenAIChat
from swarm_models.openai_models import OpenAIChat
class AutoTemp:

@ -3,7 +3,7 @@ import os
from autotemp import AutoTemp
from termcolor import colored
from swarms.models import OpenAIChat
from swarm_models import OpenAIChat
from swarms.structs import SequentialWorkflow

@ -19,7 +19,7 @@ import os
from dotenv import load_dotenv
from swarms.models import OpenAIChat
from swarm_models import OpenAIChat
from swarms.prompts.programming import DOCUMENTATION_SOP, TEST_SOP
from swarms.structs import Agent

@ -4,7 +4,7 @@ from dotenv import load_dotenv
import swarms.prompts.education as edu_prompts
from swarms import Agent, SequentialWorkflow
from swarms.models import OpenAIChat
from swarm_models import OpenAIChat
# Load environment variables
load_dotenv()

@ -2,7 +2,7 @@ import os
from dotenv import load_dotenv
from swarms.models.gemini import Gemini
from swarm_models.gemini import Gemini
from swarms.prompts.react import react_prompt
load_dotenv()

@ -2,7 +2,7 @@ import os
from dotenv import load_dotenv
from swarms.models.gemini import Gemini
from swarm_models.gemini import Gemini
from swarms.prompts.react import react_prompt
load_dotenv()

@ -2,7 +2,7 @@ import os
from dotenv import load_dotenv
from swarms.models import Gemini
from swarm_models import Gemini
from swarms.prompts.visual_cot import VISUAL_CHAIN_OF_THOUGHT
# Load the environment variables

@ -3,7 +3,7 @@ import os
from dotenv import load_dotenv
from termcolor import colored
from swarms.models import OpenAIChat
from swarm_models import OpenAIChat
from swarms.prompts.code_interpreter import CODE_INTERPRETER
from swarms.prompts.programming import DOCUMENTATION_SOP, TEST_SOP
from swarms.structs import Agent

@ -1,4 +1,4 @@
from swarms.models.gpt4_vision_api import GPT4VisionAPI
from swarm_models.gpt4_vision_api import GPT4VisionAPI
from swarms.prompts.multi_modal_autonomous_instruction_prompt import (
MULTI_MODAL_AUTO_AGENT_SYSTEM_PROMPT_1,
)

@ -3,7 +3,7 @@ import os
from dotenv import load_dotenv
# Import the OpenAIChat model and the Agent struct
from swarms.models import OpenAIChat
from swarm_models import OpenAIChat
# Load the environment variables
load_dotenv()

@ -2,7 +2,7 @@ import os
from dotenv import load_dotenv
from swarms.models import GPT4VisionAPI
from swarm_models import GPT4VisionAPI
from swarms.prompts.logistics import (
Efficiency_Agent_Prompt,
Health_Security_Agent_Prompt,

@ -1,4 +1,4 @@
from swarms.models.gpt4_vision_api import GPT4VisionAPI
from swarm_models.gpt4_vision_api import GPT4VisionAPI
from swarms.structs import Agent
llm = GPT4VisionAPI()

@ -2,7 +2,7 @@ import os
from dotenv import load_dotenv
from swarms.models.gpt4_vision_api import GPT4VisionAPI
from swarm_models.gpt4_vision_api import GPT4VisionAPI
from swarms.prompts.visual_cot import VISUAL_CHAIN_OF_THOUGHT
from swarms.structs import Agent

@ -4,9 +4,9 @@ import os
import streamlit as st
from dotenv import load_dotenv
from swarms.models import OpenAIChat
from swarms.models.gpt4_vision_api import GPT4VisionAPI
from swarms.models.stable_diffusion import StableDiffusion
from swarm_models import OpenAIChat
from swarm_models.gpt4_vision_api import GPT4VisionAPI
from swarm_models.stable_diffusion import StableDiffusion
from swarms.structs import Agent
# Load environment variables

@ -20,8 +20,8 @@ import os
from dotenv import load_dotenv
from termcolor import colored
from swarms.models.gpt4_vision_api import GPT4VisionAPI
from swarms.models.stable_diffusion import StableDiffusion
from swarm_models.gpt4_vision_api import GPT4VisionAPI
from swarm_models.stable_diffusion import StableDiffusion
# Load the environment variables
load_dotenv()

@ -4,7 +4,7 @@ import os
import requests
from dotenv import load_dotenv
from swarms.models import OpenAIChat
from swarm_models import OpenAIChat
from swarms.structs import Agent
# Load environment variables

@ -2,8 +2,8 @@ import os
from dotenv import load_dotenv
from swarms import Agent
from swarms.models import OpenAIChat
from swarms.models.gpt4_vision_api import GPT4VisionAPI
from swarm_models import OpenAIChat
from swarm_models.gpt4_vision_api import GPT4VisionAPI
from swarms.structs.rearrange import AgentRearrange
# Load the environment variables

@ -1,4 +1,4 @@
from swarms.models import vLLM
from swarm_models import vLLM
# Initialize vLLM with custom model and parameters
custom_vllm = vLLM(

@ -2,7 +2,7 @@ import os
from dotenv import load_dotenv
from swarms.models import OpenAIChat
from swarm_models import OpenAIChat
from swarms.structs import Agent
# import modal

@ -1,4 +1,5 @@
from swarms import Agent, OpenAIChat
from swarms import Agent
from swarm_models import OpenAIChat
from typing import List
from swarms_memory import ChromaDB

@ -2,7 +2,7 @@ import os
from dotenv import load_dotenv
from swarms.models import GPT4VisionAPI
from swarm_models import GPT4VisionAPI
from swarms.prompts.personal_stylist import (
ACCESSORIES_STYLIST_AGENT_PROMPT,
BEARD_STYLIST_AGENT_PROMPT,

@ -18,7 +18,7 @@ from examples.demos.plant_biologist_swarm.prompts import (
treatment_recommender_agent,
)
from swarms import Agent
from swarms.models.gpt_o import GPT4VisionAPI
from swarm_models.gpt_o import GPT4VisionAPI
# Load the OpenAI API key from the .env file
load_dotenv()

@ -10,7 +10,7 @@ from examples.demos.plant_biologist_swarm.prompts import (
)
from swarms import Agent, ConcurrentWorkflow
from swarms.models.gpt_o import GPT4VisionAPI
from swarm_models.gpt_o import GPT4VisionAPI
# Load the OpenAI API key from the .env file

@ -25,7 +25,7 @@ import os
from termcolor import colored
from swarms.models import OpenAIChat
from swarm_models import OpenAIChat
from swarms.prompts.autobloggen import (
AUTOBLOG_REVIEW_PROMPT,
DRAFT_AGENT_SYSTEM_PROMPT,

@ -4,7 +4,7 @@ from dotenv import load_dotenv
from termcolor import colored
import swarms.prompts.security_team as stsp
from swarms.models import GPT4VisionAPI
from swarm_models import GPT4VisionAPI
from swarms.structs import Agent
# Load environment variables and initialize the Vision API

@ -10,7 +10,8 @@ Example:
"""
from swarms import Agent, OpenAIChat
from swarms import Agent
from swarm_models import OpenAIChat
llm = OpenAIChat(max_tokens=4000)

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

Loading…
Cancel
Save