Home / Function/ test_convert_to_v1_from_anthropic_chunk() — langchain Function Reference

test_convert_to_v1_from_anthropic_chunk() — langchain Function Reference

Architecture documentation for the test_convert_to_v1_from_anthropic_chunk() function in test_anthropic.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  d37f49ca_1de4_ac07_907c_bf1cc94dcb38["test_convert_to_v1_from_anthropic_chunk()"]
  c53716f9_76ec_0893_9384_3c7eaae0b0d1["test_anthropic.py"]
  d37f49ca_1de4_ac07_907c_bf1cc94dcb38 -->|defined in| c53716f9_76ec_0893_9384_3c7eaae0b0d1
  style d37f49ca_1de4_ac07_907c_bf1cc94dcb38 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/tests/unit_tests/messages/block_translators/test_anthropic.py lines 193–390

def test_convert_to_v1_from_anthropic_chunk() -> None:
    chunks = [
        AIMessageChunk(
            content=[{"text": "Looking ", "type": "text", "index": 0}],
            response_metadata={"model_provider": "anthropic"},
        ),
        AIMessageChunk(
            content=[{"text": "now.", "type": "text", "index": 0}],
            response_metadata={"model_provider": "anthropic"},
        ),
        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": "anthropic"},
        ),
        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": "anthropic"},
        ),
        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": "anthropic"},
        ),
        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": "anthropic"},
        ),
        AIMessageChunk(
            content=[
                {"type": "input_json_delta", "partial_json": 'Francisco"}', "index": 1}
            ],
            tool_call_chunks=[
                {
                    "name": None,

Domain

Subdomains

Frequently Asked Questions

What does test_convert_to_v1_from_anthropic_chunk() do?
test_convert_to_v1_from_anthropic_chunk() is a function in the langchain codebase, defined in libs/core/tests/unit_tests/messages/block_translators/test_anthropic.py.
Where is test_convert_to_v1_from_anthropic_chunk() defined?
test_convert_to_v1_from_anthropic_chunk() is defined in libs/core/tests/unit_tests/messages/block_translators/test_anthropic.py at line 193.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free