Skip to content

feat: sync SDK with current worker ZIP contract and agentic retrieval API#23

Merged
suguanYang merged 1 commit into
mainfrom
feat/wangbinqi/sync-worker-contract-and-agentic-api
May 15, 2026
Merged

feat: sync SDK with current worker ZIP contract and agentic retrieval API#23
suguanYang merged 1 commit into
mainfrom
feat/wangbinqi/sync-worker-contract-and-agentic-api

Conversation

@suguanYang
Copy link
Copy Markdown
Collaborator

Summary

Syncs the Python SDK with two server-side changes:

Issue #21 — Align ParseResult ZIP models with current worker output

  • DocNav model — parses doc_nav.json from result ZIPs (sections tree + image/table resource summaries)
  • Manifest HIERARCHY — exposed via hierarchy field with alias="HIERARCHY"
  • document_top_summary — parsed from chunk metadata for all chunk types
  • Legacy cleanuptable_type, chunks_slim, and hierarchy marked as legacy; parser handles their absence gracefully
  • save() writes doc_nav.json and uses by_alias=True for manifest round-trip

Issue #22 — Add agentic retrieval response fields

  • answer_text and referenced_chunks on RetrievalQueryResponse
  • use_agentic parameter on both sync and async query()
  • All new fields optional for backward compatibility

Test plan

  • All 60 existing + new tests pass
  • Staging API verified: use_agentic=True returns answer_text (736 chars) + 13 referenced_chunks with chunk_id, document_id, asset_url
  • Legacy response (no agentic fields) parses without error
  • doc_nav.json round-trips through parse + save
  • Parsing succeeds without chunks_slim.json or hierarchy.json

🤖 Generated with Claude Code

@suguanYang suguanYang force-pushed the feat/wangbinqi/sync-worker-contract-and-agentic-api branch 4 times, most recently from acd09b9 to 1954ccc Compare May 15, 2026 05:07
… API

Add typed ChunkMetadata model for known worker metadata fields while
preserving forward compatibility via extra="allow".

Issue #21 — ParseResult ZIP models
Issue #22 — Agentic retrieval API
@suguanYang suguanYang force-pushed the feat/wangbinqi/sync-worker-contract-and-agentic-api branch from 1954ccc to ad8db2e Compare May 15, 2026 12:15
@suguanYang suguanYang merged commit b4bae96 into main May 15, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant