-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
feat: 工作流ai对话节点添加节点上下文 #1791
feat: 工作流ai对话节点添加节点上下文 #1791
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -93,9 +93,8 @@ | |
v-if="showAnchor" | ||
@mousemove.stop | ||
@mousedown.stop | ||
@keydown.stop | ||
@click.stop | ||
@wheel.stop | ||
@wheel="handleWheel" | ||
:show="showAnchor" | ||
:id="id" | ||
style="left: 100%; top: 50%; transform: translate(0, -50%)" | ||
|
@@ -142,6 +141,12 @@ const showNode = computed({ | |
return true | ||
} | ||
}) | ||
const handleWheel = (event: any) => { | ||
const isCombinationKeyPressed = event.ctrlKey || event.metaKey | ||
if (!isCombinationKeyPressed) { | ||
event.stopPropagation() | ||
} | ||
} | ||
const node_status = computed(() => { | ||
if (props.nodeModel.properties.status) { | ||
return props.nodeModel.properties.status | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 这个代码片段可能有以下问题:
其他方面没有发现明显的不规范或缺陷。但是如果有进一步的需求,比如希望更准确地实现某个特性或者添加新的功能,我可以在现有基础上提供详细的修改建议和说明。 |
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -148,6 +148,15 @@ | |
/> | ||
</el-form-item> | ||
<el-form-item label="历史聊天记录"> | ||
<template #label> | ||
<div class="flex-between"> | ||
<div>历史聊天记录</div> | ||
<el-select v-model="chat_data.dialogue_type" type="small" style="width: 100px"> | ||
<el-option label="节点" value="NODE" /> | ||
<el-option label="工作流" value="WORKFLOW" /> | ||
</el-select> | ||
</div> | ||
</template> | ||
<el-input-number | ||
v-model="chat_data.dialogue_number" | ||
:min="0" | ||
|
@@ -246,7 +255,8 @@ const form = { | |
dialogue_number: 1, | ||
is_result: false, | ||
temperature: null, | ||
max_tokens: null | ||
max_tokens: null, | ||
dialogue_type: 'WORKFLOW' | ||
} | ||
|
||
const chat_data = computed({ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 以下是针对给定代码的反馈:
对于优化与改进:
此外,为了简化代码结构并提高可读性和组织性,请考虑将两个组件合并到一个更简化的 最后,对所有类型的错误进行调试有助于发现可能存在的问题并及时修正。希望以上改进建议能帮助你提升编程效率和质量! |
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个代码是针对聊天机器人模型进行的消息管理和对话状态管理。在分析过程中发现一些问题和可能需要关注的部分。下面是关于这个问题的答案:
错误的导入语句
from django.db.models import QuerySet
:这行应该被替换为from langchain_core.messages import BaseMessage, AIMessage
.类继承部分:
BaseChatNode
类中没有明确提及从哪个子类别继承(例如,它是否继承自任何其他模块或类)。变量命名一致性的问题:函数内部有多个地方的变量名与外部文件中的定义不符合。
逻辑混乱:
流程简化:
全局配置设置缺失/未使用的警告
为了进一步改进这段代码,我建议采取以下措施来修复这些问题并提高整体质量和效率:
最后还请注意测试不同场景下代码的行为,因为这些方面可能存在未知的需求和意外行为。