Home / Function/ translate_content() — langchain Function Reference

translate_content() — langchain Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  d54d451d_d038_a716_50c8_da9c63df5b41["translate_content()"]
  1a0b0bf5_99ad_e145_2d19_8867a81352ea["bedrock.py"]
  d54d451d_d038_a716_50c8_da9c63df5b41 -->|defined in| 1a0b0bf5_99ad_e145_2d19_8867a81352ea
  5e06f7c2_050e_c749_8122_5724861328e5["_convert_to_v1_from_bedrock()"]
  d54d451d_d038_a716_50c8_da9c63df5b41 -->|calls| 5e06f7c2_050e_c749_8122_5724861328e5
  style d54d451d_d038_a716_50c8_da9c63df5b41 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/langchain_core/messages/block_translators/bedrock.py lines 67–78

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

    Args:
        message: The message to translate.

    Returns:
        The derived content blocks.
    """
    if "claude" not in message.response_metadata.get("model_name", "").lower():
        raise NotImplementedError  # fall back to best-effort parsing
    return _convert_to_v1_from_bedrock(message)

Domain

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free