Skip to content

Commit b26a435

Browse files
committed
Avoid using is_typeddict
1 parent 9efe068 commit b26a435

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

shiny/ui/_chat_normalize.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import sys
22
from abc import ABC, abstractmethod
3-
from typing import TYPE_CHECKING, Any, Optional, cast, is_typeddict
3+
from typing import TYPE_CHECKING, Any, Optional, cast
44

55
from htmltools import HTML
66

@@ -236,7 +236,7 @@ def can_normalize(self, message: Any) -> bool:
236236

237237
# Ollama<0.4 used TypedDict (now it uses pydantic)
238238
# https://github.com/ollama/ollama-python/pull/276
239-
if is_typeddict(ChatResponse):
239+
if isinstance(ChatResponse, dict):
240240
return "message" in message and super().can_normalize(
241241
message["message"]
242242
)

0 commit comments

Comments
 (0)