feat: integrate retrieval service v1 in Python SDK#11
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds Python SDK support for the new retrieval-service v1 API surface introduced by
knowhere-api#204.This PR depends on
https://github.com/Ontos-AI/knowhere-api/pull/204, which is not merged yet, so live compatibility was verified against a local API checkout of that branch.Client-facing changes
client.retrieval.query(...)andasync_client.retrieval.query(...)forPOST /v1/retrieval/query.client.documents.list(...),client.documents.get(...),client.documents.archive(...)and async equivalents for/v1/documentslifecycle APIs.jobs.create(...)andparse(...)withnamespaceanddocument_idso callers can create retrievable documents and update existing documents.JobandJobResultmodels withnamespaceanddocument_id.Local verification
SDK checks:
uv run pytest uv run ruff check . uv run mypy srcResults:
224 passedruff: all checks passedmypy: no issues found in25source filesLive local compatibility smoke against unmerged
knowhere-api#204:feat/wangbinqi/retrieval-service-v1atbd391efhttp://127.0.0.1:5005knowhere_e2e_will_204e2e-will-204-nokiadoc_da46b74e3b83Verified through the SDK:
client.retrieval.query(namespace="e2e-will-204-nokia", query="Bluetooth", top_k=3)returned3results from the Nokia PDF documentclient.documents.list(namespace="e2e-will-204-nokia")returned the active Nokia documentclient.documents.get("doc_da46b74e3b83")returned the active document stateclient.retrieval.query(...)returned the Nokia document resultclient.documents.list(...)returned the Nokia document listNote: because
knowhere-api#204is unmerged, this PR should be revalidated after the API PR lands or if its public contract changes before merge.