Home / Function/ test_convert_to_v1_from_bedrock() — langchain Function Reference

test_convert_to_v1_from_bedrock() — langchain Function Reference

Architecture documentation for the test_convert_to_v1_from_bedrock() function in test_bedrock.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  58067aeb_42ba_f2b6_1b72_f7860b826112["test_convert_to_v1_from_bedrock()"]
  def88697_e248_838a_32cb_8e4be93e1e37["test_bedrock.py"]
  58067aeb_42ba_f2b6_1b72_f7860b826112 -->|defined in| def88697_e248_838a_32cb_8e4be93e1e37
  style 58067aeb_42ba_f2b6_1b72_f7860b826112 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/tests/unit_tests/messages/block_translators/test_bedrock.py lines 5–129

def test_convert_to_v1_from_bedrock() -> None:
    message = AIMessage(
        [
            {"type": "thinking", "thinking": "foo", "signature": "foo_signature"},
            {"type": "text", "text": "Let's call a tool."},
            {
                "type": "tool_use",
                "id": "abc_123",
                "name": "get_weather",
                "input": {"location": "San Francisco"},
            },
            {
                "type": "text",
                "text": "It's sunny.",
                "citations": [
                    {
                        "type": "search_result_location",
                        "cited_text": "The weather is sunny.",
                        "source": "source_123",
                        "title": "Document Title",
                        "search_result_index": 1,
                        "start_block_index": 0,
                        "end_block_index": 2,
                    },
                    {"bar": "baz"},
                ],
            },
            {"type": "something_else", "foo": "bar"},
        ],
        tool_calls=[
            {
                "type": "tool_call",
                "id": "abc_123",
                "name": "get_weather",
                "args": {"location": "San Francisco"},
            },
            {
                "type": "tool_call",
                "id": "abc_234",
                "name": "another_tool",
                "args": {"arg_1": "value_1"},
            },
        ],
        response_metadata={
            "model_provider": "bedrock",
            "model_name": "us.anthropic.claude-sonnet-4-20250514-v1:0",
        },
    )
    expected_content: list[types.ContentBlock] = [
        {
            "type": "reasoning",
            "reasoning": "foo",
            "extras": {"signature": "foo_signature"},
        },
        {"type": "text", "text": "Let's call a tool."},
        {
            "type": "tool_call",
            "id": "abc_123",
            "name": "get_weather",
            "args": {"location": "San Francisco"},
        },
        {
            "type": "text",
            "text": "It's sunny.",
            "annotations": [
                {
                    "type": "citation",
                    "title": "Document Title",
                    "cited_text": "The weather is sunny.",
                    "extras": {
                        "source": "source_123",
                        "search_result_index": 1,
                        "start_block_index": 0,
                        "end_block_index": 2,
                    },
                },
                {"type": "non_standard_annotation", "value": {"bar": "baz"}},
            ],
        },
        {
            "type": "non_standard",

Domain

Subdomains

Frequently Asked Questions

What does test_convert_to_v1_from_bedrock() do?
test_convert_to_v1_from_bedrock() is a function in the langchain codebase, defined in libs/core/tests/unit_tests/messages/block_translators/test_bedrock.py.
Where is test_convert_to_v1_from_bedrock() defined?
test_convert_to_v1_from_bedrock() is defined in libs/core/tests/unit_tests/messages/block_translators/test_bedrock.py at line 5.

Analyze Your Own Codebase

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

Try Supermodel Free