Skip to content

DeepTutor: Lifelong Personalized Tutoring. https://deeptutor.info/.

fix(llm): match zhipu/GLM multimodal rejection so text-only retry fires

yinuoba4119693cc50a
diff --git a/deeptutor/services/llm/request_compat.py b/deeptutor/services/llm/request_compat.py
index f324fbcb1..e0b7f3300 100644
--- a/deeptutor/services/llm/request_compat.py
+++ b/deeptutor/services/llm/request_compat.py
@@ -196,6 +196,11 @@ def is_image_input_unsupported(exc: Exception) -> bool:
"expected a string",
"expected string",
"invalid type for 'messages",
+ # Zhipu/GLM rejects multimodal blocks with a Chinese message whose
+ # path is dotted ("messages.content.type ... 参数非法,取值范围 ['text']"),
+ # which none of the English markers above match.
+ "content.type",
+ "取值范围",
)
)