Repository navigation
Conversation
AgentScopeJavaBot
left a comment
There was a problem hiding this comment.
🤖 AI Review
This PR adds PDF document support and native citation handling for the Anthropic integration. The changes are well-architected: a provider-neutral Citation sealed interface in core, TextBlock enhancements with citations and providerBlockIndex, a reworked TextAccumulator that preserves per-provider-block boundaries, and Anthropic-specific converters for PDF sources (base64, local file, file URI, HTTP URL) and citation responses (page, character, content-block — both streaming and non-streaming). The code is clean, backward-compatible, and has good test coverage (135 tests). No critical bugs found. Two minor suggestions below.
(inline comments could not be attached — line numbers fell outside PR hunks. See archived report.)
AgentScopeJavaBot
left a comment
There was a problem hiding this comment.
🤖 AI Review
This PR adds PDF document support and native citation handling for the Anthropic integration. The changes are well-architected: a provider-neutral Citation sealed interface in core, TextBlock enhancements with citations and providerBlockIndex, a reworked TextAccumulator that preserves per-provider-block boundaries, and Anthropic-specific converters for PDF sources (base64, local file, file URI, HTTP URL) and citation responses (page, character, content-block — both streaming and non-streaming). The code is clean, backward-compatible, and has good test coverage (135 tests). No critical bugs found. Two minor suggestions below.
(inline comments could not be attached — line numbers fell outside PR hunks. See archived report.)
oss-maintainer
left a comment
There was a problem hiding this comment.
Summary
This PR contains 2526 lines of changes. Review in progress.
Automated review by github-manager-bot
Preview approval requiredThis pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit |
Description
Closes #2224.
Adds native Anthropic PDF document input and citation metadata support. PDFs use the provider-neutral
DocumentBlockmodel rather thanDataBlock, so document semantics and provider file IDs stay explicit. Anthropic response citations are preserved as provider-specific response metadata underanthropic.citations.Changes
DocumentBlockinput to native Anthropic document blocks:Base64Sourcefile://URLsFileIdSourcereferences to files already uploaded to AnthropicDocumentBlockthrough user messages, tool results, and the Anthropic multi-agent formatter.anthropic.citationsresponse metadata. Each entry includes the citation type, source block index, cited text, document index, location fields, and optional title/file ID.application/pdffrom.pdfextensions in the shared media utility.DataBlockimage-only for Anthropic; PDFDataBlockinput now fails fast instead of creating a misleading document path.Scope
DocumentBlock.DataBlockremains a generic media block and is not accepted as PDF input for Anthropic.FileIdSource.