test_parse_json_string_skip_returns_input_on_failure() — langchain Function Reference
Architecture documentation for the test_parse_json_string_skip_returns_input_on_failure() function in test_chat_models.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD ddc0ca84_7a50_26fd_01a8_06b4cdfa5601["test_parse_json_string_skip_returns_input_on_failure()"] 9c4a2438_9884_cbb0_3cf5_de8827531653["test_chat_models.py"] ddc0ca84_7a50_26fd_01a8_06b4cdfa5601 -->|defined in| 9c4a2438_9884_cbb0_3cf5_de8827531653 style ddc0ca84_7a50_26fd_01a8_06b4cdfa5601 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/partners/ollama/tests/unit_tests/test_chat_models.py lines 176–185
def test_parse_json_string_skip_returns_input_on_failure() -> None:
"""Tests that `skip=True` returns the original string on parse failure."""
malformed_string = "{'not': valid,,,}"
raw_tool_call = {"function": {"name": "test_func", "arguments": malformed_string}}
result = _parse_json_string(
malformed_string,
raw_tool_call=raw_tool_call,
skip=True, # We want the original invalid string back
)
assert result == malformed_string
Domain
Subdomains
Source
Frequently Asked Questions
What does test_parse_json_string_skip_returns_input_on_failure() do?
test_parse_json_string_skip_returns_input_on_failure() 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_skip_returns_input_on_failure() defined?
test_parse_json_string_skip_returns_input_on_failure() is defined in libs/partners/ollama/tests/unit_tests/test_chat_models.py at line 176.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free