🌟 The Multi-Agent Framework: First AI Software Company, Towards Natural Language Programming
fix chromadb ut
betterwang91c58d04cff6
diff --git a/.gitignore b/.gitignoreindex 30c5edadb..31dfa7af7 100644--- a/.gitignore+++ b/.gitignore@@ -27,6 +27,7 @@ share/python-wheels/.installed.cfg*.eggMANIFEST+metagpt/tools/schemas/# PyInstaller# Usually these files are written by a python scripts from a templatediff --git a/metagpt/document_store/chromadb_store.py b/metagpt/document_store/chromadb_store.pyindex 8c2114f66..1d3a014ee 100644--- a/metagpt/document_store/chromadb_store.py+++ b/metagpt/document_store/chromadb_store.py@@ -11,7 +11,7 @@ import chromadbclass ChromaStore:"""If inherited from BaseStore, or importing other modules from metagpt, a Python exception occurs, which is strange."""- def __init__(self, name, get_or_create: bool = True):+ def __init__(self, name: str, get_or_create: bool = False):client = chromadb.Client()collection = client.create_collection(name, get_or_create=get_or_create)self.client = clientdiff --git a/tests/metagpt/document_store/test_chromadb_store.py b/tests/metagpt/document_store/test_chromadb_store.pyindex fd115dcdd..70b30d814 100644--- a/tests/metagpt/document_store/test_chromadb_store.py+++ b/tests/metagpt/document_store/test_chromadb_store.py@@ -12,7 +12,7 @@ from metagpt.document_store.chromadb_store import ChromaStoredef test_chroma_store():"""FIXME:chroma使用感觉很诡异,一用Python就挂,测试用例里也是"""# 创建 ChromaStore 实例,使用 'sample_collection' 集合- document_store = ChromaStore("sample_collection_1")+ document_store = ChromaStore("sample_collection_1", get_or_create=True)# 使用 write 方法添加多个文档document_store.write(