Compare commits

...

2 Commits

Author SHA1 Message Date
39120483fa 工作流更新 2025-11-28 15:42:10 +08:00
0483e1f514 系统提示词同步 2025-11-28 15:40:09 +08:00
3 changed files with 220 additions and 59 deletions

View File

@@ -9,17 +9,25 @@ dependencies:
- current_identifier: null
type: marketplace
value:
marketplace_plugin_unique_identifier: langgenius/siliconflow:0.0.34@1c203017d8ef49fd9152696a42e6dc71ecf272b115d8caf731c99ee0d2956dce
marketplace_plugin_unique_identifier: anspire/anspire_search:0.0.9@a59824e9507c05c81d582cc5d8384197215d91bf5c787150d8aad723eb5d1a69
version: null
- current_identifier: null
type: marketplace
value:
marketplace_plugin_unique_identifier: anspire/anspire_search:0.0.9@a59824e9507c05c81d582cc5d8384197215d91bf5c787150d8aad723eb5d1a69
marketplace_plugin_unique_identifier: langgenius/ollama:0.1.0@7c18c74b94a855de83aa66f376939d47b96a49b6dbb6904b46b267cb0213396e
version: null
kind: app
version: 0.4.0
version: 0.5.0
workflow:
conversation_variables:
- description: ''
id: 71e3f805-8445-46b1-bd43-8af398234527
name: dataset_apikey
selector:
- conversation
- dataset_apikey
value: ''
value_type: string
- description: ''
id: e18aacca-16a2-4d93-80c4-5a85ead53ae4
name: datasets
@@ -225,19 +233,6 @@ workflow:
targetHandle: target
type: custom
zIndex: 0
- data:
isInIteration: false
isInLoop: false
sourceType: start
targetType: if-else
id: 1762339910800-source-1762421892949-target
selected: false
source: '1762339910800'
sourceHandle: source
target: '1762421892949'
targetHandle: target
type: custom
zIndex: 0
- data:
isInIteration: false
isInLoop: false
@@ -257,6 +252,7 @@ workflow:
sourceType: code
targetType: iteration
id: 1762510470105-source-1762339969303-target
selected: false
source: '1762510470105'
sourceHandle: source
target: '1762339969303'
@@ -268,21 +264,11 @@ workflow:
isInLoop: false
sourceType: if-else
targetType: tool
id: 1762421892949-true-1762511001734-target
id: 1762421892949-true-1764314675268-target
selected: false
source: '1762421892949'
sourceHandle: 'true'
target: '1762511001734'
targetHandle: target
type: custom
zIndex: 0
- data:
isInLoop: false
sourceType: assigner
targetType: tool
id: 1762509024795-source-1762511001734-target
source: '1762509024795'
sourceHandle: source
target: '1762511001734'
target: '1764314675268'
targetHandle: target
type: custom
zIndex: 0
@@ -290,13 +276,76 @@ workflow:
isInLoop: false
sourceType: tool
targetType: code
id: 1762511001734-source-1762510470105-target
source: '1762511001734'
id: 1764314675268-source-1762510470105-target
selected: false
source: '1764314675268'
sourceHandle: source
target: '1762510470105'
targetHandle: target
type: custom
zIndex: 0
- data:
isInLoop: false
sourceType: assigner
targetType: tool
id: 1762509024795-source-1764314675268-target
selected: false
source: '1762509024795'
sourceHandle: source
target: '1764314675268'
targetHandle: target
type: custom
zIndex: 0
- data:
isInIteration: false
isInLoop: false
sourceType: start
targetType: if-else
id: 1762339910800-source-1764314703864-target
selected: false
source: '1762339910800'
sourceHandle: source
target: '1764314703864'
targetHandle: target
type: custom
zIndex: 0
- data:
isInIteration: false
isInLoop: false
sourceType: if-else
targetType: assigner
id: 1764314703864-false-1764314714879-target
selected: false
source: '1764314703864'
sourceHandle: 'false'
target: '1764314714879'
targetHandle: target
type: custom
zIndex: 0
- data:
isInLoop: false
sourceType: assigner
targetType: if-else
id: 1764314714879-source-1762421892949-target
selected: false
source: '1764314714879'
sourceHandle: source
target: '1762421892949'
targetHandle: target
type: custom
zIndex: 0
- data:
isInLoop: false
sourceType: if-else
targetType: if-else
id: 1764314703864-true-1762421892949-target
selected: false
source: '1764314703864'
sourceHandle: 'true'
target: '1762421892949'
targetHandle: target
type: custom
zIndex: 0
nodes:
- data:
selected: false
@@ -321,14 +370,32 @@ workflow:
required: true
type: text-input
variable: datasets
height: 114
- default: ''
hint: ''
label: dataset_apikey
max_length: 100
options: []
placeholder: ''
required: true
type: text-input
variable: dataset_apikey
- default: ''
hint: ''
label: promt
max_length: 2000
options: []
placeholder: ''
required: true
type: paragraph
variable: promt
height: 187
id: '1762339910800'
position:
x: -1233.1402302396395
y: 149.5782401176896
x: -1704.106555788423
y: 174.193204867626
positionAbsolute:
x: -1233.1402302396395
y: 149.5782401176896
x: -1704.106555788423
y: 174.193204867626
selected: false
sourcePosition: right
targetPosition: left
@@ -354,8 +421,8 @@ workflow:
model:
completion_params: {}
mode: chat
name: deepseek-ai/DeepSeek-V3
provider: langgenius/siliconflow/siliconflow
name: qwen-14b
provider: langgenius/ollama/ollama
prompt_config:
jinja2_variables:
- value_selector:
@@ -370,10 +437,14 @@ workflow:
- '1762510470105'
- result
variable: result
- value_selector:
- '1762339910800'
- promt
variable: promt
prompt_template:
- edition_type: jinja2
id: 5d50499d-b81d-43aa-a891-38fd349bd754
jinja2_text: "你是一个专业的思政学习助手,致力于帮助用户学习思想政治理论知识。请基于提供的知识库内容{{ result }},为用户提供准确、简洁的回答。\r\
jinja2_text: "{{ promt }}\r\n\r\n请基于提供的知识库内容{{ result }},为用户提供准确、简洁的回答。\r\
\n\r\n{% if searchData %}\r\n结合 {{ searchData }} 回答用户\r\n{% endif %}\r\
\n{% if fileData %}\r\n结合文件内容 {{ fileData }} 回答用户\r\n{% endif %}\r\n"
role: system
@@ -394,7 +465,7 @@ workflow:
- id: 23264213-e421-4449-b666-a55a0e39e561
role: user
text: ''
selected: false
selected: true
title: LLM
type: llm
vision:
@@ -407,7 +478,7 @@ workflow:
positionAbsolute:
x: 2674.6343495125943
y: 75.75635633814841
selected: false
selected: true
sourcePosition: right
targetPosition: left
type: custom
@@ -496,7 +567,7 @@ workflow:
variable_selector:
- '1762339969303'
- item
height: 92
height: 104
id: '1762339981310'
parentId: '1762339969303'
position:
@@ -958,7 +1029,7 @@ workflow:
type: code
variables:
- value_selector:
- '1762511001734'
- '1764314675268'
- text
value_type: string
variable: text
@@ -1034,10 +1105,44 @@ workflow:
scope: null
template: null
type: string
- auto_generate: null
default: ''
form: llm
human_description:
en_US: ''
ja_JP: ''
pt_BR: ''
zh_Hans: ''
label:
en_US: dataset_apikey
ja_JP: dataset_apikey
pt_BR: dataset_apikey
zh_Hans: dataset_apikey
llm_description: ''
max: null
min: null
name: dataset_apikey
options: []
placeholder:
en_US: ''
ja_JP: ''
pt_BR: ''
zh_Hans: ''
precision: null
required: true
scope: null
template: null
type: string
params:
dataset_apikey: ''
dataset_ids: ''
query: ''
provider_id: 019a5dd7-5f2b-7767-b2df-82bfda84c7ec
plugin_id: null
plugin_unique_identifier: null
provider_icon:
background: '#FFEAD5'
content: 🤖
provider_id: e7e4453f-0667-47fe-be4c-62accfbc7cc6
provider_name: 动态知识库检索
provider_type: workflow
selected: false
@@ -1048,6 +1153,9 @@ workflow:
tool_name: dynamic_dataset
tool_node_version: '2'
tool_parameters:
dataset_apikey:
type: mixed
value: '{{#conversation.dataset_apikey#}}'
dataset_ids:
type: mixed
value: '{{#conversation.datasets#}}'
@@ -1056,20 +1164,77 @@ workflow:
value: '{{#sys.query#}}'
type: tool
height: 52
id: '1762511001734'
id: '1764314675268'
position:
x: -142.91348174874167
y: -247.51043561574136
x: -165.1249185156642
y: -247.5444668446392
positionAbsolute:
x: -142.91348174874167
y: -247.51043561574136
selected: true
x: -165.1249185156642
y: -247.5444668446392
selected: false
sourcePosition: right
targetPosition: left
type: custom
width: 242
- data:
cases:
- case_id: 'true'
conditions:
- comparison_operator: not empty
id: 3123b598-113d-453f-b3fc-d04b6e83a35e
value: ''
varType: string
variable_selector:
- conversation
- dataset_apikey
id: 'true'
logical_operator: and
selected: false
title: 条件分支 3
type: if-else
height: 124
id: '1764314703864'
position:
x: -1295.7675522246373
y: -98.76989654474232
positionAbsolute:
x: -1295.7675522246373
y: -98.76989654474232
selected: false
sourcePosition: right
targetPosition: left
type: custom
width: 242
- data:
items:
- input_type: variable
operation: over-write
value:
- '1762339910800'
- dataset_apikey
variable_selector:
- conversation
- dataset_apikey
write_mode: over-write
selected: false
title: 变量赋值 2
type: assigner
version: '2'
height: 84
id: '1764314714879'
position:
x: -988.84455927465
y: -5.23303049498395
positionAbsolute:
x: -988.84455927465
y: -5.23303049498395
selected: false
sourcePosition: right
targetPosition: left
type: custom
width: 242
viewport:
x: 863.6452676587132
y: 446.19950772630614
zoom: 0.9236555375410279
x: -1068.6187404167313
y: 347.5222255720734
zoom: 0.6093853943072881
rag_pipeline_variables: []

