Home / Function/ test_all_none_parameters_results_in_empty_options() — langchain Function Reference

test_all_none_parameters_results_in_empty_options() — langchain Function Reference

Architecture documentation for the test_all_none_parameters_results_in_empty_options() function in test_chat_models.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  30ef36d3_995b_a7de_3eb6_0402e66ea934["test_all_none_parameters_results_in_empty_options()"]
  9c4a2438_9884_cbb0_3cf5_de8827531653["test_chat_models.py"]
  30ef36d3_995b_a7de_3eb6_0402e66ea934 -->|defined in| 9c4a2438_9884_cbb0_3cf5_de8827531653
  style 30ef36d3_995b_a7de_3eb6_0402e66ea934 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/partners/ollama/tests/unit_tests/test_chat_models.py lines 354–380

def test_all_none_parameters_results_in_empty_options() -> None:
    """Test that when all parameters are None, options dict is empty."""
    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

        # Create ChatOllama with no parameters set
        llm = ChatOllama(model="test-model")
        llm.invoke([HumanMessage("Hello")])

        # Get the options dict that was passed to chat
        call_kwargs = mock_client.chat.call_args[1]
        options = call_kwargs.get("options", {})

        # Options should be empty when no parameters are set
        assert options == {}

Domain

Subdomains

Frequently Asked Questions

What does test_all_none_parameters_results_in_empty_options() do?
test_all_none_parameters_results_in_empty_options() is a function in the langchain codebase, defined in libs/partners/ollama/tests/unit_tests/test_chat_models.py.
Where is test_all_none_parameters_results_in_empty_options() defined?
test_all_none_parameters_results_in_empty_options() is defined in libs/partners/ollama/tests/unit_tests/test_chat_models.py at line 354.

Analyze Your Own Codebase

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

Try Supermodel Free