test_convert_to_v1_from_bedrock_chunk() — langchain Function Reference
Architecture documentation for the test_convert_to_v1_from_bedrock_chunk() function in test_bedrock.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 93681780_35f4_d7a9_b661_4866c1943941["test_convert_to_v1_from_bedrock_chunk()"] def88697_e248_838a_32cb_8e4be93e1e37["test_bedrock.py"] 93681780_35f4_d7a9_b661_4866c1943941 -->|defined in| def88697_e248_838a_32cb_8e4be93e1e37 style 93681780_35f4_d7a9_b661_4866c1943941 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/core/tests/unit_tests/messages/block_translators/test_bedrock.py lines 132–286
def test_convert_to_v1_from_bedrock_chunk() -> None:
chunks = [
AIMessageChunk(
content=[{"text": "Looking ", "type": "text", "index": 0}],
response_metadata={"model_provider": "bedrock"},
),
AIMessageChunk(
content=[{"text": "now.", "type": "text", "index": 0}],
response_metadata={"model_provider": "bedrock"},
),
AIMessageChunk(
content=[
{
"type": "tool_use",
"name": "get_weather",
"input": {},
"id": "toolu_abc123",
"index": 1,
}
],
tool_call_chunks=[
{
"type": "tool_call_chunk",
"name": "get_weather",
"args": "",
"id": "toolu_abc123",
"index": 1,
}
],
response_metadata={"model_provider": "bedrock"},
),
AIMessageChunk(
content=[{"type": "input_json_delta", "partial_json": "", "index": 1}],
tool_call_chunks=[
{
"name": None,
"args": "",
"id": None,
"index": 1,
"type": "tool_call_chunk",
}
],
response_metadata={"model_provider": "bedrock"},
),
AIMessageChunk(
content=[
{"type": "input_json_delta", "partial_json": '{"loca', "index": 1}
],
tool_call_chunks=[
{
"name": None,
"args": '{"loca',
"id": None,
"index": 1,
"type": "tool_call_chunk",
}
],
response_metadata={"model_provider": "bedrock"},
),
AIMessageChunk(
content=[
{"type": "input_json_delta", "partial_json": 'tion": "San ', "index": 1}
],
tool_call_chunks=[
{
"name": None,
"args": 'tion": "San ',
"id": None,
"index": 1,
"type": "tool_call_chunk",
}
],
response_metadata={"model_provider": "bedrock"},
),
AIMessageChunk(
content=[
{"type": "input_json_delta", "partial_json": 'Francisco"}', "index": 1}
],
tool_call_chunks=[
{
"name": None,
Domain
Subdomains
Source
Frequently Asked Questions
What does test_convert_to_v1_from_bedrock_chunk() do?
test_convert_to_v1_from_bedrock_chunk() is a function in the langchain codebase, defined in libs/core/tests/unit_tests/messages/block_translators/test_bedrock.py.
Where is test_convert_to_v1_from_bedrock_chunk() defined?
test_convert_to_v1_from_bedrock_chunk() is defined in libs/core/tests/unit_tests/messages/block_translators/test_bedrock.py at line 132.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free