feat: Intent recognition: 1) The prompt template can be customized. 2) Output reason is configurable. 3) Show the system prompt in the execution detail.#4931
Conversation
|
Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
reason for Intent recognitionIntent recognition whether to output "reason" is configurable
Intent recognition whether to output "reason" is configurableIntent recognition whether to output reason is configurable
Intent recognition whether to output reason is configurableIntent recognition whether to output reason is configurable, and show the system prompt in the execution detail
Intent recognition whether to output reason is configurable, and show the system prompt in the execution detailIntent recognition whether to output reason is configurable. In addition, show the system prompt in the execution detail
Intent recognition whether to output reason is configurable. In addition, show the system prompt in the execution detailIntent recognition: 1) The prompt template can be customized. 2) Output reason is configurable. 3) Show the system prompt in the execution detail.
| order_by = 'create_time' if self.data.get('order_asc') is None or self.data.get( | ||
| 'order_asc') else '-create_time' | ||
| return [ChatRecordSerializerModel(chat_record).data for chat_record in | ||
| QuerySet(ChatRecord).filter(chat_id=self.data.get('chat_id')).order_by(order_by)] |
There was a problem hiding this comment.
上面的 QuerySet(ChatRecord).filter(chat_id=self.data.get('chat_id')) 多余的。
| 'padding_problem_text': chat_record.details.get('problem_padding').get( | ||
| 'padding_problem_text') if 'problem_padding' in chat_record.details else None, | ||
| **(show_source_dict if show_source else {}), | ||
| **(show_exec_dict if show_exec else show_exec_dict) |
| chat_record_details_model.vote_other_content = vote_other_content | ||
|
|
||
| if vote_status == VoteChoices.TRAMPLE: | ||
| elif vote_status == VoteChoices.TRAMPLE: |
| return self.one(), instance, self.data.get('knowledge_id') | ||
|
|
||
| def get_problem_list(self): | ||
| ProblemParagraphMapping(ProblemParagraphMapping) |
…ig-output-reason # Conflicts: # ui/src/workflow/nodes/ai-chat-node/index.vue
What this PR does / why we need it?
Intent recognition:Output reasonis configurable.system promptin the execution detail.Summary of your change
在使用部分大模型时,默认的系统提示词有时候还是无法很好的判断连续对话的连贯性,我认为是提示词与大模型的兼容性不好,或者对于所选大模型来说不够完善。
现将
提示词模板做成可自定义,默认情况下填充原来的提示词模板。注:经测试此次调整向下兼容,可安全升级。
新特性:
意图识别节点的提示词模板可自定义配置了。新特性:
意图识别节点,是否输出理由支持可配置化了;添加该功能的原因:在
生产环境下,可以配置不输出理由,能减少意图识别的耗时,还能稍微减少token消耗。一般在
开发、测试阶段才需要开启它来观察意图识别的理由。界面截图:

优化:

意图识别的执行详情中,展示系统提示词。界面截图:
Please indicate you've done the following: