test_normalize_messages_v1_content_blocks_unchanged() — langchain Function Reference
Architecture documentation for the test_normalize_messages_v1_content_blocks_unchanged() function in test_base.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD b0e92f5a_8a93_2b4d_72a8_a431294c6777["test_normalize_messages_v1_content_blocks_unchanged()"] 8830054d_ac1e_daa9_c6c5_ff55b10d0bf3["test_base.py"] b0e92f5a_8a93_2b4d_72a8_a431294c6777 -->|defined in| 8830054d_ac1e_daa9_c6c5_ff55b10d0bf3 style b0e92f5a_8a93_2b4d_72a8_a431294c6777 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/core/tests/unit_tests/language_models/chat_models/test_base.py lines 840–876
def test_normalize_messages_v1_content_blocks_unchanged() -> None:
"""Test passing v1 content blocks to `_normalize_messages()` leaves unchanged."""
input_messages = [
HumanMessage(
content=[
{
"type": "text",
"text": "Hello world",
},
{
"type": "image",
"url": "https://example.com/image.png",
"mime_type": "image/png",
},
{
"type": "audio",
"base64": "base64encodedaudiodata",
"mime_type": "audio/wav",
},
{
"type": "file",
"id": "file_123",
},
{
"type": "reasoning",
"reasoning": "Let me think about this...",
},
]
)
]
result = _normalize_messages(input_messages)
# Verify the result is identical to the input (message should not be copied)
assert len(result) == 1
assert result[0] is input_messages[0]
assert result[0].content == input_messages[0].content
Domain
Subdomains
Source
Frequently Asked Questions
What does test_normalize_messages_v1_content_blocks_unchanged() do?
test_normalize_messages_v1_content_blocks_unchanged() is a function in the langchain codebase, defined in libs/core/tests/unit_tests/language_models/chat_models/test_base.py.
Where is test_normalize_messages_v1_content_blocks_unchanged() defined?
test_normalize_messages_v1_content_blocks_unchanged() is defined in libs/core/tests/unit_tests/language_models/chat_models/test_base.py at line 840.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free