Home / File/ test_bedrock_converse.py — langchain Source File

test_bedrock_converse.py — langchain Source File

Architecture documentation for test_bedrock_converse.py, a python file in the langchain codebase. 1 imports, 0 dependents.

File python LangChainCore ApiManagement 1 imports 3 functions

Entity Profile

Dependency Diagram

graph LR
  62955156_befa_ca40_1d5e_7a58ff023ab3["test_bedrock_converse.py"]
  9444498b_8066_55c7_b3a2_1d90c4162a32["langchain_core.messages"]
  62955156_befa_ca40_1d5e_7a58ff023ab3 --> 9444498b_8066_55c7_b3a2_1d90c4162a32
  style 62955156_befa_ca40_1d5e_7a58ff023ab3 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

from langchain_core.messages import AIMessage, AIMessageChunk, HumanMessage
from langchain_core.messages import content as types


def test_convert_to_v1_from_bedrock_converse() -> None:
    message = AIMessage(
        [
            {
                "type": "reasoning_content",
                "reasoning_content": {"text": "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": [
                    {
                        "title": "Document Title",
                        "source_content": [{"text": "The weather is sunny."}],
                        "location": {
                            "document_char": {
                                "document_index": 0,
                                "start": 58,
                                "end": 96,
                            }
                        },
                    },
                    {
                        "title": "Document Title",
                        "source_content": [{"text": "The weather is sunny."}],
                        "location": {
                            "document_page": {"document_index": 0, "start": 1, "end": 2}
                        },
                    },
                    {
                        "title": "Document Title",
                        "source_content": [{"text": "The weather is sunny."}],
                        "location": {
                            "document_chunk": {
                                "document_index": 0,
                                "start": 1,
                                "end": 2,
                            }
                        },
                    },
                    {"bar": "baz"},
                ],
            },
            {"type": "something_else", "foo": "bar"},
        ],
        response_metadata={"model_provider": "bedrock_converse"},
    )
    expected_content: list[types.ContentBlock] = [
        {
// ... (320 more lines)

Domain

Subdomains

Dependencies

  • langchain_core.messages

Frequently Asked Questions

What does test_bedrock_converse.py do?
test_bedrock_converse.py is a source file in the langchain codebase, written in python. It belongs to the LangChainCore domain, ApiManagement subdomain.
What functions are defined in test_bedrock_converse.py?
test_bedrock_converse.py defines 3 function(s): test_convert_to_v1_from_bedrock_converse, test_convert_to_v1_from_converse_chunk, test_convert_to_v1_from_converse_input.
What does test_bedrock_converse.py depend on?
test_bedrock_converse.py imports 1 module(s): langchain_core.messages.
Where is test_bedrock_converse.py in the architecture?
test_bedrock_converse.py is located at libs/core/tests/unit_tests/messages/block_translators/test_bedrock_converse.py (domain: LangChainCore, subdomain: ApiManagement, directory: libs/core/tests/unit_tests/messages/block_translators).

Analyze Your Own Codebase

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

Try Supermodel Free