test_convert_with_extras_on_v0_block() — langchain Function Reference
Architecture documentation for the test_convert_with_extras_on_v0_block() function in test_langchain_v0.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 926aa1dd_ac74_b7d6_634f_91030547138c["test_convert_with_extras_on_v0_block()"] a210deb5_9c5f_af1b_1840_d884378a78aa["test_langchain_v0.py"] 926aa1dd_ac74_b7d6_634f_91030547138c -->|defined in| a210deb5_9c5f_af1b_1840_d884378a78aa style 926aa1dd_ac74_b7d6_634f_91030547138c fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/core/tests/unit_tests/messages/block_translators/test_langchain_v0.py lines 85–113
def test_convert_with_extras_on_v0_block() -> None:
"""Test that extras on old-style blocks are preserved in conversion.
Refer to `_extract_v0_extras` for details.
"""
block = {
"type": "image",
"source_type": "url",
"url": "https://example.com/image.png",
# extras follow
"alt_text": "An example image",
"caption": "Example caption",
"name": "example_image",
"description": None,
"attribution": None,
}
expected_output = {
"type": "image",
"url": "https://example.com/image.png",
"extras": {
"alt_text": "An example image",
"caption": "Example caption",
"name": "example_image",
# "description": None, # These are filtered out
# "attribution": None,
},
}
assert _convert_legacy_v0_content_block_to_v1(block) == expected_output
Domain
Subdomains
Source
Frequently Asked Questions
What does test_convert_with_extras_on_v0_block() do?
test_convert_with_extras_on_v0_block() is a function in the langchain codebase, defined in libs/core/tests/unit_tests/messages/block_translators/test_langchain_v0.py.
Where is test_convert_with_extras_on_v0_block() defined?
test_convert_with_extras_on_v0_block() is defined in libs/core/tests/unit_tests/messages/block_translators/test_langchain_v0.py at line 85.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free