Open Rainismer opened 1 week ago
The key problem is the version upgrade from 0.1.124 to 0.1.125 causing a TypeError with SegmentAPI's get_or_create_collection()
method, specifically related to the embedding_function
argument.
Here's a step-by-step resolution:
Update ChromaDB Dependency First, ensure you're using a compatible version of ChromaDB. Update to at least version 0.4.13:
pip install chromadb>=0.4.13
Modify Collection Initialization Update your code to explicitly handle collection creation:
from embedchain import App
# Option 1: Specify collection name explicitly
app = App(config={
"collection_name": "my_custom_collection"
})
# Option 2: If using a specific embedding function
from embedchain.embedder.openai import OpenAIEmbedder
embedder = OpenAIEmbedder()
app = App(embedder=embedder)
Potential Configuration Workaround
If the above doesn't work, create a configuration file (config.yaml
):
vectordb:
provider: chroma
config:
collection_name: 'my-app-collection'
Clean Slate Approach If persistent issues occur:
Recommendations:
Would you like me to elaborate on any of these steps or do you need more specific guidance based on your exact implementation?
@AbhigyaWangoo Thank you for your reply, but it doesn't work for me.
What specifically won't work for you?
🐛 Describe the bug
Using embedchain version 0.1.124 everything works fine, but when upgrading to 0.1.125, chroma errors occur.
TypeError: SegmentAPI.get_or_create_collection() got an unexpected keyword argument 'embedding_function'