Skip to content

Commit

Permalink
Harrison/chroma update (langchain-ai#3489)
Browse files Browse the repository at this point in the history
Co-authored-by: vyeevani <[email protected]>
Co-authored-by: Vineeth Yeevani <[email protected]>
  • Loading branch information
3 people authored Apr 25, 2023
1 parent c8b70e1 commit d3ce474
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions langchain/vectorstores/chroma.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,17 @@ def persist(self) -> None:
)
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
def from_texts(
cls: Type[Chroma],
Expand Down

0 comments on commit d3ce474

Please sign in to comment.