Skip to content

Commit

Permalink
Fix indexing errors for cases where the index does not have a column …
Browse files Browse the repository at this point in the history
…doc_id (#23)

* Fix indexing issues for new documents. Roll up adapter version

* Merge with latest main

* Update pdm.lock file

---------

Signed-off-by: Gayathri <[email protected]>
  • Loading branch information
gaya3-zipstack authored Mar 22, 2024
1 parent d87222e commit 8a63c09
Show file tree
Hide file tree
Showing 4 changed files with 249 additions and 9 deletions.
250 changes: 244 additions & 6 deletions pdm.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ dependencies = [
"python-magic~=0.4.27",
"python-dotenv==1.0.0",
# LLM Triad
"unstract-adapters~=0.5.0",
"unstract-adapters~=0.6.0",
"llama-index==0.9.28",
"tiktoken~=0.4.0",
"transformers==4.37.0",
Expand Down Expand Up @@ -55,4 +55,4 @@ package-dir = "src"

[tool.pdm.version]
source = "file"
path = "src/unstract/sdk/__init__.py"
path = "src/unstract/sdk/__init__.py"
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.15.2"
__version__ = "0.16.0"


def get_sdk_version():
Expand Down
2 changes: 2 additions & 0 deletions src/unstract/sdk/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,11 @@ def index_file(
)
raise SdkError(f"Error loading {vector_db}")

filter = [{"field_name": "doc_id", "operator": "=", "value": doc_id}]
q = VectorStoreQuery(
query_embedding=embedding_li.get_query_embedding(" "),
doc_ids=[doc_id],
filters=filter,
)

doc_id_not_found = True
Expand Down

0 comments on commit 8a63c09

Please sign in to comment.