Fix initialization of client in retrieve_docs() function (#2830)

This commit is contained in:
Wei 2024-05-30 23:45:09 +08:00 committed by GitHub
parent 47f9052672
commit 752cf88f92
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 1 deletions

View File

@ -253,7 +253,9 @@ class RetrieveUserProxyAgent(UserProxyAgent):
self._task = self._retrieve_config.get("task", "default") self._task = self._retrieve_config.get("task", "default")
self._vector_db = self._retrieve_config.get("vector_db", "chroma") self._vector_db = self._retrieve_config.get("vector_db", "chroma")
self._db_config = self._retrieve_config.get("db_config", {}) self._db_config = self._retrieve_config.get("db_config", {})
self._client = self._retrieve_config.get("client", chromadb.Client()) self._client = self._retrieve_config.get("client", None)
if self._client is None:
self._client = chromadb.Client()
self._docs_path = self._retrieve_config.get("docs_path", None) self._docs_path = self._retrieve_config.get("docs_path", None)
self._extra_docs = self._retrieve_config.get("extra_docs", False) self._extra_docs = self._retrieve_config.get("extra_docs", False)
self._new_docs = self._retrieve_config.get("new_docs", True) self._new_docs = self._retrieve_config.get("new_docs", True)