Home / Function/ test_parse_complex_json_with_think_tags() — langchain Function Reference

test_parse_complex_json_with_think_tags() — langchain Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  c6e7a715_73b9_023c_812d_0b22aa715c81["test_parse_complex_json_with_think_tags()"]
  dd46aa2b_85a9_6271_a241_97400f51b41f["TestReasoningJsonOutputParser"]
  c6e7a715_73b9_023c_812d_0b22aa715c81 -->|defined in| dd46aa2b_85a9_6271_a241_97400f51b41f
  style c6e7a715_73b9_023c_812d_0b22aa715c81 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/partners/perplexity/tests/unit_tests/test_output_parsers.py lines 120–139

    def test_parse_complex_json_with_think_tags(self) -> None:
        """Test parsing complex nested JSON with think tags."""
        parser = ReasoningJsonOutputParser()
        text = """<think>Creating nested structure</think>
{
    "user": {
        "name": "John",
        "address": {
            "city": "NYC",
            "zip": "10001"
        }
    },
    "items": [1, 2, 3]
}"""
        generation = Generation(text=text)
        result = parser.parse_result([generation])
        assert result == {
            "user": {"name": "John", "address": {"city": "NYC", "zip": "10001"}},
            "items": [1, 2, 3],
        }

Domain

Subdomains

Frequently Asked Questions

What does test_parse_complex_json_with_think_tags() do?
test_parse_complex_json_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_parse_complex_json_with_think_tags() defined?
test_parse_complex_json_with_think_tags() is defined in libs/partners/perplexity/tests/unit_tests/test_output_parsers.py at line 120.

Analyze Your Own Codebase

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

Try Supermodel Free