Giter Club home page Giter Club logo

kyegomez / swarms Goto Github PK

View Code? Open in Web Editor NEW
680.0 19.0 90.0 88.35 MB

Orchestrate Swarms of Agents From Any Framework Like OpenAI, Langchain, and Etc for Real World Workflow Automation. Join our Community: https://discord.gg/DbjBMJTSWD

Home Page: https://swarms.apac.ai

License: Other

Python 99.33% Shell 0.22% Dockerfile 0.14% Jupyter Notebook 0.15% Rust 0.17%
artificial-intelligence attention-mechanism gpt4 langchain machine-learning multi-modal-imaging multi-modality multimodal swarms transformer-models

swarms's Introduction

Swarming banner icon

Orchestrate swarms of agents for production-grade applications.

GitHub issues GitHub forks GitHub stars GitHub licenseGitHub star chartDependency Status Downloads

Join the Agora discordShare on Twitter Share on Facebook Share on LinkedIn

Share on Reddit Share on Hacker News Share on Pinterest Share on WhatsApp

Individual agents are barely being deployd into production because of 5 suffocating challanges: short memory, single task threading, hallucinations, high cost, and lack of collaboration. With Multi-agent collaboration, you can effectively eliminate all of these issues. Swarms provides you with simple, reliable, and agile primitives to build your own Swarm for your specific use case. Now, Swarms is being used in production by RBC, John Deere, and many AI startups. To learn more about the unparalled benefits about multi-agent collaboration check out this github repository for research papers or book a call with me!


Install

pip3 install -U swarms


Usage

Run example in Collab: Open In Colab

Agent

A fully plug-and-play autonomous agent powered by an LLM extended by a long-term memory database, and equipped with function calling for tool usage! By passing in an LLM, you can create a fully autonomous agent with extreme customization and reliability, ready for real-world task automation!

Features:

✅ Any LLM / Any framework

✅ Extremely customize-able with max loops, autosaving, import docs (PDFS, TXT, CSVs, etc), tool usage, etc etc

✅ Long term memory database with RAG (ChromaDB, Pinecone, Qdrant)

import os

from dotenv import load_dotenv

# Import the OpenAIChat model and the Agent struct
from swarms import Agent, OpenAIChat

# Load the environment variables
load_dotenv()

# Get the API key from the environment
api_key = os.environ.get("OPENAI_API_KEY")

# Initialize the language model
llm = OpenAIChat(
    temperature=0.5, model_name="gpt-4", openai_api_key=api_key, max_tokens=4000
)


## Initialize the workflow
agent = Agent(llm=llm, max_loops=1, autosave=True, dashboard=True)

# Run the workflow on a task
agent.run("Generate a 10,000 word blog on health and wellness.")

ToolAgent

ToolAgent is an agent that can use tools through JSON function calling. It intakes any open source model from huggingface and is extremely modular and plug in and play. We need help adding general support to all models soon.

from pydantic import BaseModel, Field
from transformers import AutoModelForCausalLM, AutoTokenizer

from swarms import ToolAgent
from swarms.utils.json_utils import base_model_to_json

# Load the pre-trained model and tokenizer
model = AutoModelForCausalLM.from_pretrained(
    "databricks/dolly-v2-12b",
    load_in_4bit=True,
    device_map="auto",
)
tokenizer = AutoTokenizer.from_pretrained("databricks/dolly-v2-12b")


# Initialize the schema for the person's information
class Schema(BaseModel):
    name: str = Field(..., title="Name of the person")
    agent: int = Field(..., title="Age of the person")
    is_student: bool = Field(
        ..., title="Whether the person is a student"
    )
    courses: list[str] = Field(
        ..., title="List of courses the person is taking"
    )


# Convert the schema to a JSON string
tool_schema = base_model_to_json(Schema)

# Define the task to generate a person's information
task = (
    "Generate a person's information based on the following schema:"
)

# Create an instance of the ToolAgent class
agent = ToolAgent(
    name="dolly-function-agent",
    description="Ana gent to create a child data",
    model=model,
    tokenizer=tokenizer,
    json_schema=tool_schema,
)

# Run the agent to generate the person's information
generated_data = agent.run(task)

# Print the generated data
print(f"Generated data: {generated_data}")

Worker

The Worker is a simple all-in-one agent equipped with an LLM, tools, and RAG for low level tasks.

✅ Plug in and Play LLM. Utilize any LLM from anywhere and any framework

✅ Reliable RAG: Utilizes FAISS for efficient RAG but it's modular so you can use any DB.

✅ Multi-Step Parallel Function Calling: Use any tool

# Importing necessary modules
import os

from dotenv import load_dotenv

from swarms import OpenAIChat, Worker, tool

# Loading environment variables from .env file
load_dotenv()

# Retrieving the OpenAI API key from environment variables
api_key = os.getenv("OPENAI_API_KEY")


# Create a tool
@tool
def search_api(query: str):
    pass


# Creating a Worker instance
worker = Worker(
    name="My Worker",
    role="Worker",
    human_in_the_loop=False,
    tools=[search_api],
    temperature=0.5,
    llm=OpenAIChat(openai_api_key=api_key),
)

# Running the worker with a prompt
out = worker.run("Hello, how are you? Create an image of how your are doing!")

# Printing the output
print(out)

Agent with Long Term Memory

Agent equipped with quasi-infinite long term memory. Great for long document understanding, analysis, and retrieval.

from swarms import Agent, ChromaDB, OpenAIChat

# Making an instance of the ChromaDB class
memory = ChromaDB(
    metric="cosine",
    n_results=3,
    output_dir="results",
    docs_folder="docs",
)

# Initializing the agent with the Gemini instance and other parameters
agent = Agent(
    agent_name="Covid-19-Chat",
    agent_description=(
        "This agent provides information about COVID-19 symptoms."
    ),
    llm=OpenAIChat(),
    max_loops="auto",
    autosave=True,
    verbose=True,
    long_term_memory=memory,
    stopping_condition="finish",
)

# Defining the task and image path
task = ("What are the symptoms of COVID-19?",)

# Running the agent with the specified task and image
out = agent.run(task)
print(out)

Agent with Long Term Memory ++ Tools!

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.

from swarms import Agent, ChromaDB, OpenAIChat, tool

# Making an instance of the ChromaDB class
memory = ChromaDB(
    metric="cosine",
    n_results=3,
    output_dir="results",
    docs_folder="docs",
)

# Initialize a tool
@tool
def search_api(query: str):
    # Add your logic here
    return query

# Initializing the agent with the Gemini instance and other parameters
agent = Agent(
    agent_name="Covid-19-Chat",
    agent_description=(
        "This agent provides information about COVID-19 symptoms."
    ),
    llm=OpenAIChat(),
    max_loops="auto",
    autosave=True,
    verbose=True,
    long_term_memory=memory,
    stopping_condition="finish",
    tools=[search_api],
)

# Defining the task and image path
task = ("What are the symptoms of COVID-19?",)

# Running the agent with the specified task and image
out = agent.run(task)
print(out)

SequentialWorkflow

Sequential Workflow enables you to sequentially execute tasks with Agent and then pass the output into the next agent and onwards until you have specified your max loops. SequentialWorkflow is wonderful for real-world business tasks like sending emails, summarizing documents, and analyzing data.

✅ Save and Restore Workflow states!

✅ Multi-Modal Support for Visual Chaining

✅ Utilizes Agent class

import os

from dotenv import load_dotenv

from swarms import Agent, OpenAIChat, SequentialWorkflow

load_dotenv()

# Load the environment variables
api_key = os.getenv("OPENAI_API_KEY")


# Initialize the language agent
llm = OpenAIChat(
    temperature=0.5, model_name="gpt-4", openai_api_key=api_key, max_tokens=4000
)


# Initialize the agent with the language agent
agent1 = Agent(llm=llm, max_loops=1)

# Create another agent for a different task
agent2 = Agent(llm=llm, max_loops=1)

# Create another agent for a different task
agent3 = Agent(llm=llm, max_loops=1)

# Create the workflow
workflow = SequentialWorkflow(max_loops=1)

# Add tasks to the workflow
workflow.add(
    agent1,
    "Generate a 10,000 word blog on health and wellness.",
)

# Suppose the next task takes the output of the first task as input
workflow.add(
    agent2,
    "Summarize the generated blog",
)

# Run the workflow
workflow.run()

# Output the results
for task in workflow.tasks:
    print(f"Task: {task.description}, Result: {task.result}")

ConcurrentWorkflow

ConcurrentWorkflow runs all the tasks all at the same time with the inputs you give it!

import os

from dotenv import load_dotenv

from swarms import Agent, ConcurrentWorkflow, OpenAIChat, Task

# Load environment variables from .env file
load_dotenv()

# Load environment variables
llm = OpenAIChat(openai_api_key=os.getenv("OPENAI_API_KEY"))
agent = Agent(llm=llm, max_loops=1)

# Create a workflow
workflow = ConcurrentWorkflow(max_workers=5)

# Create tasks
task1 = Task(agent, "What's the weather in miami")
task2 = Task(agent, "What's the weather in new york")
task3 = Task(agent, "What's the weather in london")

# Add tasks to the workflow
workflow.add(tasks=[task1, task2, task3])

# Run the workflow
workflow.run()

RecursiveWorkflow

RecursiveWorkflow will keep executing the tasks until a specific token like is located inside the text!

import os

from dotenv import load_dotenv

from swarms import Agent, OpenAIChat, RecursiveWorkflow, Task

# Load environment variables from .env file
load_dotenv()

# Load environment variables
llm = OpenAIChat(openai_api_key=os.getenv("OPENAI_API_KEY"))
agent = Agent(llm=llm, max_loops=1)

# Create a workflow
workflow = RecursiveWorkflow(stop_token="<DONE>")

# Create tasks
task1 = Task(agent, "What's the weather in miami")
task2 = Task(agent, "What's the weather in new york")
task3 = Task(agent, "What's the weather in london")

# Add tasks to the workflow
workflow.add(task1)
workflow.add(task2)
workflow.add(task3)

# Run the workflow
workflow.run()

ModelParallelizer

The ModelParallelizer allows you to run multiple models concurrently, comparing their outputs. This feature enables you to easily compare the performance and results of different models, helping you make informed decisions about which model to use for your specific task.

Plug-and-Play Integration: The structure provides a seamless integration with various models, including OpenAIChat, Anthropic, Mixtral, and Gemini. You can easily plug in any of these models and start using them without the need for extensive modifications or setup.

import os

from dotenv import load_dotenv

from swarms import Anthropic, Gemini, Mixtral, ModelParallelizer, OpenAIChat

load_dotenv()

# API Keys
anthropic_api_key = os.getenv("ANTHROPIC_API_KEY")
openai_api_key = os.getenv("OPENAI_API_KEY")
gemini_api_key = os.getenv("GEMINI_API_KEY")

# Initialize the models
llm = OpenAIChat(openai_api_key=openai_api_key)
anthropic = Anthropic(anthropic_api_key=anthropic_api_key)
mixtral = Mixtral()
gemini = Gemini(gemini_api_key=gemini_api_key)

# Initialize the parallelizer
llms = [llm, anthropic, mixtral, gemini]
parallelizer = ModelParallelizer(llms)

# Set the task
task = "Generate a 10,000 word blog on health and wellness."

# Run the task
out = parallelizer.run(task)

# Print the responses 1 by 1
for i in range(len(out)):
    print(f"Response from LLM {i}: {out[i]}")

Simple Conversational Agent

A Plug in and play conversational agent with GPT4, Mixytral, or any of our models

  • Reliable conversational structure to hold messages together with dynamic handling for long context conversations and interactions with auto chunking
  • Reliable, this simple system will always provide responses you want.
import os

from dotenv import load_dotenv

from swarms import Conversation, OpenAIChat

conv = Conversation(
    time_enabled=True,
)

# Load the environment variables
load_dotenv()

# Get the API key from the environment
api_key = os.environ.get("OPENAI_API_KEY")

# Initialize the language model
llm = OpenAIChat(openai_api_key=api_key, model_name="gpt-4")


# Run the language model in a loop
def interactive_conversation(llm):
    conv = Conversation()
    while True:
        user_input = input("User: ")
        conv.add("user", user_input)
        if user_input.lower() == "quit":
            break
        task = conv.return_history_as_string()  # Get the conversation history
        out = llm(task)
        conv.add("assistant", out)
        print(
            f"Assistant: {out}",
        )
    conv.display_conversation()
    conv.export_conversation("conversation.txt")


# Replace with your LLM instance
interactive_conversation(llm)

SwarmNetwork

SwarmNetwork provides the infrasturcture for building extremely dense and complex multi-agent applications that span across various types of agents.

✅ Efficient Task Management: SwarmNetwork's intelligent agent pool and task queue management system ensures tasks are distributed evenly across agents. This leads to efficient use of resources and faster task completion.

✅ Scalability: SwarmNetwork can dynamically scale the number of agents based on the number of pending tasks. This means it can handle an increase in workload by adding more agents, and conserve resources when the workload is low by reducing the number of agents.

✅ Versatile Deployment Options: With SwarmNetwork, each agent can be run on its own thread, process, container, machine, or even cluster. This provides a high degree of flexibility and allows for deployment that best suits the user's needs and infrastructure.

import os

from dotenv import load_dotenv

# Import the OpenAIChat model and the Agent struct
from swarms import Agent, OpenAIChat, SwarmNetwork

# Load the environment variables
load_dotenv()

# Get the API key from the environment
api_key = os.environ.get("OPENAI_API_KEY")

# Initialize the language model
llm = OpenAIChat(
    temperature=0.5,
    openai_api_key=api_key,
)

## Initialize the workflow
agent = Agent(llm=llm, max_loops=1, agent_name="Social Media Manager")
agent2 = Agent(llm=llm, max_loops=1, agent_name=" Product Manager")
agent3 = Agent(llm=llm, max_loops=1, agent_name="SEO Manager")


# Load the swarmnet with the agents
swarmnet = SwarmNetwork(
    agents=[agent, agent2, agent3],
)

# List the agents in the swarm network
out = swarmnet.list_agents()
print(out)

# Run the workflow on a task
out = swarmnet.run_single_agent(
    agent2.id, "Generate a 10,000 word blog on health and wellness."
)
print(out)


# Run all the agents in the swarm network on a task
out = swarmnet.run_many_agents("Generate a 10,000 word blog on health and wellness.")
print(out)

Task

Task is a simple structure for task execution with the Agent. Imagine zapier for LLM-based workflow automation

✅ Task is a structure for task execution with the Agent.

✅ Tasks can have descriptions, scheduling, triggers, actions, conditions, dependencies, priority, and a history.

✅ The Task structure allows for efficient workflow automation with LLM-based agents.

import os

from dotenv import load_dotenv

from swarms.structs import Agent, OpenAIChat, Task

# Load the environment variables
load_dotenv()


# Define a function to be used as the action
def my_action():
    print("Action executed")


# Define a function to be used as the condition
def my_condition():
    print("Condition checked")
    return True


# Create an agent
agent = Agent(
    llm=OpenAIChat(openai_api_key=os.environ["OPENAI_API_KEY"]),
    max_loops=1,
    dashboard=False,
)

# Create a task
task = Task(
    description=(
        "Generate a report on the top 3 biggest expenses for small"
        " businesses and how businesses can save 20%"
    ),
    agent=agent,
)

# Set the action and condition
task.set_action(my_action)
task.set_condition(my_condition)

# Execute the task
print("Executing task...")
task.run()

# Check if the task is completed
if task.is_completed():
    print("Task completed")
else:
    print("Task not completed")

# Output the result of the task
print(f"Task result: {task.result}")

BlockList

  • Modularity and Flexibility: BlocksList allows users to create custom swarms by adding or removing different classes or functions as blocks. This means users can easily tailor the functionality of their swarm to suit their specific needs.

  • Ease of Management: With methods to add, remove, update, and retrieve blocks, BlocksList provides a straightforward way to manage the components of a swarm. This makes it easier to maintain and update the swarm over time.

  • Enhanced Searchability: BlocksList offers methods to get blocks by various attributes such as name, type, ID, and parent-related properties. This makes it easier for users to find and work with specific blocks in a large and complex swarm.

import os

from dotenv import load_dotenv
from transformers import AutoModelForCausalLM, AutoTokenizer
from pydantic import BaseModel
from swarms import BlocksList, Gemini, GPT4VisionAPI, Mixtral, OpenAI, ToolAgent

# Load the environment variables
load_dotenv()

# Get the environment variables
openai_api_key = os.getenv("OPENAI_API_KEY")
gemini_api_key = os.getenv("GEMINI_API_KEY")

# Tool Agent
model = AutoModelForCausalLM.from_pretrained("databricks/dolly-v2-12b")
tokenizer = AutoTokenizer.from_pretrained("databricks/dolly-v2-12b")

# Initialize the schema for the person's information
class Schema(BaseModel):
    name: str = Field(..., title="Name of the person")
    agent: int = Field(..., title="Age of the person")
    is_student: bool = Field(
        ..., title="Whether the person is a student"
    )
    courses: list[str] = Field(
        ..., title="List of courses the person is taking"
    )

# Convert the schema to a JSON string
json_schema = base_model_to_json(Schema)


toolagent = ToolAgent(model=model, tokenizer=tokenizer, json_schema=json_schema)

# Blocks List which enables you to build custom swarms by adding classes or functions
swarm = BlocksList(
    "SocialMediaSwarm",
    "A swarm of social media agents",
    [
        OpenAI(openai_api_key=openai_api_key),
        Mixtral(),
        GPT4VisionAPI(openai_api_key=openai_api_key),
        Gemini(gemini_api_key=gemini_api_key),
    ],
)


# Add the new block to the swarm
swarm.add(toolagent)

# Remove a block from the swarm
swarm.remove(toolagent)

# Update a block in the swarm
swarm.update(toolagent)

# Get a block at a specific index
block_at_index = swarm.get(0)

# Get all blocks in the swarm
all_blocks = swarm.get_all()

# Get blocks by name
openai_blocks = swarm.get_by_name("OpenAI")

# Get blocks by type
gpt4_blocks = swarm.get_by_type("GPT4VisionAPI")

# Get blocks by ID
block_by_id = swarm.get_by_id(toolagent.id)

# Get blocks by parent
blocks_by_parent = swarm.get_by_parent(swarm)

