kyegomez / swarms

The Enterprise-Grade Production-Ready Multi-Agent Orchestration Framework Join our Community: https://discord.com/servers/agora-999382051935506503
https://docs.swarms.world
GNU Affero General Public License v3.0
1.68k stars 227 forks source link

[BUG] Majority Voting #514

Open evelynmitchell opened 4 months ago

evelynmitchell commented 4 months ago

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
[<ipython-input-15-8a50099c58fe>](https://localhost:8080/#) in <cell line: 1>()
----> 1 from swarms import Agent, MajorityVoting, ChromaDB, Anthropic
      2 
      3 # Initialize the llm
      4 llm = Anthropic()
      5 

ImportError: cannot import name 'ChromaDB' from 'swarms' (/usr/local/lib/python3.10/dist-packages/swarms/__init__.py)

---------------------------------------------------------------------------
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.
---------------------------------------------------------------------------```
sambhavnoobcoder commented 1 week ago

To solve this issue, we need to update the import statement. The ChromaDB class is not directly importable from the swarms package. Instead, it should be imported from swarms_memory . Here's how to fix the import:

from swarms import Agent, MajorityVoting
from swarms_memory import ChromaDB
from swarm_models import Anthropic

# Initialize the llm
llm = Anthropic()

you can reference this usage from the swarms/memory/diy_memory.md as well as swarms/agent_with_rag.py