Home / Function/ test_convert_to_openai_messages_bedrock_converse_image() — langchain Function Reference

test_convert_to_openai_messages_bedrock_converse_image() — langchain Function Reference

Architecture documentation for the test_convert_to_openai_messages_bedrock_converse_image() function in test_utils.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  33b18a46_53d8_fe91_a83b_3316229d7dea["test_convert_to_openai_messages_bedrock_converse_image()"]
  ea3f8d89_f44b_6738_3cb9_a740a73cfca4["test_utils.py"]
  33b18a46_53d8_fe91_a83b_3316229d7dea -->|defined in| ea3f8d89_f44b_6738_3cb9_a740a73cfca4
  14e6fdde_cf6a_539a_67f6_36fd8fde5d20["create_image_data()"]
  33b18a46_53d8_fe91_a83b_3316229d7dea -->|calls| 14e6fdde_cf6a_539a_67f6_36fd8fde5d20
  1dd19a53_952f_5baf_39c4_aa23f0cd7f59["create_base64_image()"]
  33b18a46_53d8_fe91_a83b_3316229d7dea -->|calls| 1dd19a53_952f_5baf_39c4_aa23f0cd7f59
  style 33b18a46_53d8_fe91_a83b_3316229d7dea fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/tests/unit_tests/messages/test_utils.py lines 1159–1176

def test_convert_to_openai_messages_bedrock_converse_image() -> None:
    image_data = create_image_data()
    messages = [
        HumanMessage(
            content=[
                {"type": "text", "text": "Here's an image:"},
                {
                    "image": {
                        "format": "jpeg",
                        "source": {"bytes": base64.b64decode(image_data)},
                    }
                },
            ]
        )
    ]
    result = convert_to_openai_messages(messages)
    assert result[0]["content"][1]["type"] == "image_url"
    assert result[0]["content"][1]["image_url"]["url"] == create_base64_image()

Subdomains

Frequently Asked Questions

What does test_convert_to_openai_messages_bedrock_converse_image() do?
test_convert_to_openai_messages_bedrock_converse_image() is a function in the langchain codebase, defined in libs/core/tests/unit_tests/messages/test_utils.py.
Where is test_convert_to_openai_messages_bedrock_converse_image() defined?
test_convert_to_openai_messages_bedrock_converse_image() is defined in libs/core/tests/unit_tests/messages/test_utils.py at line 1159.
What does test_convert_to_openai_messages_bedrock_converse_image() call?
test_convert_to_openai_messages_bedrock_converse_image() calls 2 function(s): create_base64_image, create_image_data.

Analyze Your Own Codebase

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

Try Supermodel Free