test_convert_to_openai_messages_vertexai_image() — langchain Function Reference
Architecture documentation for the test_convert_to_openai_messages_vertexai_image() function in test_utils.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 31add219_35f8_705e_c76c_d9ca327fb45a["test_convert_to_openai_messages_vertexai_image()"] ea3f8d89_f44b_6738_3cb9_a740a73cfca4["test_utils.py"] 31add219_35f8_705e_c76c_d9ca327fb45a -->|defined in| ea3f8d89_f44b_6738_3cb9_a740a73cfca4 14e6fdde_cf6a_539a_67f6_36fd8fde5d20["create_image_data()"] 31add219_35f8_705e_c76c_d9ca327fb45a -->|calls| 14e6fdde_cf6a_539a_67f6_36fd8fde5d20 1dd19a53_952f_5baf_39c4_aa23f0cd7f59["create_base64_image()"] 31add219_35f8_705e_c76c_d9ca327fb45a -->|calls| 1dd19a53_952f_5baf_39c4_aa23f0cd7f59 style 31add219_35f8_705e_c76c_d9ca327fb45a fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/core/tests/unit_tests/messages/test_utils.py lines 1179–1195
def test_convert_to_openai_messages_vertexai_image() -> None:
image_data = create_image_data()
messages = [
HumanMessage(
content=[
{"type": "text", "text": "Here's an image:"},
{
"type": "media",
"mime_type": "image/jpeg",
"data": 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()
Domain
Subdomains
Source
Frequently Asked Questions
What does test_convert_to_openai_messages_vertexai_image() do?
test_convert_to_openai_messages_vertexai_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_vertexai_image() defined?
test_convert_to_openai_messages_vertexai_image() is defined in libs/core/tests/unit_tests/messages/test_utils.py at line 1179.
What does test_convert_to_openai_messages_vertexai_image() call?
test_convert_to_openai_messages_vertexai_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