diff --git a/ui/src/locales/lang/en-US/views/application.ts b/ui/src/locales/lang/en-US/views/application.ts
index 14c3622917e..36a3f599ba9 100644
--- a/ui/src/locales/lang/en-US/views/application.ts
+++ b/ui/src/locales/lang/en-US/views/application.ts
@@ -88,6 +88,11 @@ export default {
- Please use concise and professional language to answer the user's question.
`,
},
+ prompt_template: {
+ label: 'Prompt Template',
+ requiredMessage: 'Please enter Prompt template',
+ tooltip: 'Please pay attention to the placeholders in the template: {classification_list}、{user_input}、{output_json}',
+ },
historyRecord: {
label: 'Chat History',
},
diff --git a/ui/src/locales/lang/en-US/workflow.ts b/ui/src/locales/lang/en-US/workflow.ts
index e39d262a977..e6e393e49be 100644
--- a/ui/src/locales/lang/en-US/workflow.ts
+++ b/ui/src/locales/lang/en-US/workflow.ts
@@ -449,9 +449,34 @@ You are a master of problem optimization, adept at accurately inferring user int
classify: {
label: 'Intent classify',
},
+ output_reason: 'Output Reason',
input: {
label: 'Input',
},
+ default_prompt_template: `# Role
+You are an intention classification expert, good at being able to judge which classification the user's input belongs to.
+
+## Skills
+Skill 1: Clearly determine which of the following intention classifications the user's input belongs to.
+Intention classification list:
+{classification_list}
+
+Note:
+- Please determine the match between the user's input content and the Intention classification list content, without judging or categorizing the match with the classification ID.
+- **When classifying, you must give higher weight to the context and intent continuity shown in the historical conversation. Do not rely solely on the literal meaning of the current input; instead, prioritize the most consistent classification with the previous dialogue flow.**
+
+## User Input
+{user_input}
+
+## Reply requirements
+- The answer must be returned in JSON format.
+- Strictly ensure that the output is in a valid JSON format.
+- Do not add prefix \`\`\`json or suffix \`\`\`
+- The answer needs to include the following fields such as:
+{output_json}
+
+## Limit
+- Please do not reply in text.`,
},
applicationNode: {
label: 'Agent Node',
@@ -540,9 +565,12 @@ You are a master of problem optimization, adept at accurately inferring user int
len_lt: 'Length less than',
is_true: 'Is true',
is_not_true: 'Is not true',
+ regex: 'Regex matching',
+ wildcard: 'Wildcard matching',
},
SystemPromptPlaceholder: 'System Prompt, can reference variables in the system, such as',
UserPromptPlaceholder: 'User Prompt, can reference variables in the system, such as',
+ PromptTemplatePlaceholder: 'Prompt Template, can reference variables in the system, such as',
initiator: 'Iniiator',
abnormalInformation: 'Abnormal Information',
}
diff --git a/ui/src/locales/lang/zh-CN/views/application.ts b/ui/src/locales/lang/zh-CN/views/application.ts
index d1d00f7a8b8..7f413a0a689 100644
--- a/ui/src/locales/lang/zh-CN/views/application.ts
+++ b/ui/src/locales/lang/zh-CN/views/application.ts
@@ -81,6 +81,11 @@ export default {
回答要求:
- 请使用中文回答用户问题`,
},
+ prompt_template: {
+ label: '提示词模板',
+ requiredMessage: '请输入提示词模板',
+ tooltip: '请注意模板中的占位符: {classification_list}、{user_input}、{output_json}',
+ },
historyRecord: {
label: '历史聊天记录',
},
diff --git a/ui/src/locales/lang/zh-CN/workflow.ts b/ui/src/locales/lang/zh-CN/workflow.ts
index 3c004d437c2..d30c435e5c5 100644
--- a/ui/src/locales/lang/zh-CN/workflow.ts
+++ b/ui/src/locales/lang/zh-CN/workflow.ts
@@ -441,9 +441,34 @@ export default {
classify: {
label: '意图分类',
},
+ output_reason: '输出理由',
input: {
label: '输入',
},
+ default_prompt_template: `# 角色
+你是一位意图分类专家,擅长判断用户输入属于哪个分类。
+
+## 技能
+技能1:明确判断用户输入属于以下哪种意图分类。
+意图分类列表:
+{classification_list}
+
+注:
+- 请判断用户输入内容与意图分类列表内容之间的匹配度,注意不要以分类ID作为评判或归类的依据。
+- **在分类时,必须更加重视历史对话中表现的上下文和意图连贯性。不要仅依赖当前输入的字面意思;相反,应优先考虑与先前对话流程最匹配的分类。**
+
+## 用户输入
+{user_input}
+
+## 回复要求
+- 回复内容必须以JSON格式返回。
+- 严格确保输出为有效的JSON格式。
+- 不要添加前缀 \`\`\`json 或 后缀 \`\`\`
+- 回复内容需要包含以下字段:
+{output_json}
+
+## 限制
+- 请勿以文本形式回复。`,
},
applicationNode: {
label: '智能体节点',
@@ -531,9 +556,12 @@ export default {
len_lt: '长度小于',
is_true: '为真',
is_not_true: '不为真',
+ regex: '正则匹配',
+ wildcard: '通配符匹配',
},
SystemPromptPlaceholder: '系统提示词,可以引用系统中的变量:如',
UserPromptPlaceholder: '用户提示词,可以引用系统中的变量:如',
+ PromptTemplatePlaceholder: '提示词模板,可以引用系统中的变量:如',
initiator: '发起人',
abnormalInformation: '异常信息'
diff --git a/ui/src/locales/lang/zh-Hant/views/application.ts b/ui/src/locales/lang/zh-Hant/views/application.ts
index dce197edf1c..ecd6210e336 100644
--- a/ui/src/locales/lang/zh-Hant/views/application.ts
+++ b/ui/src/locales/lang/zh-Hant/views/application.ts
@@ -81,6 +81,11 @@ export default {
回答要求:
- 請使用中文回答用戶問題`,
},
+ prompt_template: {
+ label: '提示詞模板',
+ requiredMessage: '請輸入提示詞模板',
+ tooltip: '請注意模板中的佔位符: {classification_list}、{user_input}、{output_json}',
+ },
historyRecord: {
label: '歷史對話紀錄',
},
diff --git a/ui/src/locales/lang/zh-Hant/workflow.ts b/ui/src/locales/lang/zh-Hant/workflow.ts
index a7fd05c9f1b..ccfd0a6ab75 100644
--- a/ui/src/locales/lang/zh-Hant/workflow.ts
+++ b/ui/src/locales/lang/zh-Hant/workflow.ts
@@ -441,9 +441,34 @@ export default {
classify: {
label: '意圖分類',
},
+ output_reason: '輸出理由',
input: {
label: '輸入',
},
+ default_prompt_template: `# 角色
+你是一位意圖分類專家,擅長判斷用戶輸入屬於哪個分類。
+
+## 技能
+技能1:明確判斷用戶輸入屬於以下哪種意圖分類。
+意圖分類列表:
+{classification_list}
+
+注:
+- 請判斷用戶輸入內容與意圖分類列表內容之間的匹配度,注意不要以分類ID作爲評判或歸類的依據。
+- **在分類時,必須更加重視歷史對話中表現的上下文和意圖連貫性。不要僅依賴當前輸入的字面意思;相反,應優先考慮與先前對話流程最匹配的分類。**
+
+## 用戶輸入
+{user_input}
+
+## 回覆要求
+- 回覆內容必須以JSON格式返回。
+- 嚴格確保輸出爲有效的JSON格式。
+- 不要添加前綴 \`\`\`json 或 後綴 \`\`\`
+- 回覆內容需要包含以下字段:
+{output_json}
+
+## 限制
+- 請勿以文本形式回覆。`,
},
applicationNode: {
label: '智能體節點',
@@ -525,9 +550,12 @@ export default {
len_lt: '長度小於',
is_true: '為真',
is_not_true: '不為真',
+ regex: '正則匹配',
+ wildcard: '通配符匹配',
},
SystemPromptPlaceholder: '系統提示詞,可以引用系統中的變量:如',
UserPromptPlaceholder: '用戶提示詞,可以引用系統中的變量:如',
+ PromptTemplatePlaceholder: '提示詞模板,可以引用系統中的變量:如',
initiator: '發起人',
abnormalInformation: '異常信息',
}
diff --git a/ui/src/styles/app.scss b/ui/src/styles/app.scss
index f203477fef0..f36ed527084 100644
--- a/ui/src/styles/app.scss
+++ b/ui/src/styles/app.scss
@@ -31,6 +31,11 @@ body {
color: var(--el-text-color-primary);
}
+.card-never pre {
+ font-family: 'PingFang SC', AlibabaPuHuiTi !important;
+ white-space: break-spaces;
+}
+
#app {
height: 100%;
}
diff --git a/ui/src/views/application-workflow/index.vue b/ui/src/views/application-workflow/index.vue
index d178f32f71a..3a130af64f3 100644
--- a/ui/src/views/application-workflow/index.vue
+++ b/ui/src/views/application-workflow/index.vue
@@ -229,6 +229,9 @@ const shareUrl = computed(
function back() {
if (JSON.stringify(cloneWorkFlow.value) !== JSON.stringify(getGraphData())) {
+ console.debug("JSON.stringify(cloneWorkFlow.value):", JSON.stringify(cloneWorkFlow.value))
+ console.debug("JSON.stringify(getGraphData()):", JSON.stringify(getGraphData()))
+
MsgConfirm(t('common.tip'), t('workflow.tip.saveMessage'), {
confirmButtonText: t('workflow.setting.exitSave'),
cancelButtonText: t('workflow.setting.exit'),
@@ -699,7 +702,7 @@ onBeforeUnmount(() => {
bottom: 16px;
right: 16px;
overflow: hidden;
- width: 460px;
+ width: 550px;
height: 680px;
.workflow-debug-header {
diff --git a/ui/src/views/knowledge-workflow/index.vue b/ui/src/views/knowledge-workflow/index.vue
index 6a1073e5c04..a2413cc8314 100644
--- a/ui/src/views/knowledge-workflow/index.vue
+++ b/ui/src/views/knowledge-workflow/index.vue
@@ -260,6 +260,9 @@ const isPublish = computed(() => detail.value?.is_publish)
function back() {
if (JSON.stringify(cloneWorkFlow.value) !== JSON.stringify(getGraphData())) {
+ console.debug("JSON.stringify(cloneWorkFlow.value):", JSON.stringify(cloneWorkFlow.value))
+ console.debug("JSON.stringify(getGraphData()):", JSON.stringify(getGraphData()))
+
MsgConfirm(t('common.tip'), t('workflow.tip.saveMessage'), {
confirmButtonText: t('workflow.setting.exitSave'),
cancelButtonText: t('workflow.setting.exit'),
@@ -735,7 +738,7 @@ onBeforeUnmount(() => {
bottom: 16px;
right: 16px;
overflow: hidden;
- width: 460px;
+ width: 550px;
height: 680px;
.workflow-debug-header {
diff --git a/ui/src/views/tool-workflow/index.vue b/ui/src/views/tool-workflow/index.vue
index 0d1496a661f..64b41b65ace 100644
--- a/ui/src/views/tool-workflow/index.vue
+++ b/ui/src/views/tool-workflow/index.vue
@@ -227,6 +227,9 @@ const isPublish = computed(() => detail.value?.is_publish)
function back() {
if (JSON.stringify(cloneWorkFlow.value) !== JSON.stringify(getGraphData())) {
+ console.debug("JSON.stringify(cloneWorkFlow.value):", JSON.stringify(cloneWorkFlow.value))
+ console.debug("JSON.stringify(getGraphData()):", JSON.stringify(getGraphData()))
+
MsgConfirm(t('common.tip'), t('workflow.tip.saveMessage'), {
confirmButtonText: t('workflow.setting.exitSave'),
cancelButtonText: t('workflow.setting.exit'),
diff --git a/ui/src/workflow/common/NodeContainer.vue b/ui/src/workflow/common/NodeContainer.vue
index 86cf69a6df6..4fb3f9cdb4f 100644
--- a/ui/src/workflow/common/NodeContainer.vue
+++ b/ui/src/workflow/common/NodeContainer.vue
@@ -253,7 +253,7 @@ const condition = computed({
if (props.nodeModel.properties.condition) {
return props.nodeModel.properties.condition
}
- set(props.nodeModel.properties, 'condition', 'AND')
+ set(props.nodeModel.properties, 'condition', 'OR')
return true
},
})
diff --git a/ui/src/workflow/common/data.ts b/ui/src/workflow/common/data.ts
index c6120fd60df..a4c2fa1c2ea 100644
--- a/ui/src/workflow/common/data.ts
+++ b/ui/src/workflow/common/data.ts
@@ -1135,6 +1135,8 @@ export const compareList = [
{ value: 'is_not_true', label: t('workflow.compare.is_not_true') },
{ value: 'start_with', label: 'startWith' },
{ value: 'end_with', label: 'endWith' },
+ { value: 'regex', label: t('workflow.compare.regex') },
+ { value: 'wildcard', label: t('workflow.compare.wildcard') },
]
export const nodeDict: any = {
[WorkflowType.AiChat]: aiChatNode,
diff --git a/ui/src/workflow/nodes/intent-classify-node/index.ts b/ui/src/workflow/nodes/intent-classify-node/index.ts
index c39167e9294..406a66f5278 100644
--- a/ui/src/workflow/nodes/intent-classify-node/index.ts
+++ b/ui/src/workflow/nodes/intent-classify-node/index.ts
@@ -48,11 +48,11 @@ class IntentModel extends AppNodeModel {
if (branch_condition_list) {
- const FORM_ITEMS_HEIGHT = 397 // 上方表单占用高度
-
+ const FORM_ITEMS_HEIGHT = 542 // 上方表单占用高度
+
for (let index = 0; index < branch_condition_list.length; index++) {
const element = branch_condition_list[index]
-
+
anchors.push({
x: x + width / 2 - 10,
y: showNode
diff --git a/ui/src/workflow/nodes/intent-classify-node/index.vue b/ui/src/workflow/nodes/intent-classify-node/index.vue
index 7ed132c959c..2e52bbc8716 100644
--- a/ui/src/workflow/nodes/intent-classify-node/index.vue
+++ b/ui/src/workflow/nodes/intent-classify-node/index.vue
@@ -76,6 +76,42 @@
v-model="form_data.model_id_reference"
/>
+
+
+
+
+ {{ $t('views.application.form.prompt_template.label')
+ }}*
+
+
+ {{ $t('views.application.form.prompt_template.tooltip', {
+ classification_list: '{classification_list}',
+ user_input: '{user_input}',
+ output_json: '{output_json}',
+ }) }}
+
+
+
+
+
+