Home / Function/ translate_content_chunk() — langchain Function Reference

translate_content_chunk() — langchain Function Reference

Architecture documentation for the translate_content_chunk() function in bedrock.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  e580c207_537d_4d21_17c0_7bddc427cac2["translate_content_chunk()"]
  1a0b0bf5_99ad_e145_2d19_8867a81352ea["bedrock.py"]
  e580c207_537d_4d21_17c0_7bddc427cac2 -->|defined in| 1a0b0bf5_99ad_e145_2d19_8867a81352ea
  bd29f58b_2e57_aab4_0d42_f7236d77befc["_convert_to_v1_from_bedrock_chunk()"]
  e580c207_537d_4d21_17c0_7bddc427cac2 -->|calls| bd29f58b_2e57_aab4_0d42_f7236d77befc
  style e580c207_537d_4d21_17c0_7bddc427cac2 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/langchain_core/messages/block_translators/bedrock.py lines 81–93

def translate_content_chunk(message: AIMessageChunk) -> list[types.ContentBlock]:
    """Derive standard content blocks from a message chunk with Bedrock content.

    Args:
        message: The message chunk to translate.

    Returns:
        The derived content blocks.
    """
    # TODO: add model_name to all Bedrock chunks and update core merging logic
    # to not append during aggregation. Then raise NotImplementedError here if
    # not an Anthropic model to fall back to best-effort parsing.
    return _convert_to_v1_from_bedrock_chunk(message)

Domain

Subdomains

Frequently Asked Questions

What does translate_content_chunk() do?
translate_content_chunk() is a function in the langchain codebase, defined in libs/core/langchain_core/messages/block_translators/bedrock.py.
Where is translate_content_chunk() defined?
translate_content_chunk() is defined in libs/core/langchain_core/messages/block_translators/bedrock.py at line 81.
What does translate_content_chunk() call?
translate_content_chunk() calls 1 function(s): _convert_to_v1_from_bedrock_chunk.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free