From ac5940438938d331d75dc5f4532f81ba655b09d8 Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Sun, 20 Sep 2026 21:06:07 -0700 Subject: [PATCH] Sure, cover ollama too --- src/paperless_ai/tests/test_client.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/paperless_ai/tests/test_client.py b/src/paperless_ai/tests/test_client.py index 94ed13d93..96cc1b1f7 100644 --- a/src/paperless_ai/tests/test_client.py +++ b/src/paperless_ai/tests/test_client.py @@ -199,7 +199,7 @@ def test_run_llm_query_openai_uses_tools(mock_ai_config, mock_openai_llm): ) -def test_get_llm_passes_extra_params(mock_ai_config, mock_openai_llm): +def test_get_llm_passes_extra_params(mock_ai_config, mock_openai_llm, mock_ollama_llm): """ GIVEN: - Extra LLM params configured, e.g. for a provider that needs a @@ -220,6 +220,18 @@ def test_get_llm_passes_extra_params(mock_ai_config, mock_openai_llm): "reasoning_effort": "none", } + # ollama + mock_ai_config.llm_backend = "ollama" + mock_ai_config.llm_model = "test_model" + mock_ai_config.llm_endpoint = "http://test-url" + mock_ai_config.llm_extra_params = {"reasoning_effort": "none"} + + AIClient() + + assert mock_ollama_llm.call_args.kwargs["additional_kwargs"] == { + "reasoning_effort": "none", + } + def test_run_llm_query_openai_timeout_raises_local_error( mock_ai_config,