Skip to content

Commit

Permalink
Prompt answer fetch doc id filter issue (#34)
Browse files Browse the repository at this point in the history
Prompt answer fetch doc if filter issue

Co-authored-by: Neha <[email protected]>
  • Loading branch information
gaya3-zipstack and nehabagdia authored Apr 9, 2024
1 parent aed4fe6 commit 1dd4525
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/unstract/sdk/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "0.18.0"
__version__ = "0.18.1"


def get_sdk_version():
Expand Down
9 changes: 9 additions & 0 deletions src/unstract/sdk/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,18 @@ def get_text_from_index(
try:
self.tool.stream_log(f">>> Querying {vector_db}...")
self.tool.stream_log(f">>> {doc_id}")
doc_id_eq_filter = MetadataFilter.from_dict(
{
"key": "doc_id",
"operator": FilterOperator.EQ,
"value": doc_id,
}
)
filters = MetadataFilters(filters=[doc_id_eq_filter])
q = VectorStoreQuery(
query_embedding=embedding_li.get_query_embedding(" "),
doc_ids=[doc_id],
filters=filters,
similarity_top_k=10000,
)
except Exception as e:
Expand Down

0 comments on commit 1dd4525

Please sign in to comment.