Home / Function/ test_system_message_with_complex_content() — langchain Function Reference

test_system_message_with_complex_content() — langchain Function Reference

Architecture documentation for the test_system_message_with_complex_content() function in test_system_message.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  2e169c5e_0a77_e4bc_df83_ae66f6e194ab["test_system_message_with_complex_content()"]
  fdcac224_4658_3042_d41f_938e751993a3["TestModelRequestSystemMessage"]
  2e169c5e_0a77_e4bc_df83_ae66f6e194ab -->|defined in| fdcac224_4658_3042_d41f_938e751993a3
  style 2e169c5e_0a77_e4bc_df83_ae66f6e194ab fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain_v1/tests/unit_tests/agents/test_system_message.py lines 251–277

    def test_system_message_with_complex_content(self) -> None:
        """Test SystemMessage with complex content (list of dicts)."""
        model = GenericFakeChatModel(messages=iter([AIMessage(content="Hello")]))
        system_msg = SystemMessage(
            content=[
                {"type": "text", "text": "You are helpful"},
                {"type": "text", "text": "Be concise", "cache_control": {"type": "ephemeral"}},
            ]
        )

        request = ModelRequest(
            model=model,
            system_message=system_msg,
            messages=[],
            tool_choice=None,
            tools=[],
            response_format=None,
            state=AgentState(messages=[]),
            runtime=None,
        )

        assert request.system_message is not None
        assert isinstance(request.system_message.content_blocks, list)
        assert len(request.system_message.content_blocks) == 2
        assert request.system_message.content_blocks[1].get("cache_control") == {
            "type": "ephemeral"
        }

Domain

Subdomains

Frequently Asked Questions

What does test_system_message_with_complex_content() do?
test_system_message_with_complex_content() is a function in the langchain codebase, defined in libs/langchain_v1/tests/unit_tests/agents/test_system_message.py.
Where is test_system_message_with_complex_content() defined?
test_system_message_with_complex_content() is defined in libs/langchain_v1/tests/unit_tests/agents/test_system_message.py at line 251.

Analyze Your Own Codebase

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

Try Supermodel Free