mirror of
https://github.com/hwchase17/langchain.git
synced 2025-06-22 14:49:29 +00:00
Harrison/chroma update (#3489)
Co-authored-by: vyeevani <30946190+vyeevani@users.noreply.github.com> Co-authored-by: Vineeth Yeevani <vineeth.yeevani@gmail.com>
This commit is contained in:
parent
c8b70e1c6a
commit
d3ce47414d
@ -315,6 +315,17 @@ class Chroma(VectorStore):
|
|||||||
)
|
)
|
||||||
self._client.persist()
|
self._client.persist()
|
||||||
|
|
||||||
|
def update_document(self, document_id: str, document: Document) -> None:
|
||||||
|
"""Update a document in the collection.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
document_id (str): ID of the document to update.
|
||||||
|
document (Document): Document to update.
|
||||||
|
"""
|
||||||
|
text = document.page_content
|
||||||
|
metadata = document.metadata
|
||||||
|
self._collection.update_document(document_id, text, metadata)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def from_texts(
|
def from_texts(
|
||||||
cls: Type[Chroma],
|
cls: Type[Chroma],
|
||||||
|
Loading…
Reference in New Issue
Block a user