feat: Support Alibaba Bailian supplier qwen3 model (#3020)

This commit is contained in:
shaohuzhang1 2025-04-29 14:57:41 +08:00 committed by GitHub
parent 704077d066
commit a6533c0db7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -47,7 +47,11 @@ class BaiLianLLMModelCredential(BaseForm, BaseModelCredential):
return False
try:
model = provider.get_model(model_type, model_name, model_credential, **model_params)
model.invoke([HumanMessage(content=gettext('Hello'))])
if model_params.get('stream'):
for res in model.stream([HumanMessage(content=gettext('Hello'))]):
pass
else:
model.invoke([HumanMessage(content=gettext('Hello'))])
except Exception as e:
traceback.print_exc()
if isinstance(e, AppApiException):