From 041cf09011637e970a57eedb111fa1fb86a5e9ef Mon Sep 17 00:00:00 2001 From: shaohuzhang1 <80892890+shaohuzhang1@users.noreply.github.com> Date: Mon, 10 Feb 2025 11:08:36 +0800 Subject: [PATCH] fix: The Chinese characters in the form data have been transcoded (#2192) --- .../flow/step_node/form_node/impl/base_form_node.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/application/flow/step_node/form_node/impl/base_form_node.py b/apps/application/flow/step_node/form_node/impl/base_form_node.py index 3aeca8560..7cbbe9cc1 100644 --- a/apps/application/flow/step_node/form_node/impl/base_form_node.py +++ b/apps/application/flow/step_node/form_node/impl/base_form_node.py @@ -54,7 +54,7 @@ class BaseFormNode(IFormNode): form_setting = {"form_field_list": form_field_list, "runtime_node_id": self.runtime_node_id, "chat_record_id": self.flow_params_serializer.data.get("chat_record_id"), "is_submit": self.context.get("is_submit", False)} - form = f'{json.dumps(form_setting)}' + form = f'{json.dumps(form_setting, ensure_ascii=False)}' context = self.workflow_manage.get_workflow_content() form_content_format = self.workflow_manage.reset_prompt(form_content_format) prompt_template = PromptTemplate.from_template(form_content_format, template_format='jinja2') @@ -70,7 +70,7 @@ class BaseFormNode(IFormNode): "chat_record_id": self.flow_params_serializer.data.get("chat_record_id"), 'form_data': self.context.get('form_data', {}), "is_submit": self.context.get("is_submit", False)} - form = f'{json.dumps(form_setting)}' + form = f'{json.dumps(form_setting,ensure_ascii=False)}' context = self.workflow_manage.get_workflow_content() form_content_format = self.workflow_manage.reset_prompt(form_content_format) prompt_template = PromptTemplate.from_template(form_content_format, template_format='jinja2') @@ -85,7 +85,7 @@ class BaseFormNode(IFormNode): "chat_record_id": self.flow_params_serializer.data.get("chat_record_id"), 'form_data': self.context.get('form_data', {}), "is_submit": self.context.get("is_submit", False)} - form = f'{json.dumps(form_setting)}' + form = f'{json.dumps(form_setting,ensure_ascii=False)}' context = self.workflow_manage.get_workflow_content() form_content_format = self.workflow_manage.reset_prompt(form_content_format) prompt_template = PromptTemplate.from_template(form_content_format, template_format='jinja2')