Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates Dependencies #63

Merged
merged 3 commits into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions langchain_weaviate/vectorstores.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def add_texts(
f"Tenant {tenant} does not exist in index {self._index_name}. "
"Creating tenant."
)
tenant_objs = [weaviate.classes.Tenant(name=tenant)]
tenant_objs = [weaviate.classes.tenants.Tenant(name=tenant)]
self._collection.tenants.create(tenants=tenant_objs)

ids = []
Expand All @@ -167,7 +167,7 @@ def add_texts(
texts = list(texts)
embeddings = self._embedding.embed_documents(texts)

with self._client.batch as batch:
with self._client.batch.dynamic() as batch:
for i, text in enumerate(texts):
data_properties = {self._text_key: text}
if metadatas is not None:
Expand Down Expand Up @@ -259,7 +259,7 @@ def _perform_search(
merged_props = {
**obj.properties,
**filtered_metadata,
**({"vector": obj.vector} if obj.vector else {}),
**({"vector": obj.vector["default"]} if obj.vector else {}),
}
doc = Document(page_content=text, metadata=merged_props)
if not return_score:
Expand Down Expand Up @@ -486,7 +486,7 @@ def delete(
if ids is None:
raise ValueError("No ids provided to delete.")

id_filter = weaviate.classes.Filter.by_id().contains_any(ids)
id_filter = weaviate.classes.query.Filter.by_id().contains_any(ids)

with self._tenant_context(tenant) as collection:
collection.data.delete_many(where=id_filter)
Expand Down
Loading
Loading