Home / Function/ test_human_message_with_secret_round_trip() — langchain Function Reference

test_human_message_with_secret_round_trip() — langchain Function Reference

Architecture documentation for the test_human_message_with_secret_round_trip() function in test_secret_injection.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  75af440c_9ad6_2a10_9668_59899233f245["test_human_message_with_secret_round_trip()"]
  49998757_7899_0216_5862_4d58a200d73a["TestRoundTrip"]
  75af440c_9ad6_2a10_9668_59899233f245 -->|defined in| 49998757_7899_0216_5862_4d58a200d73a
  style 75af440c_9ad6_2a10_9668_59899233f245 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/tests/unit_tests/load/test_secret_injection.py lines 275–287

    def test_human_message_with_secret_round_trip(self) -> None:
        """Verify secret-like dict is preserved as dict after round-trip."""
        msg = HumanMessage(
            content="Hello",
            additional_kwargs={"data": MALICIOUS_SECRET_DICT},
        )

        serialized = dumpd(msg)
        deserialized = load(serialized, secrets_from_env=True)

        # The secret-like dict should be preserved as a plain dict
        assert deserialized.additional_kwargs["data"] == MALICIOUS_SECRET_DICT
        assert isinstance(deserialized.additional_kwargs["data"], dict)

Domain

Subdomains

Frequently Asked Questions

What does test_human_message_with_secret_round_trip() do?
test_human_message_with_secret_round_trip() is a function in the langchain codebase, defined in libs/core/tests/unit_tests/load/test_secret_injection.py.
Where is test_human_message_with_secret_round_trip() defined?
test_human_message_with_secret_round_trip() is defined in libs/core/tests/unit_tests/load/test_secret_injection.py at line 275.

Analyze Your Own Codebase

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

Try Supermodel Free