Home / Function/ test_tool_message_ser_non_serializable() — langchain Function Reference

test_tool_message_ser_non_serializable() — langchain Function Reference

Architecture documentation for the test_tool_message_ser_non_serializable() function in test_messages.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  7cefdb24_a0f4_5269_ffdf_1409ee046159["test_tool_message_ser_non_serializable()"]
  3f9e7dd9_29c9_13fc_d3d8_a14d452f0d26["test_messages.py"]
  7cefdb24_a0f4_5269_ffdf_1409ee046159 -->|defined in| 3f9e7dd9_29c9_13fc_d3d8_a14d452f0d26
  style 7cefdb24_a0f4_5269_ffdf_1409ee046159 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/tests/unit_tests/test_messages.py lines 943–965

def test_tool_message_ser_non_serializable() -> None:
    bad_obj = BadObject()
    message = ToolMessage("foo", artifact=bad_obj, tool_call_id="1")
    ser_message = {
        "lc": 1,
        "type": "constructor",
        "id": ["langchain", "schema", "messages", "ToolMessage"],
        "kwargs": {
            "content": "foo",
            "type": "tool",
            "tool_call_id": "1",
            "artifact": {
                "lc": 1,
                "type": "not_implemented",
                "id": ["tests", "unit_tests", "test_messages", "BadObject"],
                "repr": repr(bad_obj),
            },
            "status": "success",
        },
    }
    assert dumpd(message) == ser_message
    with pytest.raises(NotImplementedError):
        load(dumpd(message), allowed_objects=[ToolMessage])

Subdomains

Frequently Asked Questions

What does test_tool_message_ser_non_serializable() do?
test_tool_message_ser_non_serializable() is a function in the langchain codebase, defined in libs/core/tests/unit_tests/test_messages.py.
Where is test_tool_message_ser_non_serializable() defined?
test_tool_message_ser_non_serializable() is defined in libs/core/tests/unit_tests/test_messages.py at line 943.

Analyze Your Own Codebase

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

Try Supermodel Free