Skip to content

feat: 去除工作流直接返回内容的标题数据 #1575

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def execute(self, dataset_id_list, dataset_setting, question,
[f"{reset_title(paragraph.get('title', ''))}{paragraph.get('content')}" for paragraph in
paragraph_list])[0:dataset_setting.get('max_paragraph_char_number', 5000)],
'directly_return': '\n'.join(
[f"{reset_title(paragraph.get('title', ''))}{paragraph.get('content')}" for paragraph in
[paragraph.get('content') for paragraph in
result if
paragraph.get('is_hit_handling_method')]),
'question': question},

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

没有发现明显的问题或异常,在现有的情况下是正确的。如果您有任何其他特殊要求或特定问题,请告诉我,以便我为您提供更详细和针对性的反馈。

Expand Down
2 changes: 1 addition & 1 deletion apps/application/flow/workflow_manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,11 +304,11 @@ def await_result(self, result):
if chunk is None:
break
yield chunk
yield self.get_chunk_content('', True)
finally:
self.work_flow_post_handler.handler(self.params['chat_id'], self.params['chat_record_id'],
self.answer,
self)
yield self.get_chunk_content('', True)

def run_chain_async(self, current_node):
future = executor.submit(self.run_chain, current_node)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

该段代码看起来是用于处理与对话相关的任务的,但它包含了一些不太一致的地方。以下是针对这些地方提出的一些建议:

  1. 定义run_chain函数时,可以提供一个参数params而不是self.

  2. 在调用get_chunk_content之前使用`yield self```来确保返回的数据被适当地关闭。

  3. 调用其他链的运行时,直接传递链的当前节点作为第一个参数,并在执行完后将结果作为一个future提交给异步线程池中的submit方法即可。

通过实施上述修改,代码的质量会更高,更符合编程规范和最佳实践的要求。请根据最新的编程标准更新这段代码,以使其更加现代和健壮。

Expand Down
Loading