mirror of https://github.com/hwchase17/langchain
Update chroma.py: Persist directory from client_settings if provided there (#7087)
Change details: - Description: When calling db.persist(), a check prevents from it proceeding as the constructor only sets member `_persist_directory` from parameters. But the ChromaDB client settings also has this parameter, and if the client_settings parameter is used without passing the persist_directory (which is optional), the `persist` method raises `ValueError` for not setting `_persist_directory`. This change fixes it by setting the member `_persist_directory` variable from client_settings if it is set, else uses the constructor parameter. - Issue: I didn't find any github issue of this, but I discovered it after calling the persist method - Dependencies: None - Tag maintainer: vectorstore related change - @rlancemartin, @eyurtsev - Twitter handle: Don't have one :( *Additional discussion*: We may need to discuss the way I implemented the fallback using `or`. --------- Co-authored-by: rlm <pexpresss31@gmail.com>pull/7360/head
parent
cb4e88e4fb
commit
a2830e3056
Loading…
Reference in New Issue