test_convert_to_v1_from_converse_input() — langchain Function Reference
Architecture documentation for the test_convert_to_v1_from_converse_input() function in test_bedrock_converse.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 87ea7327_a406_8701_ffa8_89c06f06ce33["test_convert_to_v1_from_converse_input()"] 62955156_befa_ca40_1d5e_7a58ff023ab3["test_bedrock_converse.py"] 87ea7327_a406_8701_ffa8_89c06f06ce33 -->|defined in| 62955156_befa_ca40_1d5e_7a58ff023ab3 style 87ea7327_a406_8701_ffa8_89c06f06ce33 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/core/tests/unit_tests/messages/block_translators/test_bedrock_converse.py lines 285–379
def test_convert_to_v1_from_converse_input() -> None:
message = HumanMessage(
[
{"text": "foo"},
{
"document": {
"format": "txt",
"name": "doc_name_1",
"source": {"text": "doc_text_1"},
"context": "doc_context_1",
"citations": {"enabled": True},
},
},
{
"document": {
"format": "pdf",
"name": "doc_name_2",
"source": {"bytes": b"doc_text_2"},
},
},
{
"document": {
"format": "txt",
"name": "doc_name_3",
"source": {"content": [{"text": "doc_text"}, {"text": "_3"}]},
"context": "doc_context_3",
},
},
{
"image": {
"format": "jpeg",
"source": {"bytes": b"image_bytes"},
}
},
{
"document": {
"format": "pdf",
"name": "doc_name_4",
"source": {
"s3Location": {"uri": "s3://bla", "bucketOwner": "owner"}
},
},
},
]
)
expected: list[types.ContentBlock] = [
{"type": "text", "text": "foo"},
{
"type": "text-plain",
"mime_type": "text/plain",
"text": "doc_text_1",
"extras": {
"name": "doc_name_1",
"context": "doc_context_1",
"citations": {"enabled": True},
},
},
{
"type": "file",
"mime_type": "application/pdf",
"base64": "ZG9jX3RleHRfMg==",
"extras": {"name": "doc_name_2"},
},
{
"type": "non_standard",
"value": {
"document": {
"format": "txt",
"name": "doc_name_3",
"source": {"content": [{"text": "doc_text"}, {"text": "_3"}]},
"context": "doc_context_3",
},
},
},
{
"type": "image",
"base64": "aW1hZ2VfYnl0ZXM=",
"mime_type": "image/jpeg",
},
{
Domain
Subdomains
Source
Frequently Asked Questions
What does test_convert_to_v1_from_converse_input() do?
test_convert_to_v1_from_converse_input() is a function in the langchain codebase, defined in libs/core/tests/unit_tests/messages/block_translators/test_bedrock_converse.py.
Where is test_convert_to_v1_from_converse_input() defined?
test_convert_to_v1_from_converse_input() is defined in libs/core/tests/unit_tests/messages/block_translators/test_bedrock_converse.py at line 285.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free