Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.
Python agentagentic-aiagentic-frameworkagentic-workflowaiautomationclaudedeepseekgenaigptllmlow-codemcpnextjsno-codeopenaipythonskillsworkflow
add Qwen custom add model interface (#8565)
AAEE861a8dcae10e4e
diff --git a/api/core/model_runtime/model_providers/tongyi/llm/llm.py b/api/core/model_runtime/model_providers/tongyi/llm/llm.pyindex 1d4eba6668c..f90c7f075fe 100644--- a/api/core/model_runtime/model_providers/tongyi/llm/llm.py+++ b/api/core/model_runtime/model_providers/tongyi/llm/llm.py@@ -30,7 +30,15 @@ from core.model_runtime.entities.message_entities import (ToolPromptMessage,UserPromptMessage,)-from core.model_runtime.entities.model_entities import ModelFeature+from core.model_runtime.entities.model_entities import (+ AIModelEntity,+ FetchFrom,+ I18nObject,+ ModelFeature,+ ModelType,+ ParameterRule,+ ParameterType,+)from core.model_runtime.errors.invoke import (InvokeAuthorizationError,InvokeBadRequestError,@@ -520,3 +528,64 @@ class TongyiLargeLanguageModel(LargeLanguageModel):UnsupportedHTTPMethod,],}++ def get_customizable_model_schema(self, model: str, credentials: dict) -> AIModelEntity | None:+ """+ Architecture for defining customizable models++ :param model: model name+ :param credentials: model credentials+ :return: AIModelEntity or None+ """+ rules = [+ ParameterRule(+ name="temperature",+ type=ParameterType.FLOAT,+ use_template="temperature",+ label=I18nObject(zh_Hans="温度", en_US="Temperature"),+ ),+ ParameterRule(+ name="top_p",+ type=ParameterType.FLOAT,+ use_template="top_p",+ label=I18nObject(zh_Hans="Top P", en_US="Top P"),+ ),+ ParameterRule(+ name="top_k",+ type=ParameterType.INT,+ min=0,+ max=99,+ label=I18nObject(zh_Hans="top_k", en_US="top_k"),+ ),+ ParameterRule(+ name="max_tokens",+ type=ParameterType.INT,+ min=1,+ max=128000,+ default=1024,+ label=I18nObject(zh_Hans="最大生成长度", en_US="Max Tokens"),+ ),+ ParameterRule(+ name="seed",+ type=ParameterType.INT,+ default=1234,+ label=I18nObject(zh_Hans="随机种子", en_US="Random Seed"),+ ),+ ParameterRule(+ name="repetition_penalty",+ type=ParameterType.FLOAT,+ default=1.1,+ label=I18nObject(zh_Hans="重复惩罚", en_US="Repetition Penalty"),+ ),+ ]++ entity = AIModelEntity(+ model=model,+ label=I18nObject(en_US=model),+ fetch_from=FetchFrom.CUSTOMIZABLE_MODEL,+ model_type=ModelType.LLM,+ model_properties={},+ parameter_rules=rules,+ )++ return entitydiff --git a/api/core/model_runtime/model_providers/tongyi/tongyi.yaml b/api/core/model_runtime/model_providers/tongyi/tongyi.yamlindex de2c289c947..fabe6d90e6b 100644--- a/api/core/model_runtime/model_providers/tongyi/tongyi.yaml+++ b/api/core/model_runtime/model_providers/tongyi/tongyi.yaml@@ -20,6 +20,7 @@ supported_model_types:- text-embeddingconfigurate_methods:- predefined-model+ - customizable-modelprovider_credential_schema:credential_form_schemas:- variable: dashscope_api_key@@ -30,3 +31,20 @@ provider_credential_schema:placeholder:zh_Hans: 在此输入您的 API Keyen_US: Enter your API Key+model_credential_schema:+ model:+ label:+ en_US: Model Name+ zh_Hans: 模型名称+ placeholder:+ en_US: Enter full model name+ zh_Hans: 输入模型全称+ credential_form_schemas:+ - variable: dashscope_api_key+ required: true+ label:+ en_US: API Key+ type: secret-input+ placeholder:+ zh_Hans: 在此输入您的 API Key+ en_US: Enter your API Key