@@ -398,7 +398,7 @@ def test_ollama_normalization():
398398def test_as_anthropic_message ():
399399 from anthropic .resources .messages import AsyncMessages , Messages
400400 from anthropic .types import MessageParam
401- from shiny . ui ._chat_provider_types import as_anthropic_message
401+ from shinychat ._chat_provider_types import as_anthropic_message
402402
403403 # Make sure return type of llm.messages.create() hasn't changed
404404 assert (
@@ -416,7 +416,7 @@ def test_as_anthropic_message():
416416
417417
418418def test_as_google_message ():
419- from shiny . ui ._chat_provider_types import as_google_message
419+ from shinychat ._chat_provider_types import as_google_message
420420
421421 # Not available for Python 3.8
422422 if sys .version_info < (3 , 9 ):
@@ -460,7 +460,7 @@ def test_as_langchain_message():
460460 MessageLikeRepresentation ,
461461 SystemMessage ,
462462 )
463- from shiny . ui ._chat_provider_types import as_langchain_message
463+ from shinychat ._chat_provider_types import as_langchain_message
464464
465465 assert BaseChatModel .invoke .__annotations__ ["input" ] == "LanguageModelInput"
466466 assert BaseChatModel .stream .__annotations__ ["input" ] == "LanguageModelInput"
@@ -491,7 +491,7 @@ def test_as_openai_message():
491491 ChatCompletionSystemMessageParam ,
492492 ChatCompletionUserMessageParam ,
493493 )
494- from shiny . ui ._chat_provider_types import as_openai_message
494+ from shinychat ._chat_provider_types import as_openai_message
495495
496496 assert (
497497 Completions .create .__annotations__ ["messages" ]
@@ -523,14 +523,11 @@ def test_as_ollama_message():
523523 import ollama
524524 from ollama import Message as OllamaMessage
525525
526- # ollama 0.4.2 added Callable to the type hints, but pyright complains about
527- # missing arguments to the Callable type. We'll ignore this for now.
528- # https://github.com/ollama/ollama-python/commit/b50a65b
529- chat = ollama .chat # type: ignore
530-
531- assert "ollama._types.Message" in str (chat .__annotations__ ["messages" ])
526+ assert "ollama._types.Message" in str (
527+ ollama .chat .__annotations__ ["messages" ]
528+ )
532529
533- from shiny . ui ._chat_provider_types import as_ollama_message
530+ from shinychat ._chat_provider_types import as_ollama_message
534531
535532 msg = ChatMessageDict (content = "I have a question" , role = "user" )
536533 assert as_ollama_message (msg ) == OllamaMessage (
0 commit comments