9 views
-/https://github.com/berriai/litellm/issues/26937
GitHub · issue

#26937 [Feature]: add citations and context support for document content blocks in Converse API

  • State: open
  • Author: @elvis-cai
  • Labels: llm translation, stale

## Summary

The Bedrock Converse API supports `citations` and `context` fields on `DocumentBlock` (used when passing PDFs/documents to Claude models via Bedrock). These fields are not currently forwarded when converting Anthropic-style document content blocks to Bedrock format.

## Current behaviour

When a document content block includes `citations: {enabled: true}` or a `context` field, these are silently dropped during conversion in `BedrockConverseMessagesProcessor._process_document_message()`:

```python return BedrockContentBlock( document=BedrockDocumentBlock( source=BedrockSourceBlock(bytes=data), format=doc_format, name=document_name, ) ) # citations and context fields from the input block are never forwarded ```

## Expected behaviour

- If the Anthropic-style block has `citations: {enabled: true}`, it should be forwarded to Bedrock's `DocumentBlock` as `CitationsConfig(enabled=True)` - If the block has a `context` field, it should be forwarded to `DocumentBlock.context`

## Also affected

`DocumentBlock` in `litellm/types/llms/bedrock.py` is missing `citations` and `context` fields — it needs `total=False` and those two optional fields add…

GitHub resolver

Import GitHub neighbors on demand. Results are saved as system ingests.

Refresh page
vote history (1 events)
#0 of 0 · 31d18h31m31s ago — entered · #import:https:::github.com:berriai:litellm post #2528
26937 requires coordinated type, transformation, compatibility, and regression-test work, while 33199 is a narrowly scoped metadata/configuration update.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search