vanna-ai / vanna

šŸ¤– Chat with your SQL database šŸ“Š. Accurate Text-to-SQL Generation via LLMs using RAG šŸ”„.
https://vanna.ai/docs/
MIT License
12.06k stars 966 forks source link

ChromaDB HttpClient TypeError with log_position #664

Closed lkiii closed 1 month ago

lkiii commented 1 month ago

Describe the bug Using a stand alone instance of ChromaDB fails. To Reproduce My initiation is:

class MyVanna(ChromaDB_VectorStore, OpenAI_Chat):
    def __init__(self, config=None):
        ChromaDB_VectorStore.__init__(self, config=config)
        OpenAI_Chat.__init__(self, config=config)

config = {
    "api_key": api_key,
    "model": model,
    "client": chromadb.HttpClient(
        host=chromadb_host,
    ),
}

vn = MyVanna(config=config)

This fails with TypeError: Collection.__init__() got an unexpected keyword argument 'log_position'

Expected behavior Vanna not crashing

Error logs/Screenshots TypeError: Collection.__init__() got an unexpected keyword argument 'log_position'

Desktop (please complete the following information where):

Additional context https://github.com/vanna-ai/vanna/issues/249#issuecomment-2395167736

I was debugging all the flow and log_position is being returned from the ChromaDB API call

Example of the payload:

{"id":"b4b35fd3-57e5-46fd-bd22-6c1d1d2b96de","name":"documentation","configuration_json":{"hnsw_configuration":{"space":"l2","ef_construction":100,"ef_search":10,"num_threads":2,"M":16,"resize_factor":1.2,"batch_size":100,"sync_threshold":1000,"_type":"HNSWConfigurationInternal"},"_type":"CollectionConfigurationInternal"},"metadata":null,"dimension":null,"tenant":"default_tenant","database":"default_database","version":0,"log_position":0}
lkiii commented 1 month ago

I am planning to prepare a small example with docker-compose to reproduce this. Will update once ready

yenlianglai commented 1 month ago

After changing the chroma:latest image to chroma:0.5.5 in my docke compose the problem solved~

andreped commented 1 month ago

After changing the chroma:latest image to chroma:0.5.5 in my docke compose the problem solved~

@yenlianglai Please share more details on what you actually changed and what fixed it. Not everyone is basing their container on the chroma:latest image.

yenlianglai commented 1 month ago

Hi @andreped ,

I had a python program running in docker container with chromadb==0.5.5, and I have a chromadb instance running in another docker container originally using the latest tag, the setup running smoothly until weeks ago and raised the TypeError: Collection.__init__() got an unexpected keyword argument 'log_position' after I rebuild the chromadb instance.

After I change the tag from latest to 0.5.5, it runs smoothly again.

zainhoda commented 1 month ago

@yenlianglai Thanks for the update