Skip to content

Commit 91c58d0

Browse files
committed
fix chromadb ut
1 parent 2ffa9e1 commit 91c58d0

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ share/python-wheels/
2727
.installed.cfg
2828
*.egg
2929
MANIFEST
30+
metagpt/tools/schemas/
3031

3132
# PyInstaller
3233
# Usually these files are written by a python scripts from a template

metagpt/document_store/chromadb_store.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
class ChromaStore:
1212
"""If inherited from BaseStore, or importing other modules from metagpt, a Python exception occurs, which is strange."""
1313

14-
def __init__(self, name, get_or_create: bool = True):
14+
def __init__(self, name: str, get_or_create: bool = False):
1515
client = chromadb.Client()
1616
collection = client.create_collection(name, get_or_create=get_or_create)
1717
self.client = client

tests/metagpt/document_store/test_chromadb_store.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
def test_chroma_store():
1313
"""FIXME:chroma使用感觉很诡异,一用Python就挂,测试用例里也是"""
1414
# 创建 ChromaStore 实例,使用 'sample_collection' 集合
15-
document_store = ChromaStore("sample_collection_1")
15+
document_store = ChromaStore("sample_collection_1", get_or_create=True)
1616

1717
# 使用 write 方法添加多个文档
1818
document_store.write(

0 commit comments

Comments
 (0)