sdk-python icon indicating copy to clipboard operation
sdk-python copied to clipboard

feat(citations): Add support for web and search result citations

Open danilop opened this issue 1 month ago • 0 comments

Description

This PR adds support for web-based and search result citations in the Bedrock Converse API, completing support for all citation location types.

New Features:

  • WebLocation type for web-based citations (url, domain)
  • SearchResultLocation type for search result citations (searchResultIndex, start, end)
  • Updated _format_citation_location to handle all 5 location types

Dependencies

This PR depends on #1343 (fix: Preserve tagged union structure for CitationLocation) which must be merged first.

Related Issues

Fixes #1345

Type of Change

New feature

Testing

  • [X] I ran hatch run prepare (1618 tests pass)
  • [X] Tests for web citations
  • [X] Tests for search result citations
  • [X] Tests for field filtering

Checklist

  • [X] I have read the CONTRIBUTING document
  • [X] I have added any necessary tests that prove my fix is effective or my feature works
  • [X] I have added an appropriate example to the documentation to outline the feature, or no new docs are needed
  • [X] My changes generate no new warnings
  • [X] Any dependent changes have been merged and published

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

danilop avatar Dec 16 '25 09:12 danilop