From f5155e7f7eb7a4cdcee97520c3d1301932b7b0ae Mon Sep 17 00:00:00 2001 From: Harry <56063441+forcemeter@users.noreply.github.com> Date: Fri, 21 Feb 2025 10:12:41 +0800 Subject: [PATCH] fix: bad code copy (#2341) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: 杨树海 --- .../step/search_dataset_step/i_search_dataset_step.py | 2 +- .../step_node/search_dataset_node/i_search_dataset_node.py | 2 +- apps/application/serializers/application_serializers.py | 4 ++-- apps/dataset/serializers/dataset_serializers.py | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/application/chat_pipeline/step/search_dataset_step/i_search_dataset_step.py b/apps/application/chat_pipeline/step/search_dataset_step/i_search_dataset_step.py index 4213a3c5e..7b222cbc2 100644 --- a/apps/application/chat_pipeline/step/search_dataset_step/i_search_dataset_step.py +++ b/apps/application/chat_pipeline/step/search_dataset_step/i_search_dataset_step.py @@ -43,7 +43,7 @@ class ISearchDatasetStep(IBaseChatPipelineStep): error_messages=ErrMessage.float(_("Similarity"))) search_mode = serializers.CharField(required=True, validators=[ validators.RegexValidator(regex=re.compile("^embedding|keywords|blend$"), - message=_("The type only supports register|reset_password"), code=500) + message=_("The type only supports embedding|keywords|blend"), code=500) ], error_messages=ErrMessage.char(_("Retrieval Mode"))) user_id = serializers.UUIDField(required=True, error_messages=ErrMessage.uuid(_("User ID"))) diff --git a/apps/application/flow/step_node/search_dataset_node/i_search_dataset_node.py b/apps/application/flow/step_node/search_dataset_node/i_search_dataset_node.py index ee7f2cf93..07eadf1da 100644 --- a/apps/application/flow/step_node/search_dataset_node/i_search_dataset_node.py +++ b/apps/application/flow/step_node/search_dataset_node/i_search_dataset_node.py @@ -27,7 +27,7 @@ class DatasetSettingSerializer(serializers.Serializer): error_messages=ErrMessage.float(_('similarity'))) search_mode = serializers.CharField(required=True, validators=[ validators.RegexValidator(regex=re.compile("^embedding|keywords|blend$"), - message=_("The type only supports register|reset_password"), code=500) + message=_("The type only supports embedding|keywords|blend"), code=500) ], error_messages=ErrMessage.char(_("Retrieval Mode"))) max_paragraph_char_number = serializers.IntegerField(required=True, error_messages=ErrMessage.float(_("Maximum number of words in a quoted segment"))) diff --git a/apps/application/serializers/application_serializers.py b/apps/application/serializers/application_serializers.py index 6eb2ea525..bba31a33e 100644 --- a/apps/application/serializers/application_serializers.py +++ b/apps/application/serializers/application_serializers.py @@ -126,7 +126,7 @@ class DatasetSettingSerializer(serializers.Serializer): _("Maximum number of quoted characters"))) search_mode = serializers.CharField(required=True, validators=[ validators.RegexValidator(regex=re.compile("^embedding|keywords|blend$"), - message=_("The type only supports register|reset_password"), code=500) + message=_("The type only supports embedding|keywords|blend"), code=500) ], error_messages=ErrMessage.char(_("Retrieval Mode"))) no_references_setting = NoReferencesSetting(required=True, @@ -585,7 +585,7 @@ class ApplicationSerializer(serializers.Serializer): error_messages=ErrMessage.float(_("Relevance"))) search_mode = serializers.CharField(required=True, validators=[ validators.RegexValidator(regex=re.compile("^embedding|keywords|blend$"), - message=_("The type only supports register|reset_password"), code=500) + message=_("The type only supports embedding|keywords|blend"), code=500) ], error_messages=ErrMessage.char(_("Retrieval Mode"))) def is_valid(self, *, raise_exception=False): diff --git a/apps/dataset/serializers/dataset_serializers.py b/apps/dataset/serializers/dataset_serializers.py index 3f51915ad..47f321bb5 100644 --- a/apps/dataset/serializers/dataset_serializers.py +++ b/apps/dataset/serializers/dataset_serializers.py @@ -573,7 +573,7 @@ class DataSetSerializers(serializers.ModelSerializer): error_messages=ErrMessage.char(_('similarity'))) search_mode = serializers.CharField(required=True, validators=[ validators.RegexValidator(regex=re.compile("^embedding|keywords|blend$"), - message=_('The type only supports register|reset_password'), code=500) + message=_('The type only supports embedding|keywords|blend'), code=500) ], error_messages=ErrMessage.char(_('search mode'))) def is_valid(self, *, raise_exception=True):