fix: 处理校验图片模型的报错
This commit is contained in:
parent
b91d9fdaf0
commit
4fd6884ad6
@ -29,7 +29,9 @@ class OpenAIImageModelCredential(BaseForm, BaseModelCredential):
|
|||||||
return False
|
return False
|
||||||
try:
|
try:
|
||||||
model = provider.get_model(model_type, model_name, model_credential)
|
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:
|
except Exception as e:
|
||||||
if isinstance(e, AppApiException):
|
if isinstance(e, AppApiException):
|
||||||
raise e
|
raise e
|
||||||
|
|||||||
@ -50,7 +50,9 @@ class QwenVLModelCredential(BaseForm, BaseModelCredential):
|
|||||||
return False
|
return False
|
||||||
try:
|
try:
|
||||||
model = provider.get_model(model_type, model_name, model_credential)
|
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:
|
except Exception as e:
|
||||||
if isinstance(e, AppApiException):
|
if isinstance(e, AppApiException):
|
||||||
raise e
|
raise e
|
||||||
|
|||||||
@ -50,7 +50,9 @@ class TencentVisionModelCredential(BaseForm, BaseModelCredential):
|
|||||||
return False
|
return False
|
||||||
try:
|
try:
|
||||||
model = provider.get_model(model_type, model_name, model_credential)
|
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:
|
except Exception as e:
|
||||||
if isinstance(e, AppApiException):
|
if isinstance(e, AppApiException):
|
||||||
raise e
|
raise e
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user