Closed inoue0426 closed 2 months ago
@inoue0426 - Coincidently I was trying the same (autogen RAG) around the time you posted the issue and I faced same issue too. I sorted it out by kinda hacky way by creating the collection using chromadb client. Code snippets shown below:
CHROMA_DB_PATH="/app/tmp/chromadb"
CHROMA_COLLECTION="autogen-docs-test"
chroma_client = chromadb.PersistentClient(path=CHROMA_DB_PATH)
collection = chroma_client.get_or_create_collection(name=CHROMA_COLLECTION)
ollama_ef = embedding_functions.OllamaEmbeddingFunction(
url="http://<my local ollama host and port>/api/embeddings",
model_name="mxbai-embed-large",
)
vector_db = ChromaVectorDB(path=CHROMA_DB_PATH, embedding_function = ollama_ef)
and usage of db path and collection name while creating agent
ragproxyagent = RetrieveUserProxyAgent(
name="ragproxyagent",
human_input_mode="NEVER",
llm_config=llm_config,
code_execution_config=False,
retrieve_config={
"model": config_list[0]["model"],
"task": "qa",
"update_context": True,
"n_results": 3,
"docs_path":[
"./qa.txt",
],
"get_or_create": True,
"overwrite": False,
"vector_db": vector_db,
"collection_name": CHROMA_COLLECTION,
"embedding_function": ollama_ef,
},
)
@vijaygill This works! Thanks.
Hi @inoue0426 , @vijaygill ,thanks a lot for reporting the issue. It caused by an error type change inside chromadb. For now, you can also downgrade chromadb to <=0.5.0
(maybe some versions >0.5.0 will work, but I didn't try all of them). I'll raise a PR to fix it.
@thinkall - Thanks! I am working on a POC application so this hack is working for me and I will revisit this part later. May be a new version with your PR might be already available by then! Thanks for all the great work!
@thinkall Thanks! I will try to use it!
Describe the issue
I am following this sample https://microsoft.github.io/autogen/blog/2023/10/18/RetrieveChat/ and it always return below error. Could you teach me how to resolve this?
[Sep 20] This also shows the same error. https://microsoft.github.io/autogen/docs/topics/retrieval_augmentation/
Steps to reproduce
Below is the code. This also happened with OPEN AI API.
Screenshots and logs
Additional Information