Skip to content

Commit 79b2de8

Browse files
authored
feat: Ali Bailian supplier model list adds qwen3 model (#3026)
1 parent 0c7cca0 commit 79b2de8

File tree

4 files changed

+44
-1
lines changed

4 files changed

+44
-1
lines changed

apps/common/forms/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,4 @@
2222
from .radio_card_field import *
2323
from .label import *
2424
from .slider_field import *
25+
from .switch_field import *

apps/common/forms/switch_field.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@ def __init__(self, label: str or BaseLabel,
2828
@param props_info:
2929
"""
3030

31-
super().__init__('Switch', label, required, default_value, relation_show_field_dict,
31+
super().__init__('SwitchInput', label, required, default_value, relation_show_field_dict,
3232
{},
3333
TriggerType.OPTION_LIST, attrs, props_info)

apps/setting/models_provider/impl/aliyun_bai_lian_model_provider/aliyun_bai_lian_model_provider.py

+17
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,23 @@
5151
_("Universal text vector is Tongyi Lab's multi-language text unified vector model based on the LLM base. It provides high-level vector services for multiple mainstream languages around the world and helps developers quickly convert text data into high-quality vector data."),
5252
ModelTypeConst.EMBEDDING, aliyun_bai_lian_embedding_model_credential,
5353
AliyunBaiLianEmbedding),
54+
ModelInfo('qwen3-0.6b', '', ModelTypeConst.LLM, aliyun_bai_lian_llm_model_credential,
55+
BaiLianChatModel),
56+
ModelInfo('qwen3-1.7b', '', ModelTypeConst.LLM, aliyun_bai_lian_llm_model_credential,
57+
BaiLianChatModel),
58+
ModelInfo('qwen3-4b', '', ModelTypeConst.LLM, aliyun_bai_lian_llm_model_credential,
59+
BaiLianChatModel),
60+
ModelInfo('qwen3-8b', '', ModelTypeConst.LLM, aliyun_bai_lian_llm_model_credential,
61+
BaiLianChatModel),
62+
ModelInfo('qwen3-14b', '', ModelTypeConst.LLM, aliyun_bai_lian_llm_model_credential,
63+
BaiLianChatModel),
64+
ModelInfo('qwen3-32b', '', ModelTypeConst.LLM, aliyun_bai_lian_llm_model_credential,
65+
BaiLianChatModel),
66+
ModelInfo('qwen3-30b-a3b', '', ModelTypeConst.LLM, aliyun_bai_lian_llm_model_credential,
67+
BaiLianChatModel),
68+
ModelInfo('qwen3-235b-a22b', '', ModelTypeConst.LLM, aliyun_bai_lian_llm_model_credential,
69+
BaiLianChatModel),
70+
5471
ModelInfo('qwen-turbo', '', ModelTypeConst.LLM, aliyun_bai_lian_llm_model_credential,
5572
BaiLianChatModel),
5673
ModelInfo('qwen-plus', '', ModelTypeConst.LLM, aliyun_bai_lian_llm_model_credential,

apps/setting/models_provider/impl/aliyun_bai_lian_model_provider/credential/llm.py

+25
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,29 @@ class BaiLianLLMModelParams(BaseForm):
3030
precision=0)
3131

3232

33+
class BaiLianLLMStreamModelParams(BaseForm):
34+
temperature = forms.SliderField(TooltipLabel(_('Temperature'),
35+
_('Higher values make the output more random, while lower values make it more focused and deterministic')),
36+
required=True, default_value=0.7,
37+
_min=0.1,
38+
_max=1.0,
39+
_step=0.01,
40+
precision=2)
41+
42+
max_tokens = forms.SliderField(
43+
TooltipLabel(_('Output the maximum Tokens'),
44+
_('Specify the maximum number of tokens that the model can generate')),
45+
required=True, default_value=800,
46+
_min=1,
47+
_max=100000,
48+
_step=1,
49+
precision=0)
50+
51+
stream = forms.SwitchField(label=TooltipLabel(_('Is the answer in streaming mode'),
52+
_('Is the answer in streaming mode')),
53+
required=True, default_value=True)
54+
55+
3356
class BaiLianLLMModelCredential(BaseForm, BaseModelCredential):
3457

3558
def is_valid(self, model_type: str, model_name, model_credential: Dict[str, object], model_params, provider,
@@ -72,4 +95,6 @@ def encryption_dict(self, model: Dict[str, object]):
7295
api_key = forms.PasswordInputField('API Key', required=True)
7396

7497
def get_model_params_setting_form(self, model_name):
98+
if 'qwen3' in model_name:
99+
return BaiLianLLMStreamModelParams()
75100
return BaiLianLLMModelParams()

0 commit comments

Comments
 (0)