Home / Function/ test_merge_message_runs_response_metadata() — langchain Function Reference

test_merge_message_runs_response_metadata() — langchain Function Reference

Architecture documentation for the test_merge_message_runs_response_metadata() function in test_utils.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  fc0cbaa7_9bbf_566b_ef46_0dd5e80fc650["test_merge_message_runs_response_metadata()"]
  ea3f8d89_f44b_6738_3cb9_a740a73cfca4["test_utils.py"]
  fc0cbaa7_9bbf_566b_ef46_0dd5e80fc650 -->|defined in| ea3f8d89_f44b_6738_3cb9_a740a73cfca4
  style fc0cbaa7_9bbf_566b_ef46_0dd5e80fc650 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/tests/unit_tests/messages/test_utils.py lines 69–84

def test_merge_message_runs_response_metadata() -> None:
    messages = [
        AIMessage("foo", id="1", response_metadata={"input_tokens": 1}),
        AIMessage("bar", id="2", response_metadata={"input_tokens": 2}),
    ]
    expected = [
        AIMessage(
            "foo\nbar",
            id="1",
            response_metadata={"input_tokens": 1},
        )
    ]
    actual = merge_message_runs(messages)
    assert actual == expected
    # Check it's not mutated
    assert messages[1].response_metadata == {"input_tokens": 2}

Subdomains

Frequently Asked Questions

What does test_merge_message_runs_response_metadata() do?
test_merge_message_runs_response_metadata() is a function in the langchain codebase, defined in libs/core/tests/unit_tests/messages/test_utils.py.
Where is test_merge_message_runs_response_metadata() defined?
test_merge_message_runs_response_metadata() is defined in libs/core/tests/unit_tests/messages/test_utils.py at line 69.

Analyze Your Own Codebase

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

Try Supermodel Free