mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 01:33:05 +00:00
fix: 处理校验图片模型的报错
This commit is contained in:
parent
b91d9fdaf0
commit
4fd6884ad6
|
|
@ -29,7 +29,9 @@ class OpenAIImageModelCredential(BaseForm, BaseModelCredential):
|
|||
return False
|
||||
try:
|
||||
model = provider.get_model(model_type, model_name, model_credential)
|
||||
model.stream([HumanMessage(content=[{"type": "text", "text": "你好"}])])
|
||||
res = model.stream([HumanMessage(content=[{"type": "text", "text": "你好"}])])
|
||||
for chunk in res:
|
||||
print(chunk)
|
||||
except Exception as e:
|
||||
if isinstance(e, AppApiException):
|
||||
raise e
|
||||
|
|
|
|||
|
|
@ -50,7 +50,9 @@ class QwenVLModelCredential(BaseForm, BaseModelCredential):
|
|||
return False
|
||||
try:
|
||||
model = provider.get_model(model_type, model_name, model_credential)
|
||||
model.stream([HumanMessage(content=[{"type": "text", "text": "你好"}])])
|
||||
res = model.stream([HumanMessage(content=[{"type": "text", "text": "你好"}])])
|
||||
for chunk in res:
|
||||
print(chunk)
|
||||
except Exception as e:
|
||||
if isinstance(e, AppApiException):
|
||||
raise e
|
||||
|
|
|
|||
|
|
@ -50,7 +50,9 @@ class TencentVisionModelCredential(BaseForm, BaseModelCredential):
|
|||
return False
|
||||
try:
|
||||
model = provider.get_model(model_type, model_name, model_credential)
|
||||
model.stream([HumanMessage(content=[{"type": "text", "text": "你好"}])])
|
||||
res = model.stream([HumanMessage(content=[{"type": "text", "text": "你好"}])])
|
||||
for chunk in res:
|
||||
print(chunk)
|
||||
except Exception as e:
|
||||
if isinstance(e, AppApiException):
|
||||
raise e
|
||||
|
|
|
|||
Loading…
Reference in New Issue