agent-zero icon indicating copy to clipboard operation
agent-zero copied to clipboard

Chromadb: 'Collection' object has no attribute 'model_fields'

Open juanchosaravia opened this issue 1 year ago • 2 comments

Running Agent Zero from a

  • Conda environment
  • with python 3.11
  • Perplexity API KEY
  • Using docker container
  • Macbook M1

It gets into a loop which is not able to initialize chromadb.

Error msg:

Agent 0: Using tool 'knowledge_tool':
Question: What is Agent Zero AI and how does it work?

Initializing VectorDB...

{
    "system_error": "Traceback (most recent call last):
  File "/Users/user1/.pyenv/versions/3.11.4/lib/python3.11/site-packages/chromadb/db/mixins/sysdb.py", line 257, in create_collection
    ParameterValue(self.uuid_to_db(collection["id"])),
                                   ~~~~~~~~~~^^^^^^
  File "/Users/user1/.pyenv/versions/3.11.4/lib/python3.11/site-packages/chromadb/types.py", line 99, in __getitem__
    if key in self.model_fields:
              ^^^^^^^^^^^^^^^^^
AttributeError: 'Collection' object has no attribute 'model_fields'


AttributeError: 'Collection' object has no attribute 'model_fields'"
}


Agent 0: Using tool 'knowledge_tool':
Question: Are there any updates or community discussions regarding the 'Collection object has no attribute model_fields' error in ChromaDB?

Initializing VectorDB...

{
    "system_error": "Traceback (most recent call last):
  File "/Users/user1/.pyenv/versions/3.11.4/lib/python3.11/site-packages/chromadb/db/mixins/sysdb.py", line 257, in create_collection
    ParameterValue(self.uuid_to_db(collection["id"])),
                                   ~~~~~~~~~~^^^^^^
  File "/Users/user1/.pyenv/versions/3.11.4/lib/python3.11/site-packages/chromadb/types.py", line 99, in __getitem__
    if key in self.model_fields:
              ^^^^^^^^^^^^^^^^^
AttributeError: 'Collection' object has no attribute 'model_fields'


AttributeError: 'Collection' object has no attribute 'model_fields'"
}

juanchosaravia avatar Jul 30 '24 01:07 juanchosaravia

Found this: https://github.com/langchain-ai/langchain/issues/24163

As a workaround, I forced the chromadb version in the requirements file:

...
chromadb==0.5.3
langchain-chroma==0.1.2
...

juanchosaravia avatar Jul 30 '24 01:07 juanchosaravia

Had the same issue. I used the workaround to fix it:

Found this: langchain-ai/langchain#24163

As a workaround, I forced the chromadb version in the requirements file:

...
chromadb==0.5.3
langchain-chroma==0.1.2
...

aposseadesse avatar Jul 31 '24 04:07 aposseadesse

ChromaDB discontinued.

frdel avatar Jan 05 '25 15:01 frdel