test_chat_ollama_ignores_strict_arg() — langchain Function Reference
Architecture documentation for the test_chat_ollama_ignores_strict_arg() function in test_chat_models.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 3eb71e80_665e_e46e_4f39_c7cb7a581e35["test_chat_ollama_ignores_strict_arg()"] 9c4a2438_9884_cbb0_3cf5_de8827531653["test_chat_models.py"] 3eb71e80_665e_e46e_4f39_c7cb7a581e35 -->|defined in| 9c4a2438_9884_cbb0_3cf5_de8827531653 style 3eb71e80_665e_e46e_4f39_c7cb7a581e35 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/partners/ollama/tests/unit_tests/test_chat_models.py lines 452–475
def test_chat_ollama_ignores_strict_arg() -> None:
"""Test that ChatOllama ignores the 'strict' argument."""
response = [
{
"model": "test-model",
"created_at": "2025-01-01T00:00:00.000000000Z",
"done": True,
"done_reason": "stop",
"message": {"role": "assistant", "content": "Hello!"},
}
]
with patch("langchain_ollama.chat_models.Client") as mock_client_class:
mock_client = MagicMock()
mock_client_class.return_value = mock_client
mock_client.chat.return_value = response
llm = ChatOllama(model="test-model")
# Invoke with strict=True
llm.invoke([HumanMessage("Hello")], strict=True)
# Check that 'strict' was NOT passed to the client
call_kwargs = mock_client.chat.call_args[1]
assert "strict" not in call_kwargs
Domain
Subdomains
Source
Frequently Asked Questions
What does test_chat_ollama_ignores_strict_arg() do?
test_chat_ollama_ignores_strict_arg() is a function in the langchain codebase, defined in libs/partners/ollama/tests/unit_tests/test_chat_models.py.
Where is test_chat_ollama_ignores_strict_arg() defined?
test_chat_ollama_ignores_strict_arg() is defined in libs/partners/ollama/tests/unit_tests/test_chat_models.py at line 452.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free