From 4086f5051c1ae0112d421e0af1bef6c691a00020 Mon Sep 17 00:00:00 2001 From: Ever <439674061@qq.com> Date: Mon, 20 May 2024 10:15:27 +0800 Subject: [PATCH] =?UTF-8?q?feat:Provide=20parameter=20config=20for=20mask?= =?UTF-8?q?=5Fsensitive=5Finfo=20of=20MiniMax=20mode=E2=80=A6=20(#4294)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: 老潮 Co-authored-by: takatost Co-authored-by: takatost --- .../model_providers/minimax/llm/abab5-chat.yaml | 9 +++++++++ .../model_providers/minimax/llm/abab5.5-chat.yaml | 9 +++++++++ .../model_providers/minimax/llm/abab5.5s-chat.yaml | 9 +++++++++ .../model_providers/minimax/llm/abab6-chat.yaml | 9 +++++++++ .../model_providers/minimax/llm/abab6.5-chat.yaml | 9 +++++++++ .../model_providers/minimax/llm/abab6.5s-chat.yaml | 9 +++++++++ .../model_providers/minimax/llm/chat_completion_pro.py | 3 +++ 7 files changed, 57 insertions(+) diff --git a/api/core/model_runtime/model_providers/minimax/llm/abab5-chat.yaml b/api/core/model_runtime/model_providers/minimax/llm/abab5-chat.yaml index e0d81e76cc..2c1f79e2b7 100644 --- a/api/core/model_runtime/model_providers/minimax/llm/abab5-chat.yaml +++ b/api/core/model_runtime/model_providers/minimax/llm/abab5-chat.yaml @@ -18,6 +18,15 @@ parameter_rules: default: 6144 min: 1 max: 6144 + - name: mask_sensitive_info + type: boolean + default: true + label: + zh_Hans: 隐私保护 + en_US: Moderate + help: + zh_Hans: 对输出中易涉及隐私问题的文本信息进行打码,目前包括但不限于邮箱、域名、链接、证件号、家庭住址等,默认true,即开启打码 + en_US: Mask the sensitive info of the generated content, such as email/domain/link/address/phone/id.. - name: presence_penalty use_template: presence_penalty - name: frequency_penalty diff --git a/api/core/model_runtime/model_providers/minimax/llm/abab5.5-chat.yaml b/api/core/model_runtime/model_providers/minimax/llm/abab5.5-chat.yaml index c0ad1e2fdf..6d29be0d0e 100644 --- a/api/core/model_runtime/model_providers/minimax/llm/abab5.5-chat.yaml +++ b/api/core/model_runtime/model_providers/minimax/llm/abab5.5-chat.yaml @@ -26,6 +26,15 @@ parameter_rules: default: 6144 min: 1 max: 16384 + - name: mask_sensitive_info + type: boolean + default: true + label: + zh_Hans: 隐私保护 + en_US: Moderate + help: + zh_Hans: 对输出中易涉及隐私问题的文本信息进行打码,目前包括但不限于邮箱、域名、链接、证件号、家庭住址等,默认true,即开启打码 + en_US: Mask the sensitive info of the generated content, such as email/domain/link/address/phone/id.. - name: presence_penalty use_template: presence_penalty - name: frequency_penalty diff --git a/api/core/model_runtime/model_providers/minimax/llm/abab5.5s-chat.yaml b/api/core/model_runtime/model_providers/minimax/llm/abab5.5s-chat.yaml index 1ef7046459..aa42bb5739 100644 --- a/api/core/model_runtime/model_providers/minimax/llm/abab5.5s-chat.yaml +++ b/api/core/model_runtime/model_providers/minimax/llm/abab5.5s-chat.yaml @@ -24,6 +24,15 @@ parameter_rules: default: 3072 min: 1 max: 8192 + - name: mask_sensitive_info + type: boolean + default: true + label: + zh_Hans: 隐私保护 + en_US: Moderate + help: + zh_Hans: 对输出中易涉及隐私问题的文本信息进行打码,目前包括但不限于邮箱、域名、链接、证件号、家庭住址等,默认true,即开启打码 + en_US: Mask the sensitive info of the generated content, such as email/domain/link/address/phone/id.. - name: presence_penalty use_template: presence_penalty - name: frequency_penalty diff --git a/api/core/model_runtime/model_providers/minimax/llm/abab6-chat.yaml b/api/core/model_runtime/model_providers/minimax/llm/abab6-chat.yaml index 4c487c598e..9188b6b53f 100644 --- a/api/core/model_runtime/model_providers/minimax/llm/abab6-chat.yaml +++ b/api/core/model_runtime/model_providers/minimax/llm/abab6-chat.yaml @@ -26,6 +26,15 @@ parameter_rules: default: 2048 min: 1 max: 32768 + - name: mask_sensitive_info + type: boolean + default: true + label: + zh_Hans: 隐私保护 + en_US: Moderate + help: + zh_Hans: 对输出中易涉及隐私问题的文本信息进行打码,目前包括但不限于邮箱、域名、链接、证件号、家庭住址等,默认true,即开启打码 + en_US: Mask the sensitive info of the generated content, such as email/domain/link/address/phone/id.. - name: presence_penalty use_template: presence_penalty - name: frequency_penalty diff --git a/api/core/model_runtime/model_providers/minimax/llm/abab6.5-chat.yaml b/api/core/model_runtime/model_providers/minimax/llm/abab6.5-chat.yaml index ead61fb7ca..5d717d5f8c 100644 --- a/api/core/model_runtime/model_providers/minimax/llm/abab6.5-chat.yaml +++ b/api/core/model_runtime/model_providers/minimax/llm/abab6.5-chat.yaml @@ -26,6 +26,15 @@ parameter_rules: default: 2048 min: 1 max: 8192 + - name: mask_sensitive_info + type: boolean + default: true + label: + zh_Hans: 隐私保护 + en_US: Moderate + help: + zh_Hans: 对输出中易涉及隐私问题的文本信息进行打码,目前包括但不限于邮箱、域名、链接、证件号、家庭住址等,默认true,即开启打码 + en_US: Mask the sensitive info of the generated content, such as email/domain/link/address/phone/id.. - name: presence_penalty use_template: presence_penalty - name: frequency_penalty diff --git a/api/core/model_runtime/model_providers/minimax/llm/abab6.5s-chat.yaml b/api/core/model_runtime/model_providers/minimax/llm/abab6.5s-chat.yaml index 2cd98abb22..4631fe67e4 100644 --- a/api/core/model_runtime/model_providers/minimax/llm/abab6.5s-chat.yaml +++ b/api/core/model_runtime/model_providers/minimax/llm/abab6.5s-chat.yaml @@ -26,6 +26,15 @@ parameter_rules: default: 2048 min: 1 max: 245760 + - name: mask_sensitive_info + type: boolean + default: true + label: + zh_Hans: 隐私保护 + en_US: Moderate + help: + zh_Hans: 对输出中易涉及隐私问题的文本信息进行打码,目前包括但不限于邮箱、域名、链接、证件号、家庭住址等,默认true,即开启打码 + en_US: Mask the sensitive info of the generated content, such as email/domain/link/address/phone/id.. - name: presence_penalty use_template: presence_penalty - name: frequency_penalty diff --git a/api/core/model_runtime/model_providers/minimax/llm/chat_completion_pro.py b/api/core/model_runtime/model_providers/minimax/llm/chat_completion_pro.py index c7cf997464..55747057c9 100644 --- a/api/core/model_runtime/model_providers/minimax/llm/chat_completion_pro.py +++ b/api/core/model_runtime/model_providers/minimax/llm/chat_completion_pro.py @@ -43,6 +43,9 @@ class MinimaxChatCompletionPro: if 'top_p' in model_parameters and type(model_parameters['top_p']) == float: extra_kwargs['top_p'] = model_parameters['top_p'] + if 'mask_sensitive_info' in model_parameters and type(model_parameters['mask_sensitive_info']) == bool: + extra_kwargs['mask_sensitive_info'] = model_parameters['mask_sensitive_info'] + if model_parameters.get('plugin_web_search'): extra_kwargs['plugins'] = [ 'plugin_web_search'