From fbf91ee9161e1a8af83f36269cbde1356c1ceaa5 Mon Sep 17 00:00:00 2001 From: Carson Date: Wed, 4 Dec 2024 10:28:34 -0600 Subject: [PATCH] Fix type error in test introduced by ollama 0.4.2 --- tests/pytest/test_chat.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/pytest/test_chat.py b/tests/pytest/test_chat.py index 540b1cda7..35c32818b 100644 --- a/tests/pytest/test_chat.py +++ b/tests/pytest/test_chat.py @@ -476,7 +476,11 @@ def test_as_ollama_message(): import ollama from ollama import Message as OllamaMessage - assert "ollama._types.Message" in str(ollama.chat.__annotations__["messages"]) + # ollama 0.4.2 added Callable to the type hints, but pyright complains about + # missing arguments to the Callable type. We'll ignore this for now. + chat = ollama.chat # type: ignore + + assert "ollama._types.Message" in str(chat.__annotations__["messages"]) from shiny.ui._chat_provider_types import as_ollama_message