Skip to content

Commit

Permalink
Add stream updating
Browse files Browse the repository at this point in the history
  • Loading branch information
Jorge committed Mar 13, 2024
1 parent 104a6df commit c14239b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ def from_components( # Implemented in order to keep the current API
endpoint_id: str,
credentials_path: Optional[str] = None,
embedding: Optional[Embeddings] = None,
stream_update: bool = False,
**kwargs: Any,
) -> "VectorSearchVectorStore":
"""Takes the object creation out of the constructor.
Expand All @@ -284,6 +285,8 @@ def from_components( # Implemented in order to keep the current API
the local file system.
embedding: The :class:`Embeddings` that will be used for
embedding the texts.
stream_update: Whether to update with streaming or batching. VectorSearch
index must be compatible with stream/batch updates.
kwargs: Additional keyword arguments to pass to
VertexAIVectorSearch.__init__().
Returns:
Expand All @@ -300,7 +303,8 @@ def from_components( # Implemented in order to keep the current API
return cls(
document_storage=GCSDocumentStorage(bucket=bucket),
searcher=VectorSearchSearcher(
endpoint=endpoint, index=index, staging_bucket=bucket
endpoint=endpoint, index=index, staging_bucket=bucket,
stream_update=stream_update
),
embbedings=embedding,
)
2 changes: 1 addition & 1 deletion libs/vertexai/tests/integration_tests/test_vectorstores.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def test_vector_store_filtering(vector_store: VectorSearchVectorStore):
)

assert len(documents) > 0

assert all(document.metadata["color"] == "blue" for document in documents)
assert all(document.metadata["price"] < 20.0 for document in documents)


Expand Down

0 comments on commit c14239b

Please sign in to comment.