# Get blocks by parent ID
blocks_by_parent_id = swarm.get_by_parent_id(swarm.id)

# Get blocks by parent name
blocks_by_parent_name = swarm.get_by_parent_name(swarm.name)

# Get blocks by parent type
blocks_by_parent_type = swarm.get_by_parent_type(type(swarm).__name__)

# Get blocks by parent description
blocks_by_parent_description = swarm.get_by_parent_description(swarm.description)

# Run the block in the swarm
inference = swarm.run_block(toolagent, "Hello World")
print(inference)

Majority Voting

Multiple-agents will evaluate an idea based off of an parsing or evaluation function. From papers like "More agents is all you need

from swarms import Agent, MajorityVoting, ChromaDB, Anthropic

# Initialize the llm
llm = Anthropic()

# Agents
agent1 = Agent(
    llm = llm,
    system_prompt="You are the leader of the Progressive Party. What is your stance on healthcare?",
    agent_name="Progressive Leader",
    agent_description="Leader of the Progressive Party",
    long_term_memory=ChromaDB(),
    max_steps=1,
)

agent2 = Agent(
    llm=llm,
    agent_name="Conservative Leader",
    agent_description="Leader of the Conservative Party",
    long_term_memory=ChromaDB(),
    max_steps=1,
)

agent3 = Agent(
    llm=llm,
    agent_name="Libertarian Leader",
    agent_description="Leader of the Libertarian Party",
    long_term_memory=ChromaDB(),
    max_steps=1,
)

# Initialize the majority voting
mv = MajorityVoting(
    agents=[agent1, agent2, agent3],
    output_parser=llm.majority_voting,
    autosave=False,
    verbose=True,
)


# Start the majority voting
mv.run("What is your stance on healthcare?")

Real-World Deployment

Multi-Agent Swarm for Logistics

Here's a production grade swarm ready for real-world deployment in a factory and logistics settings like warehouses. This swarm can automate 3 costly and inefficient workflows, safety checks, productivity checks, and warehouse security.

import os

from dotenv import load_dotenv

from swarms.models import GPT4VisionAPI
from swarms.prompts.logistics import (
    Efficiency_Agent_Prompt,
    Health_Security_Agent_Prompt,
    Productivity_Agent_Prompt,
    Quality_Control_Agent_Prompt,
    Safety_Agent_Prompt,
    Security_Agent_Prompt,
    Sustainability_Agent_Prompt,
)
from swarms.structs import Agent

# Load ENV
load_dotenv()
api_key = os.getenv("OPENAI_API_KEY")

# GPT4VisionAPI
llm = GPT4VisionAPI(openai_api_key=api_key)

# Image for analysis
factory_image = "factory_image1.jpg"

# Initialize agents with respective prompts
health_security_agent = Agent(
    llm=llm,
    sop=Health_Security_Agent_Prompt,
    max_loops=1,
    multi_modal=True,
)

# Quality control agent
quality_control_agent = Agent(
    llm=llm,
    sop=Quality_Control_Agent_Prompt,
    max_loops=1,
    multi_modal=True,
)


# Productivity Agent
productivity_agent = Agent(
    llm=llm,
    sop=Productivity_Agent_Prompt,
    max_loops=1,
    multi_modal=True,
)

# Initiailize safety agent
safety_agent = Agent(llm=llm, sop=Safety_Agent_Prompt, max_loops=1, multi_modal=True)

# Init the security agent
security_agent = Agent(
    llm=llm, sop=Security_Agent_Prompt, max_loops=1, multi_modal=True
)


# Initialize sustainability agent
sustainability_agent = Agent(
    llm=llm,
    sop=Sustainability_Agent_Prompt,
    max_loops=1,
    multi_modal=True,
)


# Initialize efficincy agent
efficiency_agent = Agent(
    llm=llm,
    sop=Efficiency_Agent_Prompt,
    max_loops=1,
    multi_modal=True,
)

# Run agents with respective tasks on the same image
health_analysis = health_security_agent.run(
    "Analyze the safety of this factory", factory_image
)
quality_analysis = quality_control_agent.run(
    "Examine product quality in the factory", factory_image
)
productivity_analysis = productivity_agent.run(
    "Evaluate factory productivity", factory_image
)
safety_analysis = safety_agent.run(
    "Inspect the factory's adherence to safety standards",
    factory_image,
)
security_analysis = security_agent.run(
    "Assess the factory's security measures and systems",
    factory_image,
)
sustainability_analysis = sustainability_agent.run(
    "Examine the factory's sustainability practices", factory_image
)
efficiency_analysis = efficiency_agent.run(
    "Analyze the efficiency of the factory's manufacturing process",
    factory_image,
)

Multi Modal Autonomous Agents

Run the agent with multiple modalities useful for various real-world tasks in manufacturing, logistics, and health.

# Description: This is an example of how to use the Agent class to run a multi-modal workflow
import os

from dotenv import load_dotenv

from swarms.models.gpt4_vision_api import GPT4VisionAPI
from swarms.structs import Agent

# Load the environment variables
load_dotenv()

# Get the API key from the environment
api_key = os.environ.get("OPENAI_API_KEY")

# Initialize the language model
llm = GPT4VisionAPI(
    openai_api_key=api_key,
    max_tokens=500,
)

# Initialize the task
task = (
    "Analyze this image of an assembly line and identify any issues such as"
    " misaligned parts, defects, or deviations from the standard assembly"
    " process. IF there is anything unsafe in the image, explain why it is"
    " unsafe and how it could be improved."
)
img = "assembly_line.jpg"

## Initialize the workflow
agent = Agent(
    llm=llm, max_loops="auto", autosave=True, dashboard=True, multi_modal=True
)

# Run the workflow on a task
agent.run(task=task, img=img)

Build your own LLMs, Agents, and Swarms!

Swarms Compliant Model Interface

from swarms import AbstractLLM

