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

fix(vectorstores.py): fetch embedding for the near_vector method #133

Closed
wants to merge 4 commits into from
Closed
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
5 changes: 4 additions & 1 deletion langchain_weaviate/vectorstores.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,10 @@ def _perform_search(
query=query, vector=embedding, limit=k, **kwargs
)
elif search_method == "near_vector":
result = collection.query.near_vector(limit=k, **kwargs)
embedding = self._embedding.embed_query(query)
result = collection.query.near_vector(
near_vector=embedding, limit=k, **kwargs
)
else:
raise ValueError(f"Invalid search method: {search_method}")
except weaviate.exceptions.WeaviateQueryException as e:
Expand Down
Loading