test_parse_json_string_failure_case_raises_exception() — langchain Function Reference
Architecture documentation for the test_parse_json_string_failure_case_raises_exception() function in test_chat_models.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 1efb99a4_9d0e_33ca_c368_e9a3346c7352["test_parse_json_string_failure_case_raises_exception()"] 9c4a2438_9884_cbb0_3cf5_de8827531653["test_chat_models.py"] 1efb99a4_9d0e_33ca_c368_e9a3346c7352 -->|defined in| 9c4a2438_9884_cbb0_3cf5_de8827531653 style 1efb99a4_9d0e_33ca_c368_e9a3346c7352 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/partners/ollama/tests/unit_tests/test_chat_models.py lines 164–173
def test_parse_json_string_failure_case_raises_exception() -> None:
"""Tests that `_parse_json_string` raises an exception for malformed strings."""
malformed_string = "{'key': 'value',,}" # Double comma is invalid
raw_tool_call = {"function": {"name": "test_func", "arguments": malformed_string}}
with pytest.raises(OutputParserException):
_parse_json_string(
malformed_string,
raw_tool_call=raw_tool_call,
skip=False,
)
Domain
Subdomains
Source
Frequently Asked Questions
What does test_parse_json_string_failure_case_raises_exception() do?
test_parse_json_string_failure_case_raises_exception() is a function in the langchain codebase, defined in libs/partners/ollama/tests/unit_tests/test_chat_models.py.
Where is test_parse_json_string_failure_case_raises_exception() defined?
test_parse_json_string_failure_case_raises_exception() is defined in libs/partners/ollama/tests/unit_tests/test_chat_models.py at line 164.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free