kyegomez / swarms

The Enterprise-Grade Production-Ready Multi-Agent Orchestration Framework Join our Community: https://discord.com/servers/agora-999382051935506503
https://docs.swarms.world
Other
885 stars 118 forks source link

[BUG] ImportError: cannot import name 'ChromaDB' #477

Open behroozazarkhalili opened 1 month ago

behroozazarkhalili commented 1 month ago

Describe the bug

ImportError: cannot import name 'ChromaDB' from 'swarms' (/home/ermia/anaconda3/envs/deep-shap/lib/python3.10/site-packages/swarms/__init__.py)

To Reproduce Steps to reproduce the behavior: Here's the code I'm running:

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)

Expected behavior It should run without any errors as it is an example in the readme.md of the repository.

Screenshots image

Additional context

Upvote & Fund

Fund with Polar

github-actions[bot] commented 1 month ago

Hello there, thank you for opening an Issue ! 🙏🏻 The team was notified and they will get back to you asap.

kyegomez commented 1 month ago

@behroozazarkhalili this code was taken out of the main swarms package to reduce redundancy, you can import it from here:

https://github.com/kyegomez/swarms/blob/master/playground/memory/chroma_db.py

behroozazarkhalili commented 1 month ago

@behroozazarkhalili this code was taken out of the main swarms package to reduce redundancy, you can import it from here:

https://github.com/kyegomez/swarms/blob/master/playground/memory/chroma_db.py It is not the correct way to remove the bug. I think we should update the readme file to effectively handle this bug.

kyegomez commented 1 month ago

@behroozazarkhalili the code example has been removed! Let me know if you have any other questions!