Skip to content
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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ response = client.retrieval.query(

print(response.router_used)
print(response.answer_text)
print(response.evidence) # composed parts to consume
print(response.evidence_text)
print(response.evidence) # grouped [E n] parts to consume
print(response.evidence_text) # deprecated; always empty. Use evidence.
print(response.stop_reason)
print(response.failure_reason)

Expand Down
4 changes: 2 additions & 2 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -541,8 +541,8 @@ response = client.retrieval.query(
)
print(response.answer_text) # LLM-generated natural-language answer
print(response.router_used) # "workflow_single_step", "small_kb_all", etc.
print(response.evidence) # composed parts to consume
print(response.evidence_text) # text projection of those parts
print(response.evidence) # grouped [E n] parts to consume
print(response.evidence_text) # deprecated; always empty. Use evidence.
print(response.stop_reason) # agentic termination reason, when returned
print(response.failure_reason) # no-answer reason, when returned
for ref in response.referenced_chunks:
Expand Down
4 changes: 2 additions & 2 deletions src/knowhere/types/retrieval.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ class RetrievalQueryResponse(BaseModel):

Downstream agents consume:

- ``evidence``: composed parts (text/HTML and inline images)
- ``evidence_text``: text projection of those parts
- ``evidence``: grouped ``[E n]`` parts (text/HTML and inline images)
- ``evidence_text``: deprecated; always empty. Use ``evidence``.
- ``results``: raw path chunks for debug
- ``decision_trace``: per-step navigation decisions (includes stop/failure)
- ``referenced_chunks``: structured chunk citations for follow-up queries
Expand Down
6 changes: 3 additions & 3 deletions tests/test_retrieval.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def _make_retrieval_response() -> Dict[str, Any]:
"data": "abc",
},
],
"evidence_text": "Rendered retrieval evidence",
"evidence_text": "",
"stop_reason": "answer_done",
"failure_reason": "insufficient evidence",
"decision_trace": [
Expand Down Expand Up @@ -157,7 +157,7 @@ def test_query_sends_request_and_returns_results(self, sync_client: Any) -> None
assert response.results[0].source.section_path == "Policies / Billing / Refunds"
assert response.answer_text == ("Annual plans may be refunded within 30 days of purchase.")
assert len(response.referenced_chunks) == 1
assert response.evidence_text == "Rendered retrieval evidence"
assert response.evidence_text == ""
assert response.evidence[0].type == "text"
assert response.evidence[0].text == "Annual plans may be refunded within 30 days."
assert response.evidence[1].type == "image"
Expand Down Expand Up @@ -344,7 +344,7 @@ def test_agentic_response_fields(self, sync_client: Any) -> None:
assert response.referenced_chunks[0].file_path is None
assert response.referenced_chunks[0].job_id == "job_123"
assert response.referenced_chunks[0].asset_url == ("https://example.com/assets/chunk_001")
assert response.evidence_text == "Rendered retrieval evidence"
assert response.evidence_text == ""
assert response.evidence[1].media_type == "image/png"
assert not hasattr(response.results[0], "composed")
assert response.stop_reason == "answer_done"
Expand Down
Loading