View File

@@ -226,15 +226,10 @@ CREATE TABLE `tb_ai_usage_statistics` (
INSERT INTO `tb_ai_agent_config`
(`id`, `name`, `avatar`, `description`, `connect_internet`,`dify_api_key`, `status`, `creator`, `create_time`)
VALUES
('agent_default_001', '校园助手', NULL, '我是您的智能校园助手,可以帮助您解答校园相关问题',
('agent_default_001', '校园助手', NULL, '你是一个专业的思政学习助手,致力于帮助用户学习思想政治理论知识。',
0, 'app-fwOqGFLTsZtekCQYlOmj9f8x', 1, '1', NOW());
-- 插入示例知识库(需要配合权限表使用)
INSERT INTO `tb_ai_knowledge`
(`id`, `title`, `description`, `category`, `status`, `creator`, `creator_dept`, `create_time`)
VALUES
('knowledge_demo_001', '校园规章制度', '学校各项规章制度汇总', '规章制度', 1, '1', 'root_department', NOW()),
('knowledge_demo_002', '新生入学指南', '新生入学相关事项说明', '入学指导', 1, '1', 'root_department', NOW());
-- 为示例知识库创建权限(公开可读)
-- 注意:实际使用时应该在应用层通过权限服务自动创建

View File

@@ -283,6 +283,7 @@ public class AiChatServiceImpl implements AiChatService {
inputs.put("connectInternet", agent.getConnectInternet());
inputs.put("datasets", JSON.toJSONString(knowledgeIds));
inputs.put("dataset_apikey", difyConfig.getKnowledgeApiKey());
inputs.put("promt", agent.getDescription());
chatRequest.setInputs(inputs);
chatRequest.setFiles(filesData);
// 6. 调用Dify流式对话