Skip to content

Commit fbbdb70

Browse files
撤回对正则的修正。
1 parent ad2aff2 commit fbbdb70

8 files changed

Lines changed: 10 additions & 10 deletions

File tree

apps/application/flow/step_node/ai_chat_step_node/impl/base_chat_node.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ def get_history_message(history_chat_record, dialogue_number, dialogue_type, run
471471
range(start_index if start_index > 0 else 0, len(history_chat_record))], [])
472472
for message in history_message:
473473
if isinstance(message.content, str):
474-
message.content = re.sub(r'<form_rander>[\d\D]*?<\/form_rander>', '', message.content)
474+
message.content = re.sub('<form_rander>[\d\D]*?<\/form_rander>', '', message.content)
475475
return history_message
476476

477477
def generate_prompt_question(self, prompt):

apps/application/flow/step_node/application_node/impl/base_application_node.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ def reset_application_node_dict(application_node_dict, runtime_node_id, node_dat
130130
application_node = application_node_dict[key]
131131
if application_node.get('runtime_node_id') == runtime_node_id:
132132
content: str = application_node.get('content')
133-
match = re.search(r'<form_rander>.*?</form_rander>', content)
133+
match = re.search('<form_rander>.*?</form_rander>', content)
134134
if match:
135135
form_setting_str = match.group().replace('<form_rander>', '').replace('</form_rander>', '')
136136
form_setting = json.loads(form_setting_str)

apps/application/flow/step_node/intent_node/impl/base_intent_node.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def get_history_message(history_chat_record, dialogue_number):
131131

132132
for message in history_message:
133133
if isinstance(message.content, str):
134-
message.content = re.sub(r'<form_rander>[\d\D]*?<\/form_rander>', '', message.content)
134+
message.content = re.sub('<form_rander>[\d\D]*?<\/form_rander>', '', message.content)
135135
return history_message
136136

137137
def build_system_prompt(self) -> str:

apps/application/flow/step_node/question_node/impl/base_question_node.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ def get_history_message(history_chat_record, dialogue_number):
128128
range(start_index if start_index > 0 else 0, len(history_chat_record))], [])
129129
for message in history_message:
130130
if isinstance(message.content, str):
131-
message.content = re.sub(r'<form_rander>[\d\D]*?<\/form_rander>', '', message.content)
131+
message.content = re.sub('<form_rander>[\d\D]*?<\/form_rander>', '', message.content)
132132
return history_message
133133

134134
def generate_prompt_question(self, prompt):

apps/common/handle/impl/qa/zip_parse_qa_handle.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def get_image_list(result_list: list, zip_files: List[str]):
8282
content: str = p.get('content', '')
8383
image_list = parse_md_image(content)
8484
for image in image_list:
85-
search = re.search(r"\(.*\)", image)
85+
search = re.search("\(.*\)", image)
8686
if search:
8787
new_image_id = str(uuid.uuid7())
8888
source_image_path = search.group().replace('(', '').replace(')', '')

apps/common/handle/impl/text/zip_split_handle.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def get_image_list(result_list: list, zip_files: List[str]):
7373
content: str = p.get('content', '')
7474
image_list = parse_md_image(content)
7575
for image in image_list:
76-
search = re.search(r"\(.*\)", image)
76+
search = re.search("\(.*\)", image)
7777
if search:
7878
new_image_id = str(uuid.uuid7())
7979
source_image_path = search.group().replace('(', '').replace(')', '')
@@ -105,7 +105,7 @@ def get_image_list_by_content(name: str, content: str, zip_files: List[str]):
105105
image_file_list = []
106106
image_list = parse_md_image(content)
107107
for image in image_list:
108-
search = re.search(r"\(.*\)", image)
108+
search = re.search("\(.*\)", image)
109109
if search:
110110
new_image_id = str(uuid.uuid7())
111111
source_image_path = search.group().replace('(', '').replace(')', '')

apps/common/utils/common.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ def run(*args, **kwargs):
272272

273273

274274
def parse_md_image(content: str):
275-
matches = re.finditer(r"!\[.*?\]\(.*?\)", content)
275+
matches = re.finditer("!\[.*?\]\(.*?\)", content)
276276
image_list = [match.group() for match in matches]
277277
return image_list
278278

@@ -330,7 +330,7 @@ def flat_map(array: List[List]):
330330

331331

332332
def parse_image(content: str):
333-
matches = re.finditer(r"!\[.*?\]\(\.\/oss\/(image|file)\/.*?\)", content)
333+
matches = re.finditer("!\[.*?\]\(\.\/oss\/(image|file)\/.*?\)", content)
334334
image_list = [match.group() for match in matches]
335335
return image_list
336336

apps/knowledge/serializers/common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ def is_valid_uuid(s):
179179

180180
def write_image(zip_path: str, image_list: List[str]):
181181
for image in image_list:
182-
search = re.search(r"\(.*\)", image)
182+
search = re.search("\(.*\)", image)
183183
if search:
184184
text = search.group()
185185
if text.startswith('(./oss/file/'):

0 commit comments

Comments
 (0)