Skip to content

Commit cd28a7f

Browse files
committed
refactor: streamline image handling by updating application and knowledge ID management
1 parent 9c42965 commit cd28a7f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

apps/application/flow/step_node/document_split_node/impl/base_document_split_node.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,14 @@ def execute(self, document_list, knowledge_id, split_strategy, paragraph_title_r
5050
get_buffer = FileBufferHandle().get_buffer
5151

5252
for doc in file_list:
53-
file_mem = bytes_to_uploaded_file(doc['content'].encode('utf-8'), doc['name'])
53+
file_mem = bytes_to_uploaded_file(doc['content'].encode('utf-8'))
5454
result = default_split_handle.handle(file_mem, patterns, with_filter, limit, get_buffer, self._save_image)
5555
# 统一处理结果为列表
5656
results = result if isinstance(result, list) else [result]
5757

5858
for item in results:
5959
self._process_split_result(
60-
item, knowledge_id, doc['id'], doc['name'],
60+
item, knowledge_id, doc.get('id'), doc.get('name'),
6161
split_strategy, paragraph_title_relate_problem_type,
6262
paragraph_title_relate_problem, paragraph_title_relate_problem_reference,
6363
document_name_relate_problem_type, document_name_relate_problem,
@@ -83,8 +83,10 @@ def _process_split_result(
8383
"""处理文档分割结果"""
8484
item['meta'] = {
8585
'knowledge_id': knowledge_id,
86-
'source_file_id': source_file_id
86+
'source_file_id': source_file_id,
87+
'source_url': file_name,
8788
}
89+
item['name'] = file_name
8890
item['paragraphs'] = item.pop('content', [])
8991

9092
for paragraph in item['paragraphs']:

0 commit comments

Comments
 (0)