class vLLMLM(AbstractLLM):
    def __init__(self, model_name='default_model', tensor_parallel_size=1, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.model_name = model_name
        self.tensor_parallel_size = tensor_parallel_size
        # Add any additional initialization here
    
    def run(self, task: str):
        pass

# Example
model = vLLMLM("mistral")

# Run the model
out = model("Analyze these financial documents and summarize of them")
print(out)

Swarms Compliant Agent Interface

from swarms import Agent


class MyCustomAgent(Agent):

    def __init__(self, *args, **kwargs):

        super().__init__(*args, **kwargs)

        # Custom initialization logic

    def custom_method(self, *args, **kwargs):

        # Implement custom logic here

        pass

    def run(self, task, *args, **kwargs):

        # Customize the run method

        response = super().run(task, *args, **kwargs)

        # Additional custom logic

        return response`

# Model
agent = MyCustomAgent()

# Run the agent
out = agent("Analyze and summarize these financial documents: ")
print(out)

Compliant Interface for Multi-Agent Collaboration

from swarms import AutoSwarm, AutoSwarmRouter, BaseSwarm


# Build your own Swarm
class MySwarm(BaseSwarm):
    def __init__(self, name="kyegomez/myswarm", *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.name = name

    def run(self, task: str, *args, **kwargs):
        # Add your multi-agent logic here
        # agent 1
        # agent 2
        # agent 3
        return "output of the swarm"


# Add your custom swarm to the AutoSwarmRouter
router = AutoSwarmRouter(
    swarms=[MySwarm]
)


# Create an AutoSwarm instance
autoswarm = AutoSwarm(
    name="kyegomez/myswarm",
    description="A simple API to build and run swarms",
    verbose=True,
    router=router,
)


# Run the AutoSwarm
autoswarm.run("Analyze these financial data and give me a summary")

Documentation

Documentation is located here at: swarms.apac.ai


🫶 Contributions:

The easiest way to contribute is to pick any issue with the good first issue tag 💪. Read the Contributing guidelines here. Bug Report? File here | Feature Request? File here

Swarms is an open-source project, and contributions are VERY welcome. If you want to contribute, you can create new features, fix bugs, or improve the infrastructure. Please refer to the CONTRIBUTING.md and our contributing board to participate in Roadmap discussions!


Community

Join our growing community around the world, for real-time support, ideas, and discussions on Swarms 😊


Discovery Call

Book a discovery call to learn how Swarms can lower your operating costs by 40% with swarms of autonomous agents in lightspeed. Click here to book a time that works for you!

Accelerate Backlog

Help us accelerate our backlog by supporting us financially! Note, we're an open source corporation and so all the revenue we generate is through donations at the moment ;)

File Structure

The swarms package has been meticlously crafted for extreme use-ability and understanding, the swarms package is split up into various modules such as swarms.agents that holds pre-built agents, swarms.structs that holds a vast array of structures like Agent and multi agent structures. The 3 most important are structs, models, and agents.

├── __init__.py
├── agents
├── artifacts
├── chunkers
├── cli
├── loaders
├── memory
├── models
├── prompts
├── structs
├── telemetry
├── tokenizers
├── tools
├── utils
└── workers

Docker Instructions

This application uses Docker with CUDA support. To build and run the Docker container, follow these steps:

Prerequisites

Building the Docker Image

To build the Docker image, navigate to the root directory containing the Dockerfile and run the following command:

docker build --gpus all -t swarms

Running the Docker Container

To run the Docker container, use the following command:

docker run --gpus all -p 4000:80 swarms

Replace swarms with the name of your Docker image, and replace 4000:80 with your actual port mapping. The format is hostPort:containerPort.

Now, your application should be running with CUDA support!

Swarm Newsletter 🤖 🤖 🤖 📧

Sign up to the Swarm newsletter to receive updates on the latest Autonomous agent research papers, step by step guides on creating multi-agent app, and much more Swarmie goodiness 😊

CLICK HERE TO SIGNUP

License

Apache License

swarms's People

Contributors

dependabot[bot] avatar elder-plinius avatar evelynmitchell avatar goldenwind8 avatar grit-app[bot] avatar kyegomez avatar nullonesix avatar vyomakesh09 avatar wyatt-stanke avatar zackbradshaw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

swarms's Issues

[BUG]

Describe the bug
When I run the python example.py script, I get the following error message:

  File "/home/zack/code/swarms/example.py", line 2, in <module>
    from swarms.swarms import Swarms
  File "/home/zack/code/swarms/swarms/__init__.py", line 2, in <module>
    from swarms.swarms import Swarms, swarm
  File "/home/zack/code/swarms/swarms/swarms.py", line 4, in <module>
    from swarms.tools.agent_tools import *
  File "/home/zack/code/swarms/swarms/tools/__init__.py", line 2, in <module>
    from swarms.tools.main import process_csv, ReadFileTool, WriteFileTool, BaseTool, DuckDuckGoSearchRun
  File "/home/zack/code/swarms/swarms/tools/main.py", line 5, in <module>
    from langchain.agents.agent import AgentExecutor
ModuleNotFoundError: No module named 'langchain'```

**To Reproduce**
Please follow these steps to reproduce the behavior:
1. Go to the swarms directory
2. Run python example.py in the terminal
3. Observe the error message

**Expected behavior**
I expected the script to run without any errors and to produce some output.

**Screenshots**
I have attached a screenshot of the error message below.

**Additional context**
I have installed all the required dependencies and followed the instructions in the README file. I am using Python 3.8.10 on Ubuntu WSL

[BUG] RuntimeError: Failed to import transformers.models.fuyu.processing_fuyu

Traceback (most recent call last):
File "/home/v/.local/lib/python3.10/site-packages/transformers/utils/import_utils.py", line 1345, in _get_module
return importlib.import_module("." + module_name, self.name)
File "/usr/lib/python3.10/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1050, in _gcd_import
File "", line 1027, in _find_and_load
File "", line 1006, in _find_and_load_unlocked
File "", line 688, in _load_unlocked
File "", line 883, in exec_module
File "", line 241, in _call_with_frames_removed
File "/home/v/.local/lib/python3.10/site-packages/transformers/models/fuyu/processing_fuyu.py", line 29, in
from .image_processing_fuyu import FuyuBatchFeature
File "/home/v/.local/lib/python3.10/site-packages/transformers/models/fuyu/image_processing_fuyu.py", line 180, in
class FuyuImageProcessor(BaseImageProcessor):
File "/home/v/.local/lib/python3.10/site-packages/transformers/models/fuyu/image_processing_fuyu.py", line 365, in FuyuImageProcessor
resample: Optional[PILImageResampling] = None,
File "/usr/lib/python3.10/typing.py", line 312, in inner
return func(*args, **kwds)
File "/usr/lib/python3.10/typing.py", line 403, in getitem
return self._getitem(self, parameters)
File "/usr/lib/python3.10/typing.py", line 529, in Optional
arg = _type_check(parameters, f"{self} requires a single type.")
File "/usr/lib/python3.10/typing.py", line 176, in _type_check
raise TypeError(f"{msg} Got {arg!r:.100}.")
TypeError: typing.Optional requires a single type. Got <module 'PIL.Image' from '/usr/lib/python3/dist-packages/PIL/Image.py'>.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/home/v/swarms/fuyu.py", line 1, in
from swarms.models.fuyu import Fuyu
File "/home/v/swarms/swarms/models/fuyu.py", line 2, in
from transformers import (
File "", line 1075, in _handle_fromlist
File "/home/v/.local/lib/python3.10/site-packages/transformers/utils/import_utils.py", line 1336, in getattr
value = getattr(module, name)
File "/home/v/.local/lib/python3.10/site-packages/transformers/utils/import_utils.py", line 1335, in getattr
module = self._get_module(self._class_to_module[name])
File "/home/v/.local/lib/python3.10/site-packages/transformers/utils/import_utils.py", line 1347, in _get_module
raise RuntimeError(
RuntimeError: Failed to import transformers.models.fuyu.processing_fuyu because of the following error (look up to see its traceback):
typing.Optional requires a single type. Got <module 'PIL.Image' from '/usr/lib/python3/dist-packages/PIL/Image.py'>.

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar

[BUG] ImportError: cannot import name 'RunnableSerializable' from 'langchain.schema.runnable'

Traceback (most recent call last):
File "/home/v/swarms/swarms/structs/flow.py", line 16, in
from swarms.tools.tool import BaseTool
File "/home/v/.local/lib/python3.10/site-packages/swarms/tools/tool.py", line 30, in
from langchain.schema.runnable import Runnable, RunnableConfig, RunnableSerializable
ImportError: cannot import name 'RunnableSerializable' from 'langchain.schema.runnable' (/home/v/.local/lib/python3.10/site-packages/langchain/schema/runnable/init.py)

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar

Dev Containers

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar

Misc TODOs

Todo

[ / ] Add Multi Modal processing to the flow class using kwargs
Fix Groupchat and add Multi Modal processing

  • Fix the Multi Agent debate and collaboration class
  • clean up a lot of useless code, boss, worker, Utils, tools,
    [ X ] start working on combining flow with the tools by injecting the tools into the system prompt
    [ / ] Add system prompt to the flow class
  • Add distilled whispers
    [ X ]Create tutorial on using the Flow class
    [ X ] Create a tutorial on using the flow class with Fuyu for autonomous multi modal agents
    [ X ] Create Hierarchical swarm with agent that can spawn worker agents
    [ X ] Move all embedding models to models folder
    put positive Med prompts in prompts folder in a file called blog_generation
  • Schemas folder
  • worker commented out if Inits and

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar

[BUG] RuntimeError: Failed to import transformers.models.fuyu.processing_fuyu

Traceback (most recent call last):
File "/home/v/.local/lib/python3.10/site-packages/transformers/utils/import_utils.py", line 1345, in _get_module
return importlib.import_module("." + module_name, self.name)
File "/usr/lib/python3.10/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1050, in _gcd_import
File "", line 1027, in _find_and_load
File "", line 1006, in _find_and_load_unlocked
File "", line 688, in _load_unlocked
File "", line 883, in exec_module
File "", line 241, in _call_with_frames_removed
File "/home/v/.local/lib/python3.10/site-packages/transformers/models/fuyu/processing_fuyu.py", line 29, in
from .image_processing_fuyu import FuyuBatchFeature
File "/home/v/.local/lib/python3.10/site-packages/transformers/models/fuyu/image_processing_fuyu.py", line 180, in
class FuyuImageProcessor(BaseImageProcessor):
File "/home/v/.local/lib/python3.10/site-packages/transformers/models/fuyu/image_processing_fuyu.py", line 365, in FuyuImageProcessor
resample: Optional[PILImageResampling] = None,
File "/usr/lib/python3.10/typing.py", line 312, in inner
return func(*args, **kwds)
File "/usr/lib/python3.10/typing.py", line 403, in getitem
return self._getitem(self, parameters)
File "/usr/lib/python3.10/typing.py", line 529, in Optional
arg = _type_check(parameters, f"{self} requires a single type.")
File "/usr/lib/python3.10/typing.py", line 176, in _type_check
raise TypeError(f"{msg} Got {arg!r:.100}.")
TypeError: typing.Optional requires a single type. Got <module 'PIL.Image' from '/usr/lib/python3/dist-packages/PIL/Image.py'>.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/home/v/inhouse/fuyu.py", line 1, in
from swarms.models.fuyu import Fuyu
File "/home/v/.local/lib/python3.10/site-packages/swarms/models/fuyu.py", line 2, in
from transformers import (
File "", line 1075, in _handle_fromlist
File "/home/v/.local/lib/python3.10/site-packages/transformers/utils/import_utils.py", line 1336, in getattr
value = getattr(module, name)
File "/home/v/.local/lib/python3.10/site-packages/transformers/utils/import_utils.py", line 1335, in getattr
module = self._get_module(self._class_to_module[name])
File "/home/v/.local/lib/python3.10/site-packages/transformers/utils/import_utils.py", line 1347, in _get_module
raise RuntimeError(
RuntimeError: Failed to import transformers.models.fuyu.processing_fuyu because of the following error (look up to see its traceback):
typing.Optional requires a single type. Got <module 'PIL.Image' from '/usr/lib/python3/dist-packages/PIL/Image.py'>.

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar

sample cookie,json

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar

Stop spamming people with email

spammer

It would be great if you could stop spamming me, and others. See #40

There are so many closed issues from this. You are unethical @kyegomez.

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar

[BUG]

load_ssl_context verify=True cert=None trust_env=True http2=False
load_verify_locations cafile='/usr/local/lib/python3.10/dist-packages/certifi/cacert.pem'
Traceback (most recent call last):
File "/home/zack/code/swarms/example.py", line 19, in
node = Worker(
File "/home/zack/code/swarms/swarms/workers/worker.py", line 85, in init
self.setup_tools(external_tools)
File "/home/zack/code/swarms/swarms/workers/worker.py", line 138, in setup_tools
qa_chain=load_qa_with_sources_chain(self.llm)
File "/usr/local/lib/python3.10/dist-packages/langchain/chains/qa_with_sources/loading.py", line 182, in load_qa_with_sources_chain
return _func(llm, verbose=verbose, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/langchain/chains/qa_with_sources/loading.py", line 61, in _load_stuff_chain
llm_chain = LLMChain(llm=llm, prompt=prompt, verbose=verbose)
File "/usr/local/lib/python3.10/dist-packages/langchain/load/serializable.py", line 75, in init
super().init(**kwargs)
File "/usr/local/lib/python3.10/dist-packages/pydantic/v1/main.py", line 341, in init
raise validation_error
pydantic.v1.error_wrappers.ValidationError: 1 validation error for LLMChain
llm
value is not a valid dict (type=type_error.dict)

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar

[BUG]

Describe the bug
ImportError: cannot import name 'swarm' from 'swarms'

To Reproduce
Steps to reproduce the behavior:

  1. pip3 install swarms
  2. run example.py:
from swarms import swarm

objective = "What is the capital of the Uk"

swarm(objective)
  1. See the error
Traceback (most recent call last):
  File "/home/geeknik/example.py", line 1, in <module>
    from swarms import swarm
ImportError: cannot import name 'swarm' from 'swarms' (/home/geeknik/.local/lib/python3.11/site-packages/swarms/__init__.py)

Expected behavior
swarms should run as we just copied and pasted from the example in the README.

[BUG]

Title: AssertionError in FAISS library leading to RuntimeError in example2.py

Describe the bug:
While running the example2.py script from the Swarms repository, an AssertionError is triggered within the FAISS library during a similarity search operation. This error subsequently leads to a RuntimeError being raised, indicating an issue while running the agent.

To Reproduce:

  1. Navigate to the Swarms repository directory (~/code/swarms).
  2. Run the command python3 example2.py.
  3. Observe the error trace in the terminal.

Expected behavior:
The script should execute without errors, and the agent should run as expected.

Error Trace:

AssertionError at faiss/__init__.py:308 in replacement_search
...
RuntimeError: Error while running agent:
...

Additional context:

  • The error seems to be related to the FAISS library used for similarity search operations.
  • The AssertionError is triggered due to a mismatch in dimensions, as indicated by the assertion assert d == self.d.
  • The RuntimeError is raised within the run method of the worker.py file, indicating an issue while running the agent.

Raw stacktrace
(swarms) zack@ClownPuter:~/code/swarms$ python3 example2.py


/ // \ / \ / _ \ _ \ / \ / /
_
\ \ // // /\ \ | / / \ / \ ___
/ \ \ // | | | / Y \ /
/_______ / _/\ / _
|_ /|| /_|__ //_______ /
/ / / / / /


/ // \ / \ / _ \ _ \ / \ / /
_
\ \ // // /\ \ | / / \ / \ ___
/ \ \ // | | | / Y \ /
/_______ / _/\ / _
|_ /|| /_|__ //_______ /
/ / / / / /

Created a temporary directory at /tmp/tmp9rkryx5y
Writing /tmp/tmp9rkryx5y/_remote_module_non_scriptable.py
[2023-09-25 13:02:25,093] [INFO] [real_accelerator.py:158:get_accelerator] Setting ds_accelerator to cuda (auto detect)
2023-09-25 13:02:28.479975: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
Falling back to TensorFlow client; we recommended you install the Cloud TPU client directly with pip install cloud-tpu-client.
2023-09-25 13:02:29.074402: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
Creating converter from 7 to 5
Creating converter from 5 to 7
Creating converter from 7 to 5
Creating converter from 5 to 7
Popen(['git', 'version'], cwd=/home/zack/code/swarms, universal_newlines=False, shell=None, istream=None)
Popen(['git', 'version'], cwd=/home/zack/code/swarms, universal_newlines=False, shell=None, istream=None)
Trying paths: ['/home/zack/.docker/config.json', '/home/zack/.dockercfg']
Found file at path: /home/zack/.docker/config.json
Found 'auths' section
Auth data for registry.hf.space is absent. Client might be using a credentials store instead.
Found 'credsStore' section
load_ssl_context verify=True cert=None trust_env=True http2=False
load_verify_locations cafile='/home/zack/.local/lib/python3.10/site-packages/certifi/cacert.pem'
load_ssl_context verify=True cert=None trust_env=True http2=False
load_verify_locations cafile='/home/zack/.local/lib/python3.10/site-packages/certifi/cacert.pem'
[Tracing] Create new propagation context: {'trace_id': '5f1430b6307a4bbc85905c74401d881b', 'span_id': 'a40d54ce2ceeb934', 'parent_span_id': None, 'dynamic_sampling_context': None}
Entering wrapper
Entering wrapper
setup_tools executed in 5.602836608886719e-05 seconds
Exiting wrapper
init executed in 0.0005469322204589844 seconds
Exiting wrapper
Entering wrapper
Entering wrapper
setup_tools executed in 3.147125244140625e-05 seconds
Exiting wrapper
init executed in 0.0003647804260253906 seconds
Exiting wrapper
Entering wrapper
Entering wrapper
setup_tools executed in 2.9087066650390625e-05 seconds
Exiting wrapper
init executed in 0.00036787986755371094 seconds
Exiting wrapper
Entering wrapper
message='Request to OpenAI API' method=post path=https://api.openai.com/v1/embeddings
api_version=None data='{"input": ["[]"], "model": "text-embedding-ada-002", "encoding_format": "base64"}' message='Post details'
Converted retries value: 2 -> Retry(total=2, connect=None, read=None, redirect=None, status=None)
Starting new HTTPS connection (1): api.openai.com:443
https://api.openai.com:443 "POST /v1/embeddings HTTP/1.1" 200 None
message='OpenAI API response' path=https://api.openai.com/v1/embeddings processing_ms=27 request_id=8a01ac83d1623b3225ac9ad08115f683 response_code=200
Error in wrapper: Error while running agent:
Traceback (most recent call last):
raise e
File "/home/zack/.local/lib/python3.10/site-packages/langchain/chains/base.py", line 237, in call
self._call(inputs, run_manager=run_manager) ine 93, in run
File "/home/zack/.local/lib/python3.10/site-packages/langchain/chains/llm.py", line 92, in _call
response = self.generate([inputs], run_manager=run_manager)
File "/home/zack/.local/lib/python3.10/site-packages/langchain/chains/llm.py", line 101, in generate
prompts, stop = self.prep_prompts(input_list, run_manager=run_manager)
File "/home/zack/.local/lib/python3.10/site-packages/langchain/chains/llm.py", line 135, in prep_prompts
prompt = self.prompt.format_prompt(**selected_inputs)
File "/home/zack/.local/lib/python3.10/site-packages/langchain/prompts/chat.py", line 248, in format_prompt
messages = self.format_messages(**kwargs)
File "/home/zack/.local/lib/python3.10/site-packages/langchain_experimental/autonomous_agents/autogpt/prompt.py", line 53, in format_messages
relevant_docs = memory.get_relevant_documents(str(previous_messages[-10:]))
File "/home/zack/.local/lib/python3.10/site-packages/langchain/schema/retriever.py", line 181, in get_relevant_documents
raise e
File "/home/zack/.local/lib/python3.10/site-packages/langchain/schema/retriever.py", line 174, in get_relevant_documents line 53, in format_messages
result = self._get_relevant_documents(
File "/home/zack/.local/lib/python3.10/site-packages/langchain/vectorstores/base.py", line 499, in _get_relevant_dumentsocuments
docs = self.vectorstore.similarity_search(query, **self.search_kwargs) uments
File "/home/zack/.local/lib/python3.10/site-packages/langchain/vectorstores/faiss.py", line 326, in similarity_search ocuments
docs_and_scores = self.similarity_search_with_score(
File "/home/zack/.local/lib/python3.10/site-packages/langchain/vectorstores/faiss.py", line 268, in similarity_searchrch_with_score
docs = self.similarity_search_with_score_by_vector( rch_with_score
File "/home/zack/.local/lib/python3.10/site-packages/langchain/vectorstores/faiss.py", line 211, in similarity_search_with_score_by_vector rch_with_score_by_vector
scores, indices = self.index.search(vector, k if filter is None else fetch_k)
File "/home/zack/.local/lib/python3.10/site-packages/faiss/init.py", line 308, in replacement_search
assert d == self.d
AssertionError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/zack/code/swarms/example2.py", line 44, in
results = debate.run(task)
File "/home/zack/code/swarms/example2.py", line 16, in run
response = speaker.run(task)
File "/home/zack/code/swarms/swarms/utils/decorators.py", line 11, in wrapper
result = func(*args, **kwargs)
File "/home/zack/code/swarms/swarms/utils/decorators.py", line 19, in wrapper
return func(*args, **kwargs)
File "/home/zack/code/swarms/swarms/utils/decorators.py", line 28, in wrapper
result = func(*args, **kwargs)
File "/home/zack/code/swarms/swarms/workers/worker.py", line 225, in run
raise RuntimeError(f"Error while running agent: {error}")
RuntimeError: Error while running agent:

[BUG] ValueError: The following `model_kwargs` are not used by the model

Zephyr modal

################################

Traceback (most recent call last):
File "/home/v/inhouse/zephyr.py", line 5, in
output = model("Tell me a joke about programmers")
File "/home/v/.local/lib/python3.10/site-packages/swarms/models/zephyr.py", line 61, in call
outputs = self.pipe(prompt, max_new_token=self.max_new_tokens)
File "/home/v/.local/lib/python3.10/site-packages/transformers/pipelines/text_generation.py", line 208, in call
return super().call(text_inputs, **kwargs)
File "/home/v/.local/lib/python3.10/site-packages/transformers/pipelines/base.py", line 1140, in call
return self.run_single(inputs, preprocess_params, forward_params, postprocess_params)
File "/home/v/.local/lib/python3.10/site-packages/transformers/pipelines/base.py", line 1147, in run_single
model_outputs = self.forward(model_inputs, **forward_params)
File "/home/v/.local/lib/python3.10/site-packages/transformers/pipelines/base.py", line 1046, in forward
model_outputs = self._forward(model_inputs, **forward_params)
File "/home/v/.local/lib/python3.10/site-packages/transformers/pipelines/text_generation.py", line 271, in _forward
generated_sequence = self.model.generate(input_ids=input_ids, attention_mask=attention_mask, **generate_kwargs)
File "/home/v/.local/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "/home/v/.local/lib/python3.10/site-packages/transformers/generation/utils.py", line 1485, in generate
self._validate_model_kwargs(model_kwargs.copy())
File "/home/v/.local/lib/python3.10/site-packages/transformers/generation/utils.py", line 1262, in _validate_model_kwargs
raise ValueError(
ValueError: The following model_kwargs are not used by the model: ['max_new_token'] (note: typos in the generate arguments will also show up in this list)

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar

cant install

Failed to build Pillow sentencepiece scikit-image
ERROR: Could not build wheels for Pillow, sentencepiece, scikit-image, which is required to install pyproject.toml-based projects
PS C:\Users\strau>

[FEAT] saving all metadata from sessions and being able to restore them (resume session)

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar

[BUG]

Describe the bug

Traceback (most recent call last):
  File "C:\ai\Swarms\Swarm_Worker.py", line 1, in <module>
    from swarms.workers.worker_node import worker_node
  File "C:\AI\Python\lib\site-packages\swarms\workers\worker_node.py", line 12, in <module>
    from swarms.agents.tools.autogpt import (
  File "C:\AI\Python\lib\site-packages\swarms\agents__init__.py", line 6, in <module>
    from swarms.agents.models.huggingface import HuggingFaceLLM
  File "C:\AI\Python\lib\site-packages\swarms\agents\models\huggingface.py", line 1, in <module>
    import torch
ModuleNotFoundError: No module named 'torch'

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

[BUG] Failed to import transformers.models.fuyu.processing_fuyu

Traceback (most recent call last):
File "/home/v/swarms/fuyu.py", line 1, in
from swarms.models.fuyu import Fuyu
File "/home/v/swarms/swarms/models/fuyu.py", line 2, in
from transformers import (
File "", line 1075, in _handle_fromlist
File "/home/v/.local/lib/python3.10/site-packages/transformers/utils/import_utils.py", line 1336, in getattr
value = getattr(module, name)
File "/home/v/.local/lib/python3.10/site-packages/transformers/utils/import_utils.py", line 1335, in getattr
module = self._get_module(self._class_to_module[name])
File "/home/v/.local/lib/python3.10/site-packages/transformers/utils/import_utils.py", line 1347, in _get_module
raise RuntimeError(
RuntimeError: Failed to import transformers.models.fuyu.processing_fuyu because of the following error (look up to see its traceback):
typing.Optional requires a single type. Got <module 'PIL.Image' from '/usr/lib/python3/dist-packages/PIL/Image.py'>.

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar

[BUG] groupchat

message='Request to OpenAI API' method=post path=https://api.openai.com/v1/completions
api_version=None data='{"prompt": ["\n\n SYSTEM_PROMPT: \n You are in a role play game. The following roles are available:\n silly: YOU ARE SILLY, YOU OFFER NOTHING OF VALUE\ndetective: YOU ARE VERY SMART AND ANSWER RIDDLES\nriddler: YOU MAKE RIDDLES.\n\n Read the following conversation.\n Then select the next role from ['silly', 'detective', 'riddler'] to play. Only return the role.\n \n\n History: 'manager:Write me a riddle\n'system:Read the above conversation. Then select the next most suitable role from ['silly', 'detective', 'riddler'] to play. Only return the role.\n\n Your response:\n "], "model": "text-davinci-003", "temperature": 0.5, "max_tokens": 3000, "top_p": 1, "frequency_penalty": 0, "presence_penalty": 0, "n": 1, "logit_bias": {}}' message='Post details'
Converted retries value: 2 -> Retry(total=2, connect=None, read=None, redirect=None, status=None)
Starting new HTTPS connection (1): api.openai.com:443
https://api.openai.com:443 "POST /v1/completions HTTP/1.1" 200 None
message='OpenAI API response' path=https://api.openai.com/v1/completions processing_ms=332 request_id=f211861aed1265c644856ba2f4426cc1 response_code=200
Traceback (most recent call last):
File "C:\Users\Guest1\Desktop\swarms\swarms\swarms\groupchat.py", line 72, in select_speaker
return self.agent_by_name(name["content"])
File "C:\Users\Guest1\Desktop\swarms\swarms\swarms\groupchat.py", line 33, in agent_by_name
raise ValueError(f"No agent found with a name contained in '{name}'.")
ValueError: No agent found with a name contained in '
Riddler'.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\Guest1\Desktop\swarms\groupchat.py", line 49, in
chat_history = chat_manager("Write me a riddle")
File "C:\Users\Guest1\Desktop\swarms\swarms\swarms\groupchat.py", line 97, in call
speaker = self.groupchat.select_speaker(
File "C:\Users\Guest1\Desktop\swarms\swarms\swarms\groupchat.py", line 74, in select_speaker
return self.next_agent(last_speaker)
File "C:\Users\Guest1\Desktop\swarms\swarms\swarms\groupchat.py", line 37, in next_agent
return self.agents[(self.agent_names.index(agent.name) + 1) % len(self.agents)]
ValueError: 'manager' is not in list

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar

[BUG] Support Docker for easy install and use

Describe the bug
N/A - Feature Request for Docker Support

To Reproduce
Not applicable as this is a feature request rather than a bug report.

Expected behavior
I am proposing the addition of Docker support for the tool. Many users could benefit from a Docker container that has everything installed and configured to run the tool. This would not only streamline the setup process for various environments but would also potentially address a range of issues that users are currently facing with installation and compatibility.

Screenshots
Not applicable.

Additional context
Through an analysis of the repository's issues and bugs, it is evident that a significant number of them are related to environment setup and configuration challenges. Providing a Dockerfile and supporting documentation would allow users to run the tool in a containerized environment, ensuring consistency across different systems and significantly reducing the setup time. This would likely result in a reduction of environment-specific issues and improve overall user satisfaction with the tool. Moreover, a Docker container would facilitate easier adoption and testing of the tool across different platforms, which could lead to increased use and contributions to the project.


Remember to adjust the context to the specific details of the repository and the issues you've observed. This template acts as a suggestion rather than a bug report and should be modified to fit the particularities of the repository's contribution process.

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar

[BUG]

INFO:faiss.loader:Loading faiss with AVX2 support.
Loading faiss with AVX2 support.
INFO:faiss.loader:Could not load library with AVX2 support due to:
ModuleNotFoundError("No module named 'faiss.swigfaiss_avx2'")
Could not load library with AVX2 support due to:
ModuleNotFoundError("No module named 'faiss.swigfaiss_avx2'")
INFO:faiss.loader:Loading faiss.
Loading faiss.
INFO:faiss.loader:Successfully loaded faiss.
Successfully loaded faiss.
ERROR:root:Failed to initialize language model: 'HierarchicalSwarm' object has no attribute 'llm_class'
Failed to initialize language model: 'HierarchicalSwarm' object has no attribute 'llm_class'
ERROR:root:Failed to initialize tools: 1 validation error for LLMChain
llm
none is not an allowed value (type=type_error.none.not_allowed)
Failed to initialize tools: 1 validation error for LLMChain
llm
none is not an allowed value (type=type_error.none.not_allowed)
ERROR:root:An error occurred in run: 1 validation error for LLMChain
llm
none is not an allowed value (type=type_error.none.not_allowed)
An error occurred in run: 1 validation error for LLMChain
llm
none is not an allowed value (type=type_error.none.not_allowed)
None

[BUG]

Traceback (most recent call last):
File "C:\Users\Guest1\swarms\example.py", line 27, in
from swarms import OpenAI
File "C:\Users\Guest1\swarms\swarms_init_.py", line 1, in
from swarms.swarms.swarms import HierarchicalSwarm, swarm
File "C:\Users\Guest1\swarms\swarms\swarms\swarms.py", line 7, in
from swarms.boss.boss_node import BossNode
File "C:\Users\Guest1\swarms\swarms\boss\boss_node.py", line 11, in
from langchain_experimental.autonomous_agents import BabyAGI
ModuleNotFoundError: No module named 'langchain_experimental'

[BUG]

Traceback (most recent call last):
File "C:\Users\Guest1\swarms\example.py", line 2, in
from swarms.swarms.swarms import HierarchicalSwarm
File "C:\Users\Guest1\swarms\swarms_init_.py", line 1, in
from swarms.swarms.swarms import HierarchicalSwarm, swarm
File "C:\Users\Guest1\swarms\swarms\swarms\swarms.py", line 8, in
from swarms.workers.worker_node import WorkerNode
File "C:\Users\Guest1\swarms\swarms\workers\worker_node.py", line 13, in
from swarms.agents.tools.autogpt import (
File "C:\Users\Guest1\swarms\swarms\agents_init_.py", line 7, in
from swarms.agents.models.palm import GooglePalm
File "C:\Users\Guest1\swarms\swarms\agents\models\palm.py", line 16, in
import google.generativeai as genai
ModuleNotFoundError: No module named 'google.generativeai'

[FEAT][`GroupChat` class where it intakes multiple `Flow` agents as inputs and the enables all to all communication

  1. Understand the Current Implementation: Before you start, make sure you understand how the Flow class currently works. It's designed to handle sequential responses from a language model, with features like user-defined queries, dynamic generation until a token is outputted, and interactive modes where the AI generates a response and then waits for user input.

  2. Define the Group Chat Feature: Next, you need to define what the group chat feature should do. For example, it might need to handle multiple users, keep track of the order of messages, and allow users to join or leave the chat.

  3. Design the Interface: Think about how the group chat feature will be used. You might need to add new methods to the Flow class, or modify existing ones. For example, you might need a method to add a user to the chat, and another method to handle a message from a user.

  4. Implement the Feature: Once you've designed the interface, you can start implementing the feature. You might need to modify the Flow class and other parts of the swarms framework. Make sure to test your changes as you go along to ensure everything still works as expected.

  5. Look at AutoGen for Inspiration: Microsoft's AutoGen is a tool for automatically generating Python code, and it might give you some ideas for how to implement the group chat feature. However, keep in mind that AutoGen is a code generation tool, while swarms is a framework for controlling language models, so not everything in AutoGen will be directly applicable.

  6. Document Your Changes: Finally, make sure to document your changes. This includes both code comments and user-facing documentation. You should explain how to use the group chat feature, and any limitations it might have.

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar

[BUG] I get an error when trying to install with pip install on windows 11

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to cmd
  2. Run 'pip install swarms'
  3. I get Errors
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

Downloading threadpoolctl-3.2.0-py3-none-any.whl (15 kB)
Building wheels for collected packages: google-search-results, Pillow, sentencepiece, wget, wikipedia, fast-bss-eval, basicsr, bs4, ggl, antlr4-python3-runtime, test-tube, ctc-segmentation, scikit-image, stringcase, torch-stoi, validators, ci-sdr, ffmpy, future, julius, audioread, jaconv, mir-eval, pesq, pystoi, distance
  Building wheel for google-search-results (pyproject.toml) ... done
  Created wheel for google-search-results: filename=google_search_results-2.4.2-py3-none-any.whl size=32076 sha256=e6c51d57bc6c6119f5dd8396417a0b1826525e47d61692867e1793b728c48cba
  Stored in directory: c:\users\mako\appdata\local\pip\cache\wheels\6e\42\3e\aeb691b02cb7175ec70e2da04b5658d4739d2b41e5f73cd06f
  Building wheel for Pillow (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for Pillow (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [199 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build\lib.win-amd64-cpython-311
      creating build\lib.win-amd64-cpython-311\PIL
      copying src\PIL\BdfFontFile.py -> build\lib.win-amd64-cpython-311\PIL
      copying src\PIL\BlpImagePlugin.py -> build\lib.win-amd64-cpython-311\PIL
    
      [...]

      running egg_info
      writing src\Pillow.egg-info\PKG-INFO
      writing dependency_links to src\Pillow.egg-info\dependency_links.txt
      writing top-level names to src\Pillow.egg-info\top_level.txt
      reading manifest file 'src\Pillow.egg-info\SOURCES.txt'
      reading manifest template 'MANIFEST.in'
      warning: no files found matching '*.c'
      warning: no files found matching '*.h'
      warning: no files found matching '*.sh'
      warning: no previously-included files found matching '.appveyor.yml'
      warning: no previously-included files found matching '.clang-format'
      warning: no previously-included files found matching '.coveragerc'
      warning: no previously-included files found matching '.editorconfig'
      warning: no previously-included files found matching '.readthedocs.yml'
      warning: no previously-included files found matching 'codecov.yml'
      warning: no previously-included files matching '.git*' found anywhere in distribution
      warning: no previously-included files matching '*.pyc' found anywhere in distribution
      warning: no previously-included files matching '*.so' found anywhere in distribution
      no previously-included directories found matching '.ci'
      adding license file 'LICENSE'
      writing manifest file 'src\Pillow.egg-info\SOURCES.txt'
      running build_ext


      The headers or library files could not be found for zlib,
      a required dependency when compiling Pillow from source.

      Please see the install instructions at:
         https://pillow.readthedocs.io/en/latest/installation.html

      Traceback (most recent call last):
        File "<string>", line 989, in <module>
        File "C:\Users\Mako\AppData\Local\Temp\pip-build-env-1rb622qp\overlay\Lib\site-packages\setuptools\__init__.py", line 107, in setup
          return distutils.core.setup(**attrs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\Mako\AppData\Local\Temp\pip-build-env-1rb622qp\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 185, in setup
          return run_commands(dist)
                 ^^^^^^^^^^^^^^^^^^
        File "C:\Users\Mako\AppData\Local\Temp\pip-build-env-1rb622qp\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 201, in run_commands
          dist.run_commands()
        File "C:\Users\Mako\AppData\Local\Temp\pip-build-env-1rb622qp\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 969, in run_commands
          self.run_command(cmd)
        File "C:\Users\Mako\AppData\Local\Temp\pip-build-env-1rb622qp\overlay\Lib\site-packages\setuptools\dist.py", line 1234, in run_command
          super().run_command(command)
        File "C:\Users\Mako\AppData\Local\Temp\pip-build-env-1rb622qp\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
          cmd_obj.run()
        File "C:\Users\Mako\AppData\Local\Temp\pip-build-env-1rb622qp\overlay\Lib\site-packages\wheel\bdist_wheel.py", line 343, in run
          self.run_command("build")
        File "C:\Users\Mako\AppData\Local\Temp\pip-build-env-1rb622qp\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 318, in run_command
          self.distribution.run_command(command)
        File "C:\Users\Mako\AppData\Local\Temp\pip-build-env-1rb622qp\overlay\Lib\site-packages\setuptools\dist.py", line 1234, in run_command
          super().run_command(command)
        File "C:\Users\Mako\AppData\Local\Temp\pip-build-env-1rb622qp\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
          cmd_obj.run()
        File "C:\Users\Mako\AppData\Local\Temp\pip-build-env-1rb622qp\overlay\Lib\site-packages\setuptools\_distutils\command\build.py", line 131, in run
          self.run_command(cmd_name)
        File "C:\Users\Mako\AppData\Local\Temp\pip-build-env-1rb622qp\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 318, in run_command
          self.distribution.run_command(command)
        File "C:\Users\Mako\AppData\Local\Temp\pip-build-env-1rb622qp\overlay\Lib\site-packages\setuptools\dist.py", line 1234, in run_command
          super().run_command(command)
        File "C:\Users\Mako\AppData\Local\Temp\pip-build-env-1rb622qp\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
          cmd_obj.run()
        File "C:\Users\Mako\AppData\Local\Temp\pip-build-env-1rb622qp\overlay\Lib\site-packages\setuptools\command\build_ext.py", line 84, in run
          _build_ext.run(self)
        File "C:\Users\Mako\AppData\Local\Temp\pip-build-env-1rb622qp\overlay\Lib\site-packages\setuptools\_distutils\command\build_ext.py", line 345, in run
          self.build_extensions()
        File "<string>", line 804, in build_extensions
      RequiredDependencyException: zlib

      During handling of the above exception, another exception occurred:

      Traceback (most recent call last):
        File "C:\Users\Mako\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
          main()
        File "C:\Users\Mako\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\Mako\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 251, in build_wheel
          return _build_backend().build_wheel(wheel_directory, config_settings,
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\Mako\AppData\Local\Temp\pip-build-env-1rb622qp\overlay\Lib\site-packages\setuptools\build_meta.py", line 416, in build_wheel
          return self._build_with_temp_dir(['bdist_wheel'], '.whl',
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\Mako\AppData\Local\Temp\pip-build-env-1rb622qp\overlay\Lib\site-packages\setuptools\build_meta.py", line 401, in _build_with_temp_dir
          self.run_setup()
        File "C:\Users\Mako\AppData\Local\Temp\pip-build-env-1rb622qp\overlay\Lib\site-packages\setuptools\build_meta.py", line 488, in run_setup
          self).run_setup(setup_script=setup_script)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\Mako\AppData\Local\Temp\pip-build-env-1rb622qp\overlay\Lib\site-packages\setuptools\build_meta.py", line 338, in run_setup
          exec(code, locals())
        File "<string>", line 1009, in <module>
      RequiredDependencyException:

      The headers or library files could not be found for zlib,
      a required dependency when compiling Pillow from source.

      Please see the install instructions at:
         https://pillow.readthedocs.io/en/latest/installation.html


      <string>:45: RuntimeWarning: Pillow 9.0.0 does not support Python 3.11 and does not provide prebuilt Windows binaries. We do not recommend building from source on Windows.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for Pillow
  Building wheel for sentencepiece (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for sentencepiece (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [21 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build\lib.win-amd64-cpython-311
      creating build\lib.win-amd64-cpython-311\sentencepiece
      copying src\sentencepiece/__init__.py -> build\lib.win-amd64-cpython-311\sentencepiece
      copying src\sentencepiece/_version.py -> build\lib.win-amd64-cpython-311\sentencepiece
      copying src\sentencepiece/sentencepiece_model_pb2.py -> build\lib.win-amd64-cpython-311\sentencepiece
      copying src\sentencepiece/sentencepiece_pb2.py -> build\lib.win-amd64-cpython-311\sentencepiece
      running build_ext
      building 'sentencepiece._sentencepiece' extension
      creating build\temp.win-amd64-cpython-311
      creating build\temp.win-amd64-cpython-311\Release
      creating build\temp.win-amd64-cpython-311\Release\src
      creating build\temp.win-amd64-cpython-311\Release\src\sentencepiece
      "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -IC:\Users\Mako\AppData\Local\Programs\Python\Python311\include -IC:\Users\Mako\AppData\Local\Programs\Python\Python311\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\cppwinrt" /EHsc /Tpsrc/sentencepiece/sentencepiece_wrap.cxx /Fobuild\temp.win-amd64-cpython-311\Release\src/sentencepiece/sentencepiece_wrap.obj /std:c++17 /MT /I..\build\root\include
      cl : Command line warning D9025 : overriding '/MD' with '/MT'
      sentencepiece_wrap.cxx
      src/sentencepiece/sentencepiece_wrap.cxx(2822): fatal error C1083: Cannot open include file: 'sentencepiece_processor.h': No such file or directory
      error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for sentencepiece
  Building wheel for wget (pyproject.toml) ... done
  Created wheel for wget: filename=wget-3.2-py3-none-any.whl size=9681 sha256=1282f62a07aa70236894f95ef5169b9b7d3937f111304afd7feabc5967b96fc2
  Stored in directory: c:\users\mako\appdata\local\pip\cache\wheels\40\b3\0f\a40dbd1c6861731779f62cc4babcb234387e11d697df70ee97
  Building wheel for wikipedia (pyproject.toml) ... done
  Created wheel for wikipedia: filename=wikipedia-1.4.0-py3-none-any.whl size=11706 sha256=578792ce700a33b6045021f419231862107683a1ba0338e9d550a143785af6b4
  Stored in directory: c:\users\mako\appdata\local\pip\cache\wheels\8f\ab\cb\45ccc40522d3a1c41e1d2ad53b8f33a62f394011ec38cd71c6
  Building wheel for fast-bss-eval (pyproject.toml) ... done
  Created wheel for fast-bss-eval: filename=fast_bss_eval-0.1.3-py3-none-any.whl size=44282 sha256=ba76c586c8c534b8742b36188520e1ba2c0aacee02d9208eac967f3daef419eb
  Stored in directory: c:\users\mako\appdata\local\pip\cache\wheels\2f\d5\72\11a8ce448bcaf14da47a215ac5131bb3aaea2cb4dc2a749db6
  Building wheel for basicsr (pyproject.toml) ... done
  Created wheel for basicsr: filename=basicsr-1.4.2-py3-none-any.whl size=214848 sha256=e362594bd5f70798f317958fe1ad1ec5a3245b4ee7273a6eb5c867bec4e42f08
  Stored in directory: c:\users\mako\appdata\local\pip\cache\wheels\6d\a4\b3\9f888ba88efcae6dd4bbce69832363de9c4051142674f779fa
  Building wheel for bs4 (pyproject.toml) ... done
  Created wheel for bs4: filename=bs4-0.0.1-py3-none-any.whl size=1266 sha256=9e31c84f7920295942ae804f78ddd14b28afd08ea743a90188031dee150a3143
  Stored in directory: c:\users\mako\appdata\local\pip\cache\wheels\d4\c8\5b\b5be9c20e5e4503d04a6eac8a3cd5c2393505c29f02bea0960
  Building wheel for ggl (pyproject.toml) ... done
  Created wheel for ggl: filename=ggl-1.1.0-py3-none-any.whl size=1971 sha256=bf75d8994c51ec80086561c9bdbac098ea54039c97cf936e73836d1f16ce291e
  Stored in directory: c:\users\mako\appdata\local\pip\cache\wheels\2b\99\16\6cc4997f1c55ca12c32d5011bc97d9fa40b31a75c065d5ce78
  Building wheel for antlr4-python3-runtime (pyproject.toml) ... done
  Created wheel for antlr4-python3-runtime: filename=antlr4_python3_runtime-4.9.3-py3-none-any.whl size=144578 sha256=b4817ef37a46e9c8bac1d064606db70a0b7e89065396870e51762d645d992336
  Stored in directory: c:\users\mako\appdata\local\pip\cache\wheels\1a\97\32\461f837398029ad76911109f07047fde1d7b661a147c7c56d1
  Building wheel for test-tube (pyproject.toml) ... done
  Created wheel for test-tube: filename=test_tube-0.7.5-py3-none-any.whl size=25340 sha256=3c07c7862c2617c98b5f10f392df73e02370ee648919a70fb62c786147d643a0
  Stored in directory: c:\users\mako\appdata\local\pip\cache\wheels\bd\ba\61\6afbaf4b593765f126f73e502b6d48a8c85fbcbd582f62ea47
  Building wheel for ctc-segmentation (pyproject.toml) ... done
  Created wheel for ctc-segmentation: filename=ctc_segmentation-1.7.4-cp311-cp311-win_amd64.whl size=45121 sha256=75ec28e652a64c6af5897a555cad376b583f12cc6863fbae74071ac33fa95e8a
  Stored in directory: c:\users\mako\appdata\local\pip\cache\wheels\b2\39\af\4cbf13dcd38573884e16d39aaa330b5627d7552245c76cc922
  Building wheel for scikit-image (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for scikit-image (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [759 lines of output]
      setup.py:9: DeprecationWarning:

        `numpy.distutils` is deprecated since NumPy 1.23.0, as a result
        of the deprecation of `distutils` itself. It will be removed for
        Python >= 3.12. For older Python versions it will remain present.
        It is recommended to use `setuptools < 60.0` for those Python versions.
        For more details, see:
          https://numpy.org/devdocs/reference/distutils_status_migration.html


        from numpy.distutils.command.build_ext import build_ext as npy_build_ext
      Partial import of skimage during the build process.
      Compiling C:\Users\Mako\AppData\Local\Temp\pip-install-bmf5h7s1\scikit-image_5e6fafb0fa8941c299aef0f8629d90a5\skimage\morphology\_skeletonize_3d_cy.pyx because it changed.
      [1/1] Cythonizing C:\Users\Mako\AppData\Local\Temp\pip-install-bmf5h7s1\scikit-image_5e6fafb0fa8941c299aef0f8629d90a5\skimage\morphology\_skeletonize_3d_cy.pyx
      running bdist_wheel
      running build
      running config_cc
      INFO: unifing config_cc, config, build_clib, build_ext, build commands --compiler options
      running config_fc
      INFO: unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options
      running build_src
      INFO: build_src
      INFO: building extension "skimage._shared.geometry" sources
      INFO: building extension "skimage._shared.transform" sources
      INFO: building extension "skimage._shared.interpolation" sources
      INFO: building extension "skimage._shared.fast_exp" sources
      INFO: building extension "skimage.draw._draw" sources
      INFO: building extension "skimage.feature._cascade" sources
      INFO: building extension "skimage.feature.corner_cy" sources
      INFO: building extension "skimage.feature.censure_cy" sources
      INFO: building extension "skimage.feature.orb_cy" sources
      INFO: building extension "skimage.feature._texture" sources
      INFO: building extension "skimage.feature._hoghistogram" sources
      INFO: building extension "skimage.feature._haar" sources
      INFO: building extension "skimage.feature._sift" sources
      INFO: building extension "skimage.feature.brief_cy" sources
      INFO: building extension "skimage.feature._hessian_det_appx" sources
      INFO: building extension "skimage.restoration._unwrap_1d" sources
      INFO: building extension "skimage.restoration._unwrap_2d" sources
      INFO: building extension "skimage.restoration._unwrap_3d" sources
      INFO: building extension "skimage.restoration._denoise_cy" sources
      INFO: building extension "skimage.restoration._nl_means_denoising" sources
      INFO: building extension "skimage.restoration._rolling_ball_cy" sources
      INFO: building extension "skimage.restoration._inpaint" sources
      INFO: building extension "skimage.filters.rank.core_cy" sources
      INFO: building extension "skimage.filters.rank.core_cy_3d" sources
      INFO: building extension "skimage.filters._multiotsu" sources
      INFO: building extension "skimage.filters.rank.generic_cy" sources
      INFO: building extension "skimage.filters.rank.percentile_cy" sources
      INFO: building extension "skimage.filters.rank.bilateral_cy" sources
      INFO: building extension "skimage.future.graph._ncut_cy" sources
      INFO: building extension "skimage.graph._spath" sources
      INFO: building extension "skimage.graph._mcp" sources
      INFO: building extension "skimage.graph.heap" sources
      INFO: building extension "skimage.io._plugins._colormixer" sources
      INFO: building extension "skimage.io._plugins._histograms" sources
      INFO: building extension "skimage.measure._ccomp" sources
      INFO: building extension "skimage.measure._find_contours_cy" sources
      INFO: building extension "skimage.measure._moments_cy" sources
      INFO: building extension "skimage.measure._marching_cubes_classic_cy" sources
      INFO: building extension "skimage.measure._marching_cubes_lewiner_cy" sources
      INFO: building extension "skimage.measure._pnpoly" sources
      INFO: building extension "skimage.morphology._skeletonize_cy" sources
      INFO: building extension "skimage.morphology._convex_hull" sources
      INFO: building extension "skimage.morphology._grayreconstruct" sources
      INFO: building extension "skimage.morphology._max_tree" sources
      INFO: building extension "skimage.morphology._skeletonize_3d_cy" sources
      INFO: building extension "skimage.morphology._extrema_cy" sources
      INFO: building extension "skimage.morphology._flood_fill_cy" sources
      INFO: building extension "skimage.transform._hough_transform" sources
      INFO: building extension "skimage.transform._warps_cy" sources
      INFO: building extension "skimage.transform._radon_transform" sources
      INFO: building extension "skimage.util._remap" sources
      INFO: building extension "skimage.segmentation._watershed_cy" sources
      INFO: building extension "skimage.segmentation._felzenszwalb_cy" sources
      INFO: building extension "skimage.segmentation._quickshift_cy" sources
      INFO: building extension "skimage.segmentation._slic" sources
      INFO: building data_files sources
      INFO: build_src: building npy-pkg config files
      running build_py
  
[...]



      running build_ext
      INFO: No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
      INFO: customize MSVCCompiler
      INFO: customize MSVCCompiler using ConditionalOpenMP
      INFO: CCompilerOpt.cc_test_flags[1085] : testing flags (/O2)
      creating C:\Users\Mako\AppData\Local\Temp\tmpdorups9n\Users
      creating C:\Users\Mako\AppData\Local\Temp\tmpdorups9n\Users\Mako
      creating C:\Users\Mako\AppData\Local\Temp\tmpdorups9n\Users\Mako\AppData

    [...]

      INFO: CCompilerOpt._parse_target_tokens[2032] : skip targets (FMA4 VX VSX VXE2 VXE ASIMD NEON XOP VSX2 VSX4 VSX3) not part of baseline or dispatch-able features
      INFO: CCompilerOpt._parse_policy_not_keepbase[2144] : skip baseline features (SSE2)
      INFO: CCompilerOpt.generate_dispatch_header[2365] : generate CPU dispatch header: (build\src.win-amd64-3.11\numpy\distutils\include\npy_cpu_dispatch_config.h)
      WARN: CCompilerOpt.generate_dispatch_header[2374] : dispatch header dir build\src.win-amd64-3.11\numpy\distutils\include does not exist, creating it
      INFO: CCompilerOpt.feature_extra_checks[1639] : Testing extra checks for feature 'AVX512F' (AVX512F_REDUCE)
      INFO: CCompilerOpt.feature_extra_checks[1639] : Testing extra checks for feature 'AVX512_SKX' (AVX512BW_MASK AVX512DQ_MASK)
      INFO: No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
      INFO: customize MSVCCompiler
      WARN: Missing compiler_cxx fix for MSVCCompiler
      INFO: customize MSVCCompiler using ConditionalOpenMP
      INFO: C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\bin\HostX86\x64\cl.exe /c /nologo /O2 /W3 /GL /DNDEBUG /MD -IC:\Users\Mako\AppData\Local\Programs\Python\Python311\include -IC:\Users\Mako\AppData\Local\Programs\Python\Python311\include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\include -IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared -IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um -IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\cppwinrt /Tctest.c /Fotest.obj /openmp
    
    [...]
    
      INFO: building 'skimage.feature.brief_cy' extension
      INFO: compiling C sources
      INFO: clang-cl.exe /c /nologo /O2 /W3 /GL /DNDEBUG /MD -DENABLE_PYTHON_MODULE -D__PYTHRAN__=3 -DPYTHRAN_BLAS_NONE -IC:\Users\Mako\AppData\Local\Temp\pip-build-env-8_k1rim6\overlay\Lib\site-packages/pythran -IC:\Users\Mako\AppData\Local\Temp\pip-build-env-8_k1rim6\overlay\Lib\site-packages\numpy\core\include -IC:\Users\Mako\AppData\Local\Temp\pip-build-env-8_k1rim6\overlay\Lib\site-packages\numpy\core\include -Ibuild\src.win-amd64-3.11\numpy\distutils\include -IC:\Users\Mako\AppData\Local\Programs\Python\Python311\include -IC:\Users\Mako\AppData\Local\Programs\Python\Python311\include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\include -IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared -IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um -IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\cppwinrt /EHsc /Tpskimage/feature/brief_pythran.cpp /Fobuild\temp.win-amd64-3.11\Release\skimage/feature/brief_pythran.obj /std:c++14 /w /openmp /Zm1000


      [WinError 2] The system cannot find the file specified


      error: Command "clang-cl.exe /c /nologo /O2 /W3 /GL /DNDEBUG /MD -DENABLE_PYTHON_MODULE -D__PYTHRAN__=3 -DPYTHRAN_BLAS_NONE -IC:\Users\Mako\AppData\Local\Temp\pip-build-env-8_k1rim6\overlay\Lib\site-packages/pythran -IC:\Users\Mako\AppData\Local\Temp\pip-build-env-8_k1rim6\overlay\Lib\site-packages\numpy\core\include -IC:\Users\Mako\AppData\Local\Temp\pip-build-env-8_k1rim6\overlay\Lib\site-packages\numpy\core\include -Ibuild\src.win-amd64-3.11\numpy\distutils\include -IC:\Users\Mako\AppData\Local\Programs\Python\Python311\include -IC:\Users\Mako\AppData\Local\Programs\Python\Python311\include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\include -IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared -IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um -IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\cppwinrt /EHsc /Tpskimage/feature/brief_pythran.cpp /Fobuild\temp.win-amd64-3.11\Release\skimage/feature/brief_pythran.obj /std:c++14 /w /openmp /Zm1000" failed with exit status 127
      INFO:
      ########### EXT COMPILER OPTIMIZATION ###########
      INFO: Platform      :
        Architecture: x64
        Compiler    : msvc

      CPU baseline  :
        Requested   : 'min'
        Enabled     : SSE SSE2 SSE3
        Flags       : none
        Extra checks: none

      CPU dispatch  :
        Requested   : 'max -xop -fma4'
        Enabled     : SSSE3 SSE41 POPCNT SSE42 AVX F16C FMA3 AVX2 AVX512F AVX512CD AVX512_SKX AVX512_CLX AVX512_CNL AVX512_ICL
        Generated   : none
      INFO: CCompilerOpt.cache_flush[863] : write cache to path -> C:\Users\Mako\AppData\Local\Temp\pip-install-bmf5h7s1\scikit-image_5e6fafb0fa8941c299aef0f8629d90a5\build\temp.win-amd64-3.11\Release\ccompiler_opt_cache_ext.py
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for scikit-image
  Building wheel for stringcase (pyproject.toml) ... done
  Created wheel for stringcase: filename=stringcase-1.2.0-py3-none-any.whl size=3581 sha256=0dce040fea2f17722f9e5faf995980432d6177c45d7f70d0290cb5a7e6db71f5
  Stored in directory: c:\users\mako\appdata\local\pip\cache\wheels\b4\33\6d\d0820be98063da218c3206fbad2381cd2db3fbb1a0f0d254b5
 
[...]

  Stored in directory: c:\users\mako\appdata\local\pip\cache\wheels\fb\cd\9c\3ab5d666e3bcacc58900b10959edd3816cc9557c7337986322
Successfully built google-search-results wget wikipedia fast-bss-eval basicsr bs4 ggl antlr4-python3-runtime test-tube ctc-segmentation stringcase torch-stoi validators ci-sdr ffmpy future julius audioread jaconv mir-eval pesq pystoi distance
Failed to build Pillow sentencepiece scikit-image
ERROR: Could not build wheels for Pillow, sentencepiece, scikit-image, which is required to install pyproject.toml-based projects

[BUG] Failed to import transformers.models.fuyu.processing_fuyu

RuntimeError: Failed to import transformers.models.fuyu.processing_fuyu because of the following error (look up to see its traceback):
typing.Optional requires a single type. Got <module 'PIL.Image' from '/usr/lib/python3/dist-packages/PIL/Image.py'>.

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar

ModuleNotFoundError: No module named 'swarms.agents.workers.models.GroundingDINO.groundingdino'

─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ /content/swarms/example.py:1 in <module>                                                         │
│                                                                                                  │
│ ❱  1 from swarms import Swarms                                                                   │
│    2                                                                                             │
│    3                                                                                             │
│    4 # Retrieve your API key from the environment or replace with your actual key                │
│                                                                                                  │
│ /content/swarms/swarms/__init__.py:1 in <module>                                                 │
│                                                                                                  │
│ ❱ 1 from swarms.swarms import Swarms, swarm                                                      │
│   2                                                                                              │
│                                                                                                  │
│ /content/swarms/swarms/swarms.py:4 in <module>                                                   │
│                                                                                                  │
│     1 from swarms.tools.agent_tools import *                                                     │
│     2 from swarms.agents.workers.worker_agent import WorkerNode                                  │
│     3 from swarms.agents.boss.boss_agent import BossNode                                         │
│ ❱   4 from swarms.agents.workers.omni_agent import OmniWorkerAgent                               │
│     5                                                                                            │
│     6                                                                                            │
│     7                                                                                            │
│                                                                                                  │
│ /content/swarms/swarms/agents/workers/omni_agent.py:3 in <module>                                │
│                                                                                                  │
│    1 #boss node -> worker agent -> omni agent [worker of the worker]                             │
│    2 from langchain.tools import tool                                                            │
│ ❱  3 from swarms.agents.workers.multi_modal.omni_agent import chat_huggingface                   │
│    4                                                                                             │
│    5 class OmniWorkerAgent:                                                                      │
│    6 │   def __init__(self, api_key, api_endpoint, api_type):                                    │
│                                                                                                  │
│ /content/swarms/swarms/agents/workers/multi_modal/__init__.py:1 in <module>                      │
│                                                                                                  │
│ ❱ 1 from swarms.agents.workers.multi_modal.multi_modal_agent import MultiModalVisualAgent        │
│   2 from swarms.agents.workers.multi_modal.omni_agent import chat_huggingface                    │
│   3                                                                                              │
│                                                                                                  │
│ /content/swarms/swarms/agents/workers/multi_modal/multi_modal_agent.py:36 in <module>            │
│                                                                                                  │
│     33                                                                                           │
│     34 # Grounding DINO                                                                          │
│     35 # import groundingdino.datasets.transforms as T                                           │
│ ❱   36 from swarms.agents.workers.models.GroundingDINO.groundingdino.datasets.transforms import  │
│     37 │   Compose,                                                                              │
│     38 │   Normalize,                                                                            │
│     39 │   ToTensor,                                                                             │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
ModuleNotFoundError: No module named 'swarms.agents.workers.models.GroundingDINO.groundingdino'

[FEAT][Add Tool logic to `Agent` class

Integrating tools with Flow

  • Parse the wrapped tool function for the docstrings
  • Inject the tool usage prompt with the function into the llm's prompt
  • We need to parse the llm output to use the tool
            @tool("search", return_direct=True)
            def search_api(query: str) -> str:
                # Searches the API for the query.
                return

Example

from swarms.models import OpenAIChat
from swarms.structs import Flow
from swarms.tools import tool


api_key = ""

# Initialize the language model, this model can be swapped out with Anthropic, ETC, Huggingface Models like Mistral, ETC
llm = OpenAIChat(
    openai_api_key=api_key,
    temperature=0.5,
    max_tokens=3000,
)



# Tool usage example
@tool
def search_api(query: str):
   """Search the web with this tool"""
     pass



# Initialize the flow
flow = Flow(llm=llm, max_loops=5, dashboard=True, tools=[search_api])

out = flow.run("Generate a 10,000 word blog on health and wellness.")

print(out)

Reference

Learn how the worker uses tool: https://github.com/kyegomez/swarms/blob/master/swarms/agents/agent.py

tool Documentation

How It Works

  1. Decorator Functionality:
    The tool decorator can be used in several ways, based on the arguments passed to it. It supports transforming simple functions, asynchronous functions, or objects implementing a Runnable interface into a tool.

  2. Arguments Handling:

    • *args: This is a variable argument list allowing different types of inputs (string, Callable, or Runnable).
    • return_direct: If set to True, the tool returns directly without continuing the loop in which it's running.
    • args_schema: An optional Pydantic model (BaseModel) for validating input arguments to the tool.
    • infer_schema: If True, the tool attempts to infer the argument schema from the function signature.
  3. Tool Creation:

    • The decorator checks the type of arguments it receives and accordingly creates a tool.
    • For a Runnable object, it wraps its invocation methods (ainvoke for async, invoke for sync) into a tool.
    • For a function, it either uses StructuredTool.from_function if infer_schema is True or creates a basic Tool otherwise.
  4. Schema Inference:

    • If infer_schema is True, the decorator infers the input schema for the tool based on the function's signature.
    • This allows the resultant tool to accept a dictionary as input to its run() method.
  5. Error Handling:

    • The decorator ensures that if infer_schema is False, the function must have a docstring to provide a description.

Example Usages

  1. Simple Function as a Tool:

    @tool
    def search_api(query: str) -> str:
        # Function body
  2. Named Tool with Direct Return:

    @tool("search", return_direct=True)
    def search_api(query: str) -> str:
        # Function body
  3. Using Runnable:

    @tool("runnable_tool")
    class MyRunnable(Runnable):
        # Implementation of Runnable

Expected Outputs

  • The decorator converts functions or runnables into tools that can be utilized within a larger framework, possibly an agent-based system.
  • These tools can be executed either synchronously or asynchronously, depending on their nature.
  • They may accept structured inputs (if schema inference is enabled) and can be designed to either return their output directly or continue in a loop.

Use Cases

This kind of tool creation is particularly useful in systems where you need modular, reusable components that can be plugged into different parts of an application, especially in scenarios involving asynchronous operations, agent-based simulations, or complex workflows requiring structured input/output handling.

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar

Inferencing for local models

Could not import duckduckgo-search python package. Please install it with pip install duckduckgo-search. (type=value_error)
tried pip install duckduckgo-search but this is still not working

[FEATURE] Add Benchmarks

Need standardized benchmarks that can be run by any agent class

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar

[BUG] module not found langchain schema vectorstore

Describe the bug
ModuleNotFoundError: No module named 'langchain.schema.vectorstore'

To Reproduce
Steps to reproduce the behavior:

pip install swarms

import swarms

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar

Use commit messages as intended

Nearly every commit message in this repository is titled "clean up". I would suggest to use a descriptive commit message which actually says what the commit changes. That's the whole reason why the commit message exists. Otherwise people cannot really interpret the history of the project.

[BUG]

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Installing swarms

Expected behavior
Upon installation

Screenshots
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

Install the latest PowerShell for new features and improvements! https://aka.ms/PSWindows

PS C:\Users....> pip3 install swarms
Collecting swarms
Obtaining dependency information for swarms from https://files.pythonhosted.org/packages/d6/59/04b7724a7c7c96761ad2b3572fc8d2affb044cf1dd03334058a70bfb5590/swarms-1.3.2-py3-none-any.whl.metadata
Downloading swarms-1.3.2-py3-none-any.whl.metadata (1.2 kB)
Collecting transformers (from swarms)
Obtaining dependency information for transformers from https://files.pythonhosted.org/packages/21/02/ae8e595f45b6c8edee07913892b3b41f5f5f273962ad98851dc6a564bbb9/transformers-4.31.0-py3-none-any.whl.metadata
Downloading transformers-4.31.0-py3-none-any.whl.metadata (116 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 116.9/116.9 kB 3.4 MB/s eta 0:00:00
Requirement already satisfied: openai in c:\ai\python\lib\site-packages (from swarms) (0.27.2)
Collecting langchain==0.0.240 (from swarms)
Obtaining dependency information for langchain==0.0.240 from https://files.pythonhosted.org/packages/59/d0/074f7fbd7323623cca4175e0323c2cff565d5cf8c6b58f5dc81f046aa29f/langchain-0.0.240-py3-none-any.whl.metadata
Downloading langchain-0.0.240-py3-none-any.whl.metadata (14 kB)
Collecting asyncio (from swarms)
Using cached asyncio-3.4.3-py3-none-any.whl (101 kB)
Collecting nest-asyncio (from swarms)
Obtaining dependency information for nest-asyncio from https://files.pythonhosted.org/packages/7e/dd/69a7a6e89bb1fe09f99bde22027154c487b1e8b6769e642d7f56f35696d3/nest_asyncio-1.5.7-py3-none-any.whl.metadata
Downloading nest_asyncio-1.5.7-py3-none-any.whl.metadata (2.7 kB)
Collecting pegasusx (from swarms)
Obtaining dependency information for pegasusx from https://files.pythonhosted.org/packages/00/69/a6a4c68af60eea47f6fcca9195aea82e87d27fc068125dd62792ba8cc0dc/pegasusX-0.3.9-py3-none-any.whl.metadata
Downloading pegasusX-0.3.9-py3-none-any.whl.metadata (1.1 kB)
Collecting google-generativeai (from swarms)
Obtaining dependency information for google-generativeai from https://files.pythonhosted.org/packages/e3/f1/dca50d310c7e4f55775993d54a624411b829da99d464d809bc5e60ef65d8/google_generativeai-0.1.0-py3-none-any.whl.metadata
Downloading google_generativeai-0.1.0-py3-none-any.whl.metadata (3.0 kB)
Collecting oceandb (from swarms)
Obtaining dependency information for oceandb from https://files.pythonhosted.org/packages/1e/3c/f64a29f6e8f98d224e656d3a27576e11e0162df23a28737a1d7b63e07fdb/oceandb-0.1.0-py3-none-any.whl.metadata
Downloading oceandb-0.1.0-py3-none-any.whl.metadata (7.3 kB)
Collecting langchain-experimental (from swarms)
Obtaining dependency information for langchain-experimental from https://files.pythonhosted.org/packages/a3/de/854129333216185471aeb8ac71917f89648ffa919339a982db762766cb99/langchain_experimental-0.0.9-py3-none-any.whl.metadata
Downloading langchain_experimental-0.0.9-py3-none-any.whl.metadata (717 bytes)
Collecting playwright (from swarms)
Obtaining dependency information for playwright from https://files.pythonhosted.org/packages/d6/ff/e091a3d81bfd5602e2b4bc5df748b258a551a0ba09c7489694a4357dfa80/playwright-1.37.0-py3-none-win_amd64.whl.metadata
Downloading playwright-1.37.0-py3-none-win_amd64.whl.metadata (3.5 kB)
Requirement already satisfied: duckduckgo-search in c:\ai\python\lib\site-packages (from swarms) (2.8.6)
Collecting faiss-cpu (from swarms)
Using cached faiss_cpu-1.7.4-cp310-cp310-win_amd64.whl (10.8 MB)
Collecting wget==3.2 (from swarms)
Using cached wget-3.2-py3-none-any.whl
Collecting simpleaichat (from swarms)
Downloading simpleaichat-0.2.2.tar.gz (23 kB)
Preparing metadata (setup.py) ... done
Requirement already satisfied: httpx in c:\ai\python\lib\site-packages (from swarms) (0.24.0)
Collecting ggl (from swarms)
Using cached ggl-1.1.0-py3-none-any.whl
Requirement already satisfied: beautifulsoup4 in c:\ai\python\lib\site-packages (from swarms) (4.12.2)
Requirement already satisfied: pydantic in c:\ai\python\lib\site-packages (from swarms) (1.10.7)
Collecting tenacity (from swarms)
Obtaining dependency information for tenacity from https://files.pythonhosted.org/packages/f4/f1/990741d5bb2487d529d20a433210ffa136a367751e454214013b441c4575/tenacity-8.2.3-py3-none-any.whl.metadata
Downloading tenacity-8.2.3-py3-none-any.whl.metadata (1.0 kB)
Collecting celery (from swarms)
Obtaining dependency information for celery from https://files.pythonhosted.org/packages/18/b9/cb8d519ea0094b9b8fe7480225c14937517729f8ec927643dc7379904f64/celery-5.3.1-py3-none-any.whl.metadata
Downloading celery-5.3.1-py3-none-any.whl.metadata (21 kB)
Requirement already satisfied: redis in c:\ai\python\lib\site-packages (from swarms) (4.5.4)
Collecting google-search-results==2.4.2 (from swarms)
Using cached google_search_results-2.4.2-py3-none-any.whl
Requirement already satisfied: Pillow in c:\ai\python\lib\site-packages (from swarms) (9.5.0)
Requirement already satisfied: requests in c:\ai\python\lib\site-packages (from google-search-results==2.4.2->swarms) (2.28.2)
Requirement already satisfied: PyYAML>=5.4.1 in c:\ai\python\lib\site-packages (from langchain==0.0.240->swarms) (6.0)
Collecting SQLAlchemy<3,>=1.4 (from langchain==0.0.240->swarms)
Obtaining dependency information for SQLAlchemy<3,>=1.4 from https://files.pythonhosted.org/packages/e9/01/e251a1e721d93c584471d56f7f6d1ae310831522b04d74306a0f522e7c1a/SQLAlchemy-2.0.20-cp310-cp310-win_amd64.whl.metadata
Downloading SQLAlchemy-2.0.20-cp310-cp310-win_amd64.whl.metadata (9.7 kB)
Requirement already satisfied: aiohttp<4.0.0,>=3.8.3 in c:\ai\python\lib\site-packages (from langchain==0.0.240->swarms) (3.8.4)
Requirement already satisfied: async-timeout<5.0.0,>=4.0.0 in c:\ai\python\lib\site-packages (from langchain==0.0.240->swarms) (4.0.2)
Collecting dataclasses-json<0.6.0,>=0.5.7 (from langchain==0.0.240->swarms)
Obtaining dependency information for dataclasses-json<0.6.0,>=0.5.7 from https://files.pythonhosted.org/packages/97/5f/e7cc90f36152810cab08b6c9c1125e8bcb9d76f8b3018d101b5f877b386c/dataclasses_json-0.5.14-py3-none-any.whl.metadata
Downloading dataclasses_json-0.5.14-py3-none-any.whl.metadata (22 kB)
Collecting langsmith<0.1.0,>=0.0.11 (from langchain==0.0.240->swarms)
Obtaining dependency information for langsmith<0.1.0,>=0.0.11 from https://files.pythonhosted.org/packages/a4/98/f50580820e3005bc610ffc09a075a48c865993f639dda9acc83e71fa5900/langsmith-0.0.23-py3-none-any.whl.metadata
Downloading langsmith-0.0.23-py3-none-any.whl.metadata (10 kB)
Collecting numexpr<3.0.0,>=2.8.4 (from langchain==0.0.240->swarms)
Obtaining dependency information for numexpr<3.0.0,>=2.8.4 from https://files.pythonhosted.org/packages/a1/0d/17846f5302a9c627835a37df69a9a893e79905006a8e022cac6c2efafe6f/numexpr-2.8.5-cp310-cp310-win_amd64.whl.metadata
Downloading numexpr-2.8.5-cp310-cp310-win_amd64.whl.metadata (8.2 kB)
Requirement already satisfied: numpy<2,>=1 in c:\ai\python\lib\site-packages (from langchain==0.0.240->swarms) (1.24.3)
Collecting openapi-schema-pydantic<2.0,>=1.2 (from langchain==0.0.240->swarms)
Using cached openapi_schema_pydantic-1.2.4-py3-none-any.whl (90 kB)
Requirement already satisfied: typing-extensions>=4.2.0 in c:\ai\python\lib\site-packages (from pydantic->swarms) (4.5.0)
Requirement already satisfied: soupsieve>1.2 in c:\ai\python\lib\site-packages (from beautifulsoup4->swarms) (2.4.1)
Collecting billiard<5.0,>=4.1.0 (from celery->swarms)
Using cached billiard-4.1.0-py3-none-any.whl (86 kB)
Collecting click-didyoumean>=0.3.0 (from celery->swarms)
Using cached click_didyoumean-0.3.0-py3-none-any.whl (2.7 kB)
Collecting click-plugins>=1.1.1 (from celery->swarms)
Using cached click_plugins-1.1.1-py2.py3-none-any.whl (7.5 kB)
Collecting click-repl>=0.2.0 (from celery->swarms)
Obtaining dependency information for click-repl>=0.2.0 from https://files.pythonhosted.org/packages/52/40/9d857001228658f0d59e97ebd4c346fe73e138c6de1bce61dc568a57c7f8/click_repl-0.3.0-py3-none-any.whl.metadata
Downloading click_repl-0.3.0-py3-none-any.whl.metadata (3.6 kB)
Requirement already satisfied: click<9.0,>=8.1.2 in c:\ai\python\lib\site-packages (from celery->swarms) (8.1.3)
Collecting kombu<6.0,>=5.3.1 (from celery->swarms)
Obtaining dependency information for kombu<6.0,>=5.3.1 from https://files.pythonhosted.org/packages/63/58/b23b9c1ffb30d8b5cdfc7bdecb17bfd7ea20c619e86e515297b496177144/kombu-5.3.1-py3-none-any.whl.metadata
Downloading kombu-5.3.1-py3-none-any.whl.metadata (3.0 kB)
Requirement already satisfied: python-dateutil>=2.8.2 in c:\ai\python\lib\site-packages (from celery->swarms) (2.8.2)
Requirement already satisfied: tzdata>=2022.7 in c:\ai\python\lib\site-packages (from celery->swarms) (2023.3)
Collecting vine<6.0,>=5.0.0 (from celery->swarms)
Using cached vine-5.0.0-py2.py3-none-any.whl (9.4 kB)
Collecting google-ai-generativelanguage==0.2.0 (from google-generativeai->swarms)
Downloading google_ai_generativelanguage-0.2.0-py3-none-any.whl (113 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 113.3/113.3 kB ? eta 0:00:00
Requirement already satisfied: google-api-core[grpc]!=2.0.,!=2.1.,!=2.10.,!=2.2.,!=2.3.,!=2.4.,!=2.5.,!=2.6.,!=2.7.,!=2.8.,!=2.9.,<3.0.0dev,>=1.34.0 in c:\ai\python\lib\site-packages (from google-ai-generativelanguage==0.2.0->google-generativeai->swarms) (2.11.0)
Collecting proto-plus<2.0.0dev,>=1.22.0 (from google-ai-generativelanguage==0.2.0->google-generativeai->swarms)
Obtaining dependency information for proto-plus<2.0.0dev,>=1.22.0 from https://files.pythonhosted.org/packages/36/5b/e02636d221917d6fa2a61289b3f16002eb4c93d51c0191ac8e896d527182/proto_plus-1.22.3-py3-none-any.whl.metadata
Downloading proto_plus-1.22.3-py3-none-any.whl.metadata (2.2 kB)
Requirement already satisfied: protobuf!=3.20.0,!=3.20.1,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5,<5.0.0dev,>=3.19.5 in c:\ai\python\lib\site-packages (from google-ai-generativelanguage==0.2.0->google-generativeai->swarms) (4.22.3)
Requirement already satisfied: certifi in c:\ai\python\lib\site-packages (from httpx->swarms) (2022.12.7)
Requirement already satisfied: httpcore<0.18.0,>=0.15.0 in c:\ai\python\lib\site-packages (from httpx->swarms) (0.17.0)
Requirement already satisfied: idna in c:\ai\python\lib\site-packages (from httpx->swarms) (3.4)
Requirement already satisfied: sniffio in c:\ai\python\lib\site-packages (from httpx->swarms) (1.3.0)
Collecting clickhouse_connect<0.6.0,>=0.5.7 (from oceandb->swarms)
Obtaining dependency information for clickhouse_connect<0.6.0,>=0.5.7 from https://files.pythonhosted.org/packages/8c/84/12558f921c625ab3b79c326f2264d4a8d232ca88db1647f9cad1e500694a/clickhouse_connect-0.5.25-cp310-cp310-win_amd64.whl.metadata
Downloading clickhouse_connect-0.5.25-cp310-cp310-win_amd64.whl.metadata (2.2 kB)
Collecting duckdb<0.8.0,>=0.7.1 (from oceandb->swarms)
Using cached duckdb-0.7.1-cp310-cp310-win_amd64.whl (9.5 MB)
Collecting fastapi<0.86.0,>=0.85.1 (from oceandb->swarms)
Downloading fastapi-0.85.2-py3-none-any.whl (55 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 55.4/55.4 kB ? eta 0:00:00
Collecting hnswlib<0.8,>=0.7 (from oceandb->swarms)
Downloading hnswlib-0.7.0.tar.gz (33 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Collecting pandas<2.0,>=1.3 (from oceandb->swarms)
Downloading pandas-1.5.3-cp310-cp310-win_amd64.whl (10.4 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 10.4/10.4 MB 21.8 MB/s eta 0:00:00
Collecting posthog<3.0.0,>=2.4.0 (from oceandb->swarms)
Downloading posthog-2.5.0-py2.py3-none-any.whl (36 kB)
Collecting sentence-transformers<3.0.0,>=2.2.2 (from oceandb->swarms)
Downloading sentence-transformers-2.2.2.tar.gz (85 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 86.0/86.0 kB ? eta 0:00:00
Preparing metadata (setup.py) ... done
Collecting uvicorn[standard]<0.19.0,>=0.18.3 (from oceandb->swarms)
Downloading uvicorn-0.18.3-py3-none-any.whl (57 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 57.4/57.4 kB ? eta 0:00:00
Requirement already satisfied: tqdm in c:\ai\python\lib\site-packages (from openai->swarms) (4.65.0)
Collecting pandas<2.0,>=1.3 (from oceandb->swarms)
Downloading pandas-1.3.5-cp310-cp310-win_amd64.whl (10.2 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 10.2/10.2 MB 34.3 MB/s eta 0:00:00
Collecting pydantic (from swarms)
Downloading pydantic-1.9.0-cp310-cp310-win_amd64.whl (2.1 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.1/2.1 MB 44.9 MB/s eta 0:00:00
INFO: pip is looking at multiple versions of pegasusx to determine which version is compatible with other requirements. This could take a while.
Collecting pegasusx (from swarms)
Obtaining dependency information for pegasusx from https://files.pythonhosted.org/packages/18/64/762dd285dc005db9110f7d9a33ab0efb443d4201290796e7b48629679eaf/pegasusX-0.3.8-py3-none-any.whl.metadata
Downloading pegasusX-0.3.8-py3-none-any.whl.metadata (1.1 kB)
Obtaining dependency information for pegasusx from https://files.pythonhosted.org/packages/20/f8/901f8755e6245ce12ce34c945742a3e83db3bbbe6394f1b9e95e67b80c24/pegasusX-0.3.7-py3-none-any.whl.metadata
Downloading pegasusX-0.3.7-py3-none-any.whl.metadata (1.1 kB)
Obtaining dependency information for pegasusx from https://files.pythonhosted.org/packages/13/76/9c7533b84aa25e011b24cd78463b1f3f6c5b49448b7d6c98ee537696e7ce/pegasusX-0.3.6-py3-none-any.whl.metadata
Downloading pegasusX-0.3.6-py3-none-any.whl.metadata (1.1 kB)
Obtaining dependency information for pegasusx from https://files.pythonhosted.org/packages/81/84/93d33d77bfd3c38370e44b59816ef0f34b634409cb8eb8c8090e130fbfc0/pegasusX-0.3.5-py3-none-any.whl.metadata
Downloading pegasusX-0.3.5-py3-none-any.whl.metadata (1.1 kB)
Obtaining dependency information for pegasusx from https://files.pythonhosted.org/packages/a5/e3/7243b1a472f735232affbfe2d763a426dfd64e809a4fbbf5140cd8e1420c/pegasusX-0.3.4-py3-none-any.whl.metadata
Downloading pegasusX-0.3.4-py3-none-any.whl.metadata (1.1 kB)
Obtaining dependency information for pegasusx from https://files.pythonhosted.org/packages/0e/63/9857eb3e855218bc015a17f9c3bdc4f46c082bdd6ef3069ee9e2783665d0/pegasusX-0.3.2-py3-none-any.whl.metadata
Downloading pegasusX-0.3.2-py3-none-any.whl.metadata (1.1 kB)
Obtaining dependency information for pegasusx from https://files.pythonhosted.org/packages/c0/02/49ba3628009bf1a86a1c19e25b7322f9c4fe9b4e71a09a16983b5be46e68/pegasusX-0.3.1-py3-none-any.whl.metadata
Downloading pegasusX-0.3.1-py3-none-any.whl.metadata (1.1 kB)
INFO: pip is still looking at multiple versions of pegasusx to determine which version is compatible with other requirements. This could take a while.
Obtaining dependency information for pegasusx from https://files.pythonhosted.org/packages/62/17/9ecced659b1c01e7b0b0808a7b105716ae530c54a2cdd8e987fb02cf7863/pegasusX-0.3.0-py3-none-any.whl.metadata
Downloading pegasusX-0.3.0-py3-none-any.whl.metadata (1.1 kB)
Obtaining dependency information for pegasusx from https://files.pythonhosted.org/packages/ef/34/a8f41773be4cbd58cdf8a95693c74c07b3b512f34002ae06d71e76b9a79f/pegasusX-0.2.9-py3-none-any.whl.metadata
Downloading pegasusX-0.2.9-py3-none-any.whl.metadata (1.1 kB)
Obtaining dependency information for pegasusx from https://files.pythonhosted.org/packages/d3/9a/8c7d4926634b8a7a416b9e548810948546c6a74fc85cf3531c9ebd12719a/pegasusX-0.2.7-py3-none-any.whl.metadata
Downloading pegasusX-0.2.7-py3-none-any.whl.metadata (1.1 kB)
Obtaining dependency information for pegasusx from https://files.pythonhosted.org/packages/0a/d1/d320566bbb65074d92c6b1c4115c9cef361fdf22280b22ac0b662d17b100/pegasusX-0.2.5-py3-none-any.whl.metadata
Downloading pegasusX-0.2.5-py3-none-any.whl.metadata (626 bytes)
Collecting numba (from pegasusx->swarms)
Obtaining dependency information for numba from https://files.pythonhosted.org/packages/f3/3e/6349c624303b78b6bbb97168c7fb38a1a0cb1605ae4c5d45af3b829f067a/numba-0.57.1-cp310-cp310-win_amd64.whl.metadata
Downloading numba-0.57.1-cp310-cp310-win_amd64.whl.metadata (2.8 kB)
Collecting joblib (from pegasusx->swarms)
Obtaining dependency information for joblib from https://files.pythonhosted.org/packages/10/40/d551139c85db202f1f384ba8bcf96aca2f329440a844f924c8a0040b6d02/joblib-1.3.2-py3-none-any.whl.metadata
Downloading joblib-1.3.2-py3-none-any.whl.metadata (5.4 kB)
Collecting greenlet==2.0.2 (from playwright->swarms)
Using cached greenlet-2.0.2-cp310-cp310-win_amd64.whl (192 kB)
Collecting pyee==9.0.4 (from playwright->swarms)
Using cached pyee-9.0.4-py2.py3-none-any.whl (14 kB)
INFO: pip is looking at multiple versions of simpleaichat to determine which version is compatible with other requirements. This could take a while.
Collecting simpleaichat (from swarms)
Downloading simpleaichat-0.2.1.tar.gz (22 kB)
Preparing metadata (setup.py) ... done
Downloading simpleaichat-0.2.0.tar.gz (22 kB)
Preparing metadata (setup.py) ... done
Collecting fire>=0.3.0 (from simpleaichat->swarms)
Downloading fire-0.5.0.tar.gz (88 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 88.3/88.3 kB ? eta 0:00:00
Preparing metadata (setup.py) ... done
Collecting httpx (from swarms)
Obtaining dependency information for httpx from https://files.pythonhosted.org/packages/ec/91/e41f64f03d2a13aee7e8c819d82ee3aa7cdc484d18c0ae859742597d5aa0/httpx-0.24.1-py3-none-any.whl.metadata
Downloading httpx-0.24.1-py3-none-any.whl.metadata (7.4 kB)
Requirement already satisfied: python-dotenv>=1.0.0 in c:\ai\python\lib\site-packages (from simpleaichat->swarms) (1.0.0)
Collecting orjson>=3.9.0 (from simpleaichat->swarms)
Obtaining dependency information for orjson>=3.9.0 from https://files.pythonhosted.org/packages/e7/a6/545607d3854b87c8f28894e93a0d34fda90b80affad852bca8c3d30710dc/orjson-3.9.5-cp310-none-win_amd64.whl.metadata
Downloading orjson-3.9.5-cp310-none-win_amd64.whl.metadata (50 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 50.4/50.4 kB ? eta 0:00:00
Collecting rich>=13.4.1 (from simpleaichat->swarms)
Obtaining dependency information for rich>=13.4.1 from https://files.pythonhosted.org/packages/8d/5f/21a93b2ec205f4b79853ff6e838e3c99064d5dbe85ec6b05967506f14af0/rich-13.5.2-py3-none-any.whl.metadata
Downloading rich-13.5.2-py3-none-any.whl.metadata (18 kB)
Requirement already satisfied: filelock in c:\ai\python\lib\site-packages (from transformers->swarms) (3.12.0)
Collecting huggingface-hub<1.0,>=0.14.1 (from transformers->swarms)
Obtaining dependency information for huggingface-hub<1.0,>=0.14.1 from https://files.pythonhosted.org/packages/7f/c4/adcbe9a696c135578cabcbdd7331332daad4d49b7c43688bc2d36b3a47d2/huggingface_hub-0.16.4-py3-none-any.whl.metadata
Downloading huggingface_hub-0.16.4-py3-none-any.whl.metadata (12 kB)
Requirement already satisfied: packaging>=20.0 in c:\ai\python\lib\site-packages (from transformers->swarms) (23.1)
Requirement already satisfied: regex!=2019.12.17 in c:\ai\python\lib\site-packages (from transformers->swarms) (2023.3.23)
Collecting tokenizers!=0.11.3,<0.14,>=0.11.1 (from transformers->swarms)
Using cached tokenizers-0.13.3-cp310-cp310-win_amd64.whl (3.5 MB)
Collecting safetensors>=0.3.1 (from transformers->swarms)
Obtaining dependency information for safetensors>=0.3.1 from https://files.pythonhosted.org/packages/25/3b/f13671b3e43b22de7bd3b5142476995a6efe24ab6279425d2fbee5d44a97/safetensors-0.3.2-cp310-cp310-win_amd64.whl.metadata
Downloading safetensors-0.3.2-cp310-cp310-win_amd64.whl.metadata (4.6 kB)
Requirement already satisfied: attrs>=17.3.0 in c:\ai\python\lib\site-packages (from aiohttp<4.0.0,>=3.8.3->langchain==0.0.240->swarms) (23.1.0)
Requirement already satisfied: charset-normalizer<4.0,>=2.0 in c:\ai\python\lib\site-packages (from aiohttp<4.0.0,>=3.8.3->langchain==0.0.240->swarms) (3.1.0)
Requirement already satisfied: multidict<7.0,>=4.5 in c:\ai\python\lib\site-packages (from aiohttp<4.0.0,>=3.8.3->langchain==0.0.240->swarms) (6.0.4)
Requirement already satisfied: yarl<2.0,>=1.0 in c:\ai\python\lib\site-packages (from aiohttp<4.0.0,>=3.8.3->langchain==0.0.240->swarms) (1.9.1)
Requirement already satisfied: frozenlist>=1.1.1 in c:\ai\python\lib\site-packages (from aiohttp<4.0.0,>=3.8.3->langchain==0.0.240->swarms) (1.3.3)
Requirement already satisfied: aiosignal>=1.1.2 in c:\ai\python\lib\site-packages (from aiohttp<4.0.0,>=3.8.3->langchain==0.0.240->swarms) (1.3.1)
Requirement already satisfied: colorama in c:\ai\python\lib\site-packages (from click<9.0,>=8.1.2->celery->swarms) (0.4.6)
Collecting prompt-toolkit>=3.0.36 (from click-repl>=0.2.0->celery->swarms)
Obtaining dependency information for prompt-toolkit>=3.0.36 from https://files.pythonhosted.org/packages/a9/b4/ba77c84edf499877317225d7b7bc047a81f7c2eed9628eeb6bab0ac2e6c9/prompt_toolkit-3.0.39-py3-none-any.whl.metadata
Downloading prompt_toolkit-3.0.39-py3-none-any.whl.metadata (6.4 kB)
Requirement already satisfied: urllib3>=1.26 in c:\ai\python\lib\site-packages (from clickhouse_connect<0.6.0,>=0.5.7->oceandb->swarms) (1.26.15)
Requirement already satisfied: pytz in c:\ai\python\lib\site-packages (from clickhouse_connect<0.6.0,>=0.5.7->oceandb->swarms) (2023.3)
Collecting zstandard (from clickhouse_connect<0.6.0,>=0.5.7->oceandb->swarms)
Downloading zstandard-0.21.0-cp310-cp310-win_amd64.whl (511 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 511.3/511.3 kB 33.4 MB/s eta 0:00:00
Collecting lz4 (from clickhouse_connect<0.6.0,>=0.5.7->oceandb->swarms)
Downloading lz4-4.3.2-cp310-cp310-win_amd64.whl (99 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 99.8/99.8 kB ? eta 0:00:00
Collecting marshmallow<4.0.0,>=3.18.0 (from dataclasses-json<0.6.0,>=0.5.7->langchain==0.0.240->swarms)
Obtaining dependency information for marshmallow<4.0.0,>=3.18.0 from https://files.pythonhosted.org/packages/ed/3c/cebfdcad015240014ff08b883d1c0c427f2ba45ae8c6572851b6ef136cad/marshmallow-3.20.1-py3-none-any.whl.metadata
Downloading marshmallow-3.20.1-py3-none-any.whl.metadata (7.8 kB)
Collecting typing-inspect<1,>=0.4.0 (from dataclasses-json<0.6.0,>=0.5.7->langchain==0.0.240->swarms)
Obtaining dependency information for typing-inspect<1,>=0.4.0 from https://files.pythonhosted.org/packages/65/f3/107a22063bf27bdccf2024833d3445f4eea42b2e598abfbd46f6a63b6cb0/typing_inspect-0.9.0-py3-none-any.whl.metadata
Downloading typing_inspect-0.9.0-py3-none-any.whl.metadata (1.5 kB)
Collecting starlette==0.20.4 (from fastapi<0.86.0,>=0.85.1->oceandb->swarms)
Downloading starlette-0.20.4-py3-none-any.whl (63 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 63.6/63.6 kB ? eta 0:00:00
Requirement already satisfied: anyio<5,>=3.4.0 in c:\ai\python\lib\site-packages (from starlette==0.20.4->fastapi<0.86.0,>=0.85.1->oceandb->swarms) (3.6.2)
Requirement already satisfied: six in c:\ai\python\lib\site-packages (from fire>=0.3.0->simpleaichat->swarms) (1.16.0)
Collecting termcolor (from fire>=0.3.0->simpleaichat->swarms)
Downloading termcolor-2.3.0-py3-none-any.whl (6.9 kB)
Requirement already satisfied: h11<0.15,>=0.13 in c:\ai\python\lib\site-packages (from httpcore<0.18.0,>=0.15.0->httpx->swarms) (0.14.0)
Collecting fsspec (from huggingface-hub<1.0,>=0.14.1->transformers->swarms)
Obtaining dependency information for fsspec from https://files.pythonhosted.org/packages/e3/bd/4c0a4619494188a9db5d77e2100ab7d544a42e76b2447869d8e124e981d8/fsspec-2023.6.0-py3-none-any.whl.metadata
Downloading fsspec-2023.6.0-py3-none-any.whl.metadata (6.7 kB)
Collecting amqp<6.0.0,>=5.1.1 (from kombu<6.0,>=5.3.1->celery->swarms)
Using cached amqp-5.1.1-py3-none-any.whl (50 kB)
Collecting monotonic>=1.5 (from posthog<3.0.0,>=2.4.0->oceandb->swarms)
Downloading monotonic-1.6-py2.py3-none-any.whl (8.2 kB)
Collecting backoff>=1.10.0 (from posthog<3.0.0,>=2.4.0->oceandb->swarms)
Downloading backoff-2.2.1-py3-none-any.whl (15 kB)
Collecting markdown-it-py>=2.2.0 (from rich>=13.4.1->simpleaichat->swarms)
Obtaining dependency information for markdown-it-py>=2.2.0 from https://files.pythonhosted.org/packages/42/d7/1ec15b46af6af88f19b8e5ffea08fa375d433c998b8a7639e76935c14f1f/markdown_it_py-3.0.0-py3-none-any.whl.metadata
Downloading markdown_it_py-3.0.0-py3-none-any.whl.metadata (6.9 kB)
Collecting pygments<3.0.0,>=2.13.0 (from rich>=13.4.1->simpleaichat->swarms)
Obtaining dependency information for pygments<3.0.0,>=2.13.0 from https://files.pythonhosted.org/packages/43/88/29adf0b44ba6ac85045e63734ae0997d3c58d8b1a91c914d240828d0d73d/Pygments-2.16.1-py3-none-any.whl.metadata
Downloading Pygments-2.16.1-py3-none-any.whl.metadata (2.5 kB)
Collecting torch>=1.6.0 (from sentence-transformers<3.0.0,>=2.2.2->oceandb->swarms)
Using cached torch-2.0.1-cp310-cp310-win_amd64.whl (172.3 MB)
Collecting torchvision (from sentence-transformers<3.0.0,>=2.2.2->oceandb->swarms)
Using cached torchvision-0.15.2-cp310-cp310-win_amd64.whl (1.2 MB)
Collecting scikit-learn (from sentence-transformers<3.0.0,>=2.2.2->oceandb->swarms)
Obtaining dependency information for scikit-learn from https://files.pythonhosted.org/packages/96/cf/a714a655266229b51eb2bda117f15275f12457887f165f3c1cc58ab502f1/scikit_learn-1.3.0-cp310-cp310-win_amd64.whl.metadata
Downloading scikit_learn-1.3.0-cp310-cp310-win_amd64.whl.metadata (11 kB)
Collecting scipy (from sentence-transformers<3.0.0,>=2.2.2->oceandb->swarms)
Obtaining dependency information for scipy from https://files.pythonhosted.org/packages/ce/e4/50b6fd4a2b65222424646abf17830904c9190bdd2c8daa7aeec083273903/scipy-1.11.1-cp310-cp310-win_amd64.whl.metadata
Downloading scipy-1.11.1-cp310-cp310-win_amd64.whl.metadata (59 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 59.1/59.1 kB ? eta 0:00:00
Collecting nltk (from sentence-transformers<3.0.0,>=2.2.2->oceandb->swarms)
Using cached nltk-3.8.1-py3-none-any.whl (1.5 MB)
Collecting sentencepiece (from sentence-transformers<3.0.0,>=2.2.2->oceandb->swarms)
Using cached sentencepiece-0.1.99-cp310-cp310-win_amd64.whl (977 kB)
Collecting httptools>=0.4.0 (from uvicorn[standard]<0.19.0,>=0.18.3->oceandb->swarms)
Obtaining dependency information for httptools>=0.4.0 from https://files.pythonhosted.org/packages/d5/63/f1594d00b4ef9c137edc0ff202d84e684b6989f9b8b4d1475098ca320c9d/httptools-0.6.0-cp310-cp310-win_amd64.whl.metadata
Downloading httptools-0.6.0-cp310-cp310-win_amd64.whl.metadata (3.6 kB)
Collecting watchfiles>=0.13 (from uvicorn[standard]<0.19.0,>=0.18.3->oceandb->swarms)
Downloading watchfiles-0.19.0-cp37-abi3-win_amd64.whl (270 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 270.9/270.9 kB 17.4 MB/s eta 0:00:00
Collecting websockets>=10.0 (from uvicorn[standard]<0.19.0,>=0.18.3->oceandb->swarms)
Using cached websockets-11.0.3-cp310-cp310-win_amd64.whl (124 kB)
Collecting llvmlite<0.41,>=0.40.0dev0 (from numba->pegasusx->swarms)
Obtaining dependency information for llvmlite<0.41,>=0.40.0dev0 from https://files.pythonhosted.org/packages/6c/4f/e6f9dc0b34e5b8450ef757cd35afda999c8cc5098907a512cf0ecae840b5/llvmlite-0.40.1-cp310-cp310-win_amd64.whl.metadata
Downloading llvmlite-0.40.1-cp310-cp310-win_amd64.whl.metadata (4.8 kB)
Requirement already satisfied: googleapis-common-protos<2.0dev,>=1.56.2 in c:\ai\python\lib\site-packages (from google-api-core[grpc]!=2.0.
,!=2.1.,!=2.10.,!=2.2.,!=2.3.,!=2.4.,!=2.5.,!=2.6.,!=2.7.,!=2.8.,!=2.9.,<3.0.0dev,>=1.34.0->google-ai-generativelanguage==0.2.0->google-generativeai->swarms) (1.59.0)
Requirement already satisfied: google-auth<3.0dev,>=2.14.1 in c:\ai\python\lib\site-packages (from google-api-core[grpc]!=2.0.,!=2.1.,!=2.10.,!=2.2.,!=2.3.,!=2.4.,!=2.5.,!=2.6.,!=2.7.,!=2.8.,!=2.9.,<3.0.0dev,>=1.34.0->google-ai-generativelanguage==0.2.0->google-generativeai->swarms) (2.17.3)
Requirement already satisfied: grpcio<2.0dev,>=1.33.2 in c:\ai\python\lib\site-packages (from google-api-core[grpc]!=2.0.
,!=2.1.,!=2.10.,!=2.2.,!=2.3.,!=2.4.,!=2.5.,!=2.6.,!=2.7.,!=2.8.,!=2.9.,<3.0.0dev,>=1.34.0->google-ai-generativelanguage==0.2.0->google-generativeai->swarms) (1.53.0)
Collecting grpcio-status<2.0dev,>=1.33.2 (from google-api-core[grpc]!=2.0.,!=2.1.,!=2.10.,!=2.2.,!=2.3.,!=2.4.,!=2.5.,!=2.6.,!=2.7.,!=2.8.,!=2.9.,<3.0.0dev,>=1.34.0->google-ai-generativelanguage==0.2.0->google-generativeai->swarms)
Obtaining dependency information for grpcio-status<2.0dev,>=1.33.2 from https://files.pythonhosted.org/packages/d0/3f/347d93056572fdbd64d4f0fc58a18d420763a7118f8b177437d9dab0ae6f/grpcio_status-1.57.0-py3-none-any.whl.metadata
Downloading grpcio_status-1.57.0-py3-none-any.whl.metadata (1.2 kB)
Collecting mdurl~=0.1 (from markdown-it-py>=2.2.0->rich>=13.4.1->simpleaichat->swarms)
Using cached mdurl-0.1.2-py3-none-any.whl (10.0 kB)
Collecting wcwidth (from prompt-toolkit>=3.0.36->click-repl>=0.2.0->celery->swarms)
Using cached wcwidth-0.2.6-py2.py3-none-any.whl (29 kB)
Collecting sympy (from torch>=1.6.0->sentence-transformers<3.0.0,>=2.2.2->oceandb->swarms)
Using cached sympy-1.12-py3-none-any.whl (5.7 MB)
Collecting networkx (from torch>=1.6.0->sentence-transformers<3.0.0,>=2.2.2->oceandb->swarms)
Using cached networkx-3.1-py3-none-any.whl (2.1 MB)
Requirement already satisfied: jinja2 in c:\ai\python\lib\site-packages (from torch>=1.6.0->sentence-transformers<3.0.0,>=2.2.2->oceandb->swarms) (3.1.2)
Requirement already satisfied: mypy-extensions>=0.3.0 in c:\ai\python\lib\site-packages (from typing-inspect<1,>=0.4.0->dataclasses-json<0.6.0,>=0.5.7->langchain==0.0.240->swarms) (1.0.0)
Collecting threadpoolctl>=2.0.0 (from scikit-learn->sentence-transformers<3.0.0,>=2.2.2->oceandb->swarms)
Obtaining dependency information for threadpoolctl>=2.0.0 from https://files.pythonhosted.org/packages/81/12/fd4dea011af9d69e1cad05c75f3f7202cdcbeac9b712eea58ca779a72865/threadpoolctl-3.2.0-py3-none-any.whl.metadata
Downloading threadpoolctl-3.2.0-py3-none-any.whl.metadata (10.0 kB)
Requirement already satisfied: cachetools<6.0,>=2.0.0 in c:\ai\python\lib\site-packages (from google-auth<3.0dev,>=2.14.1->google-api-core[grpc]!=2.0.
,!=2.1.,!=2.10.,!=2.2.,!=2.3.,!=2.4.,!=2.5.,!=2.6.,!=2.7.,!=2.8.,!=2.9.,<3.0.0dev,>=1.34.0->google-ai-generativelanguage==0.2.0->google-generativeai->swarms) (5.3.0)
Requirement already satisfied: pyasn1-modules>=0.2.1 in c:\ai\python\lib\site-packages (from google-auth<3.0dev,>=2.14.1->google-api-core[grpc]!=2.0.,!=2.1.,!=2.10.,!=2.2.,!=2.3.,!=2.4.,!=2.5.,!=2.6.,!=2.7.,!=2.8.,!=2.9.,<3.0.0dev,>=1.34.0->google-ai-generativelanguage==0.2.0->google-generativeai->swarms) (0.3.0)
Requirement already satisfied: rsa<5,>=3.1.4 in c:\ai\python\lib\site-packages (from google-auth<3.0dev,>=2.14.1->google-api-core[grpc]!=2.0.
,!=2.1.,!=2.10.,!=2.2.,!=2.3.,!=2.4.,!=2.5.,!=2.6.,!=2.7.,!=2.8.,!=2.9.,<3.0.0dev,>=1.34.0->google-ai-generativelanguage==0.2.0->google-generativeai->swarms) (4.9)
Collecting grpcio<2.0dev,>=1.33.2 (from google-api-core[grpc]!=2.0.,!=2.1.,!=2.10.,!=2.2.,!=2.3.,!=2.4.,!=2.5.,!=2.6.,!=2.7.,!=2.8.,!=2.9.,<3.0.0dev,>=1.34.0->google-ai-generativelanguage==0.2.0->google-generativeai->swarms)
Obtaining dependency information for grpcio<2.0dev,>=1.33.2 from https://files.pythonhosted.org/packages/b7/80/56048dd2223a075f421dba172074c93d5545a4348e0699eee15120b4f41d/grpcio-1.57.0-cp310-cp310-win_amd64.whl.metadata
Downloading grpcio-1.57.0-cp310-cp310-win_amd64.whl.metadata (4.1 kB)
Requirement already satisfied: MarkupSafe>=2.0 in c:\ai\python\lib\site-packages (from jinja2->torch>=1.6.0->sentence-transformers<3.0.0,>=2.2.2->oceandb->swarms) (2.1.2)
Collecting mpmath>=0.19 (from sympy->torch>=1.6.0->sentence-transformers<3.0.0,>=2.2.2->oceandb->swarms)
Using cached mpmath-1.3.0-py3-none-any.whl (536 kB)
Requirement already satisfied: pyasn1<0.6.0,>=0.4.6 in c:\ai\python\lib\site-packages (from pyasn1-modules>=0.2.1->google-auth<3.0dev,>=2.14.1->google-api-core[grpc]!=2.0.
,!=2.1.,!=2.10.,!=2.2.,!=2.3.,!=2.4.,!=2.5.,!=2.6.,!=2.7.,!=2.8.,!=2.9.,<3.0.0dev,>=1.34.0->google-ai-generativelanguage==0.2.0->google-generativeai->swarms) (0.5.0)
Downloading swarms-1.3.2-py3-none-any.whl (262 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 262.2/262.2 kB 15.7 MB/s eta 0:00:00
Downloading langchain-0.0.240-py3-none-any.whl (1.4 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.4/1.4 MB 28.7 MB/s eta 0:00:00
Downloading tenacity-8.2.3-py3-none-any.whl (24 kB)
Using cached celery-5.3.1-py3-none-any.whl (420 kB)
Downloading google_generativeai-0.1.0-py3-none-any.whl (122 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 122.9/122.9 kB ? eta 0:00:00
Downloading langchain_experimental-0.0.9-py3-none-any.whl (69 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 69.3/69.3 kB 3.7 MB/s eta 0:00:00
Using cached nest_asyncio-1.5.7-py3-none-any.whl (5.3 kB)
Using cached oceandb-0.1.0-py3-none-any.whl (2.8 MB)
Downloading pegasusX-0.2.5-py3-none-any.whl (29 kB)
Downloading playwright-1.37.0-py3-none-win_amd64.whl (29.4 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 29.4/29.4 MB 26.1 MB/s eta 0:00:00
Downloading httpx-0.24.1-py3-none-any.whl (75 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 75.4/75.4 kB ? eta 0:00:00
Using cached transformers-4.31.0-py3-none-any.whl (7.4 MB)
Using cached click_repl-0.3.0-py3-none-any.whl (10 kB)
Using cached clickhouse_connect-0.5.25-cp310-cp310-win_amd64.whl (222 kB)
Using cached dataclasses_json-0.5.14-py3-none-any.whl (26 kB)
Using cached huggingface_hub-0.16.4-py3-none-any.whl (268 kB)
Using cached kombu-5.3.1-py3-none-any.whl (198 kB)
Downloading langsmith-0.0.23-py3-none-any.whl (33 kB)
Downloading numexpr-2.8.5-cp310-cp310-win_amd64.whl (94 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 94.4/94.4 kB ? eta 0:00:00
Downloading orjson-3.9.5-cp310-none-win_amd64.whl (139 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 139.3/139.3 kB ? eta 0:00:00
Using cached rich-13.5.2-py3-none-any.whl (239 kB)
Downloading safetensors-0.3.2-cp310-cp310-win_amd64.whl (266 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 266.3/266.3 kB 17.1 MB/s eta 0:00:00
Downloading SQLAlchemy-2.0.20-cp310-cp310-win_amd64.whl (2.0 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.0/2.0 MB 32.3 MB/s eta 0:00:00
Downloading joblib-1.3.2-py3-none-any.whl (302 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 302.2/302.2 kB 19.5 MB/s eta 0:00:00
Using cached numba-0.57.1-cp310-cp310-win_amd64.whl (2.5 MB)
Downloading httptools-0.6.0-cp310-cp310-win_amd64.whl (145 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 145.4/145.4 kB ? eta 0:00:00
Using cached llvmlite-0.40.1-cp310-cp310-win_amd64.whl (27.7 MB)
Using cached markdown_it_py-3.0.0-py3-none-any.whl (87 kB)
Using cached marshmallow-3.20.1-py3-none-any.whl (49 kB)
Using cached prompt_toolkit-3.0.39-py3-none-any.whl (385 kB)
Downloading proto_plus-1.22.3-py3-none-any.whl (48 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 48.1/48.1 kB ? eta 0:00:00
Downloading Pygments-2.16.1-py3-none-any.whl (1.2 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.2/1.2 MB 37.2 MB/s eta 0:00:00
Using cached typing_inspect-0.9.0-py3-none-any.whl (8.8 kB)
Using cached fsspec-2023.6.0-py3-none-any.whl (163 kB)
Using cached scikit_learn-1.3.0-cp310-cp310-win_amd64.whl (9.2 MB)
Using cached scipy-1.11.1-cp310-cp310-win_amd64.whl (44.0 MB)
Downloading grpcio_status-1.57.0-py3-none-any.whl (5.1 kB)
Downloading grpcio-1.57.0-cp310-cp310-win_amd64.whl (4.3 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 4.3/4.3 MB 30.3 MB/s eta 0:00:00
Using cached threadpoolctl-3.2.0-py3-none-any.whl (15 kB)
Building wheels for collected packages: simpleaichat, fire, hnswlib, sentence-transformers
Building wheel for simpleaichat (setup.py) ... done
Created wheel for simpleaichat: filename=simpleaichat-0.2.0-py3-none-any.whl size=17672 sha256=2ac7b48c50ab98e9ea86795bdb5e6d96b9e136bafee25f196b6a986b1c6b7861
Stored in directory: c:\users\dh\appdata\local\pip\cache\wheels\ed\eb\6a\5416c13d83b6d435e32e0108103bf777e7b4b1204c10049f21
Building wheel for fire (setup.py) ... done
Created wheel for fire: filename=fire-0.5.0-py2.py3-none-any.whl size=116948 sha256=db4ec496904cfc2803776e600251495b6bf64d4d441d643d2a050c3e0e561527
Stored in directory: c:\users\dh\appdata\local\pip\cache\wheels\90\d4\f7\9404e5db0116bd4d43e5666eaa3e70ab53723e1e3ea40c9a95
Building wheel for hnswlib (pyproject.toml) ... error
error: subprocess-exited-with-error

× Building wheel for hnswlib (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [5 lines of output]
running bdist_wheel
running build
running build_ext
building 'hnswlib' extension
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for hnswlib
Building wheel for sentence-transformers (setup.py) ... done
Created wheel for sentence-transformers: filename=sentence_transformers-2.2.2-py3-none-any.whl size=125961 sha256=c42561966e4bfddfc23a47e857047bd43b005cf7bfcd0e912a28b0f07a02a75c
Stored in directory: c:\users\dh\appdata\local\pip\cache\wheels\62\f2\10\1e606fd5f02395388f74e7462910fe851042f97238cbbd902f
Successfully built simpleaichat fire sentence-transformers
Failed to build hnswlib
ERROR: Could not build wheels for hnswlib, which is required to install pyproject.toml-based projects

Additional context
Add any other context about the problem here.

[BUG] AttributeError: module 'openai' has no attribute 'Completion'. Did you mean: 'completions'?

OpenAI model Trace back

##############################################

Traceback (most recent call last):
File "/home/v/inhouse/oai.py", line 8, in
openai = OpenAI(openai_api_key=api_key)
File "/home/v/.local/lib/python3.10/site-packages/langchain/load/serializable.py", line 90, in init
super().init(**kwargs)
File "pydantic/main.py", line 339, in pydantic.main.BaseModel.init
File "pydantic/main.py", line 1102, in pydantic.main.validate_model
File "/home/v/.local/lib/python3.10/site-packages/swarms/models/openai_models.py", line 256, in validate_environment
values["client"] = openai.Completion.create()
AttributeError: module 'openai' has no attribute 'Completion'. Did you mean: 'completions'?

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar

Wrong code snippet in Method 3 -> README.md ?

I guess you pasted the same code snippet in Method 3 and Method 1 in the README:

from swarms import Swarms

# Retrieve your API key from the environment or replace with your actual key
api_key = "sksdsds"

# Initialize Swarms with your API key
swarm = Swarms(openai_api_key=api_key)

# Define an objective
objective = """
Please develop and serve a simple community web service. 
People can signup, login, post, comment. 
Post and comment should be visible at once. 
I want it to have neumorphism-style. 
The ports you can use are 4500 and 6500.
"""

# Run Swarms
swarm.run_swarms(objective)

I guess that is not how it should be, right?

Confirm you do not plan to stop spamming people.

Hi @kyegomez, you closed #62 about you spamming people as "not planned". Can you confirm that you do not intent to take any action?

Please take a look at:

It would be great if you stopped.

spammer

Please stop spamming me, and others. Also see #40

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar

ModuleNotFoundError: No module named 'swarms.agents.workers'

Traceback (most recent call last):
File "C:\Users\Verwender\Desktop\d.py", line 1, in
from swarms import Swarms
File "C:\Users\Verwender\AppData\Local\Programs\Python\Python311\Lib\site-packages\swarms_init_.py", line 1, in
from swarms.agents.swarms import WorkerNode, BossNode
File "C:\Users\Verwender\AppData\Local\Programs\Python\Python311\Lib\site-packages\swarms\agents\swarms.py", line 2, in
from swarms.agents.workers.auto_agent import AutoGPT
ModuleNotFoundError: No module named 'swarms.agents.workers'

[BUG]

Traceback (most recent call last):
File "/usr/local/bin/uvicorn", line 8, in
sys.exit(main())
File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1157, in call
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.10/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
File "/usr/local/lib/python3.10/site-packages/uvicorn/main.py", line 403, in main
run(
File "/usr/local/lib/python3.10/site-packages/uvicorn/main.py", line 568, in run
server.run()
File "/usr/local/lib/python3.10/site-packages/uvicorn/server.py", line 59, in run
return asyncio.run(self.serve(sockets=sockets))
File "/usr/local/lib/python3.10/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/usr/local/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
return future.result()
File "/usr/local/lib/python3.10/site-packages/uvicorn/server.py", line 66, in serve
config.load()
File "/usr/local/lib/python3.10/site-packages/uvicorn/config.py", line 471, in load
self.loaded_app = import_from_string(self.app)
File "/usr/local/lib/python3.10/site-packages/uvicorn/importer.py", line 24, in import_from_string
raise exc from None
File "/usr/local/lib/python3.10/site-packages/uvicorn/importer.py", line 21, in import_from_string
module = importlib.import_module(module_str)
File "/usr/local/lib/python3.10/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1050, in _gcd_import
File "", line 1027, in _find_and_load
File "", line 1006, in _find_and_load_unlocked
File "", line 688, in _load_unlocked
File "", line 883, in exec_module
File "", line 241, in _call_with_frames_removed
File "/usr/src/app/api/app.py", line 4, in
from fastapi_cache.decorator import cache
ModuleNotFoundError: No module named 'fastapi_cache.decorator'

[BUG] Command 'Dev Containers: Rebuild and Reopen in Container resulted in an error

Command 'Dev Containers: Rebuild and Reopen in Container resulted in an error
Command failed: /usr/share/code/code -ms-enable-electron-run-as node /home/v/vscode/extensions/ms-vscode remote.remote-containers-0.315.1/dist/spec-node/devContainersSpecCLI.js read-configuration -workspace-folder /home/v/swarms -log-level debug-log-format json -config /home/v/swarms/.devcontainer/ devcontainer json -include merged-configuration -mount-workspace-gitroot

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar

[BUG] Mistral modal killed

v@v-System-Product-Name:~/inhouse$ /bin/python3 /home/v/inhouse/mistral.py
Killed

Mistral example
#######################################################################

from swarms.models import Mistral

model = Mistral()

task = "Summarize the main findings of the recen climate change report."

resutl = model.run(task)
print(resutl)

ModuleNotFoundError: No module named 'swarms'

Requirement already satisfied: google-api-python-client in /usr/local/lib/python3.10/dist-packages (from swarms==0.5.9) (2.84.0)
Requirement already satisfied: google-auth-httplib2 in /usr/local/lib/python3.10/dist-packages (from swarms==0.5.9) (0.1.0)
INFO: pip is looking at multiple versions of swarms to determine which version is compatible with other requirements. This could take a while.
ERROR: Could not find a version that satisfies the requirement google-auth-oauth (from swarms) (from versions: none)
ERROR: No matching distribution found for google-auth-oauth
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
[<ipython-input-1-908aa4ec28ca>](https://localhost:8080/#) in <cell line: 3>()
      1 get_ipython().system('pip install swarms==0.5.9')
      2 
----> 3 from swarms import Swarms
      4 # from swarms.agents.swarms import Swarms
      5 

ModuleNotFoundError: No module named 'swarms'

---------------------------------------------------------------------------
NOTE: If your import is failing due to a missing package, you can
manually install dependencies using either !pip or !apt.

To view examples of installing some common dependencies, click the
"Open Examples" button below.

This is extremely strange, either of 2 things is happening. Pip install is not building the swarms folder or there is an init error in the swarms folder

[BUG] ValueError: The following `model_kwargs` are not used by the model

Zephyr modal

################################

Traceback (most recent call last):
File "/home/v/inhouse/zephyr.py", line 5, in
output = model("Tell me a joke about programmers")
File "/home/v/.local/lib/python3.10/site-packages/swarms/models/zephyr.py", line 61, in call
outputs = self.pipe(prompt, max_new_token=self.max_new_tokens)
File "/home/v/.local/lib/python3.10/site-packages/transformers/pipelines/text_generation.py", line 208, in call
return super().call(text_inputs, **kwargs)
File "/home/v/.local/lib/python3.10/site-packages/transformers/pipelines/base.py", line 1140, in call
return self.run_single(inputs, preprocess_params, forward_params, postprocess_params)
File "/home/v/.local/lib/python3.10/site-packages/transformers/pipelines/base.py", line 1147, in run_single
model_outputs = self.forward(model_inputs, **forward_params)
File "/home/v/.local/lib/python3.10/site-packages/transformers/pipelines/base.py", line 1046, in forward
model_outputs = self._forward(model_inputs, **forward_params)
File "/home/v/.local/lib/python3.10/site-packages/transformers/pipelines/text_generation.py", line 271, in _forward
generated_sequence = self.model.generate(input_ids=input_ids, attention_mask=attention_mask, **generate_kwargs)
File "/home/v/.local/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "/home/v/.local/lib/python3.10/site-packages/transformers/generation/utils.py", line 1485, in generate
self._validate_model_kwargs(model_kwargs.copy())
File "/home/v/.local/lib/python3.10/site-packages/transformers/generation/utils.py", line 1262, in _validate_model_kwargs
raise ValueError(
ValueError: The following model_kwargs are not used by the model: ['max_new_token'] (note: typos in the generate arguments will also show up in this list)

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar

[BUG]

Describe the bug
We cannot create a new worker node using example.py. From a fresh download of Swarms using Python 3.11 on Windows 11, trying to launch example.py through windows command terminal leads to an error.

To Reproduce
Steps to reproduce the behavior:

  1. Download swarms
  2. Install requirements.txt
  3. setx OPENAI_API_KEY "xxx"
  4. py example.py

Expected behavior
The example is not running and creating nodes that are doing work.

Screenshots
If applicable, add screenshots to help explain your problem.
image

Additional context
Perhaps the code is not compatible with more recent versions of Python? But I think the issue is more likely that some specific type errors might be occurring with the Tool object?

I gave the error and the code to ChatGPT and this is what it says:

The error message you provided indicates that there's an issue with the func parameter when initializing a Tool object, which is part of a larger codebase related to a project involving hierarchical swarms. Let's break down the error message and the relevant parts of your code to understand what's going on:

plaintext
Copy code
<swarms.workers.worker_node.WorkerNode object at 0x000001E2AA5BF350> is not callable (type=type_error.callable; value=<swarms.workers.worker_node.WorkerNode object at 0x000001E2AA5BF350>)
This error message indicates that an object of type swarms.workers.worker_node.WorkerNode located at memory address 0x000001E2AA5BF350 is not callable. In Python, a "callable" refers to something that can be called like a function. In this case, the code is trying to treat this object as if it were a function, but it's not designed to be called in this manner.

Looking at your code, the relevant portion seems to be in the HierarchicalSwarm class initialization, specifically in the lines where the Tool objects are being created for both self.worker_node and self.boss_node.

Here's the relevant part of your code:

python
Copy code
self.worker_node = WorkerNode(
openai_api_key=self.openai_api_key,
temperature=self.temperature,
human_in_the_loop=self.human_in_the_loop,
verbose=self.verbose
)

self.boss_node = BossNode(
api_key=self.openai_api_key,
worker_node=self.worker_node,
llm_class=OpenAI,
max_iterations=self.max_iterations,
verbose=self.verbose
)
The WorkerNode and BossNode classes are likely designed to handle different aspects of the swarm, and they are not intended to be directly callable as functions. However, the Tool objects within their initialization seem to expect a callable function as the func parameter.

To resolve this issue, you'll need to review the documentation or implementation of the Tool class to understand how it should be used and what the func parameter expects. If it's indeed expecting a callable function, you might need to refactor your code to provide appropriate functions for these Tool objects instead of passing instances of WorkerNode and BossNode.

If these objects are not meant to be used as functions, you might need to adjust how you're initializing the Tool objects or how you're using the Tool class within your codebase.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.