Skip to content

Conversation

@danilop
Copy link

@danilop danilop commented Nov 11, 2025

Description

This PR adds support for web-based citations in the Bedrock Converse API, enabling the SDK to handle citations from web sources in addition to document-based citations.

Changes:

  • Added WebLocation TypedDict to src/strands/types/citations.py with url and domain fields
  • Updated CitationLocation union type to include the new WebLocation type
  • Enhanced citation location filtering in src/strands/models/bedrock.py to handle web-based citations
  • Refactored citation metadata processing to use safer dictionary comprehension that only includes fields present in the citation

All citation location types (document-based and web-based) are now supported as per the updated Bedrock Converse API specification.

Related Issues

This was a blocking issue for #1154

Documentation PR

N/A

Type of Change

New feature

Testing

How have you tested the change? Verify that the changes do not break functionality or introduce warnings in consuming repositories: agents-docs, agents-tools, agents-cli

  • I ran hatch run prepare

Checklist

  • I have read the CONTRIBUTING document
  • I have added any necessary tests that prove my fix is effective or my feature works
  • I have updated the documentation accordingly
  • I have added an appropriate example to the documentation to outline the feature, or no new docs are needed
  • My changes generate no new warnings
  • 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.

Danilo Poccia added 2 commits November 11, 2025 12:23
  Refactor CitationLocation TypedDict to support both web and document citations
  with optional fields. Add comprehensive unit tests covering all citation types.
  Fix type errors using cast pattern consistent with existing codebase.
  client-side tools that need agent execution. This prevents infinite
  loops when models return end_turn stopReason for server_tool_use types
  like nova_grounding.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant