Home / Function/ test_partial_structured_parsing_with_think_tags() — langchain Function Reference

test_partial_structured_parsing_with_think_tags() — langchain Function Reference

Architecture documentation for the test_partial_structured_parsing_with_think_tags() function in test_output_parsers.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  d6d23f88_3faf_5572_d85a_c410fdd38d40["test_partial_structured_parsing_with_think_tags()"]
  78e02bb9_2694_e9a5_aaa1_e8312a190104["TestReasoningStructuredOutputParser"]
  d6d23f88_3faf_5572_d85a_c410fdd38d40 -->|defined in| 78e02bb9_2694_e9a5_aaa1_e8312a190104
  style d6d23f88_3faf_5572_d85a_c410fdd38d40 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/partners/perplexity/tests/unit_tests/test_output_parsers.py lines 315–325

    def test_partial_structured_parsing_with_think_tags(self) -> None:
        """Test partial parsing of structured output with think tags."""
        parser: ReasoningStructuredOutputParser[MockPerson] = (
            ReasoningStructuredOutputParser(pydantic_object=MockPerson)
        )
        text = '<think>Starting</think>{"name": "John", "age": 30'
        generation = Generation(text=text)
        # Partial parsing should handle incomplete JSON
        result = parser.parse_result([generation], partial=True)
        # With partial=True, it should return what it can parse
        assert "name" in result or isinstance(result, MockPerson)

Domain

Subdomains

Frequently Asked Questions

What does test_partial_structured_parsing_with_think_tags() do?
test_partial_structured_parsing_with_think_tags() is a function in the langchain codebase, defined in libs/partners/perplexity/tests/unit_tests/test_output_parsers.py.
Where is test_partial_structured_parsing_with_think_tags() defined?
test_partial_structured_parsing_with_think_tags() is defined in libs/partners/perplexity/tests/unit_tests/test_output_parsers.py at line 315.

Analyze Your Own Codebase

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

Try Supermodel Free