Home / Function/ test_parse_content_list() — langchain Function Reference

test_parse_content_list() — langchain Function Reference

Architecture documentation for the test_parse_content_list() function in test_responses.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  7c4566d9_0cf8_0ceb_a757_bdc536ae7fc0["test_parse_content_list()"]
  df2c2abc_4904_553b_6a07_5ca642deeb63["TestProviderStrategyBinding"]
  7c4566d9_0cf8_0ceb_a757_bdc536ae7fc0 -->|defined in| df2c2abc_4904_553b_6a07_5ca642deeb63
  style 7c4566d9_0cf8_0ceb_a757_bdc536ae7fc0 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain_v1/tests/unit_tests/agents/test_responses.py lines 254–267

    def test_parse_content_list(self) -> None:
        """Test successful parsing for Pydantic model with content as list."""
        schema_spec = _SchemaSpec(schema=_TestModel)
        tool_binding = ProviderStrategyBinding.from_schema_spec(schema_spec)

        message = AIMessage(
            content=['{"name":', {"content": ' "John",'}, {"type": "text", "text": ' "age": 30}'}]
        )
        result = tool_binding.parse(message)

        assert isinstance(result, _TestModel)
        assert result.name == "John"
        assert result.age == 30
        assert result.email == "default@example.com"  # default value

Domain

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free