Dify工作流入门实战

木偶AI正在绞尽脑汁想思路ING···
木偶のAI摘要
DeepSeek-Chat

写提示词的大模型: gemini

1. 工作流-图片文字提取

大模型图片识别提示词通过 gemini 生成,提示词如下:

图片文字提取 提示词

Role

你是一位拥有 20 年经验的高级 OCR(光学字符识别)专家,精通多种语言、复杂排版及各类手写体识别,能够以极高的准确度还原图片中的文本信息。

Task

请完整、精确地提取所提供图片中的所有文字内容,并保持其逻辑结构。

Rules & Constraints

  1. 忠实原意:严禁对图片文字进行总结、修改或拼写纠错。无论原图文字是否有误,均按视觉呈现原样输出。
  2. 结构还原
    • 保持段落分明,确保标题、正文、列表、脚注的层次感。
    • 若有表格,请使用 Markdown 表格格式还原。
    • 若有分栏排版,请按人类正常阅读顺序(从左到右,从上到下)排列。
  3. 视觉标注
    • 无法辨认的模糊字符请使用 [?] 代替。
    • 图片中的特殊符号或图标,可用文字描述(例如:[检查框已勾选])。
  4. 负面约束
    • 不要输出诸如“好的,这是我为你识别的文字”之类的开场白。
    • 不要输出任何关于图片质量的评价。
    • 严禁忽略图片边缘的小字或水印文字(除非特别要求)。

Output Format

请统一使用 Markdown 格式进行输出,确保在代码块中呈现纯文本,以便于我直接复制。

2. 工作流-发票信息提取

3. 对话流-作文写作

可以使用工具中的 markdown转docx 来完成文章生成以方便下载

对话流-作文写作
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
 app:
description: ''
icon: 🤖
icon_background: '#FFEAD5'
icon_type: emoji
mode: advanced-chat
name: demo3-智能写作并生成word文档
use_icon_as_answer_icon: false
dependencies:
- current_identifier: null
type: marketplace
value:
marketplace_plugin_unique_identifier: langgenius/siliconflow:0.0.50@94cd52b1effc7c6d7cce24f394906de790b6496d0e3d1a0f15158b30e29863e4
version: null
- current_identifier: null
type: marketplace
value:
marketplace_plugin_unique_identifier: stvlynn/doc:0.0.1@900d82963e63c505136dfc77f3e06329326e714ca66bed668224e811f73efc7b
version: null
kind: app
version: 0.6.0
workflow:
conversation_variables: []
environment_variables: []
features:
file_upload:
allowed_file_extensions:
- .JPG
- .JPEG
- .PNG
- .GIF
- .WEBP
- .SVG
allowed_file_types:
- image
allowed_file_upload_methods:
- local_file
- remote_url
enabled: false
fileUploadConfig:
attachment_image_file_size_limit: 2
audio_file_size_limit: 50
batch_count_limit: 5
file_size_limit: 15
file_upload_limit: 20
image_file_batch_limit: 10
image_file_size_limit: 10
single_chunk_attachment_limit: 10
video_file_size_limit: 100
workflow_file_upload_limit: 10
image:
enabled: false
number_limits: 3
transfer_methods:
- local_file
- remote_url
number_limits: 3
opening_statement: ''
retriever_resource:
enabled: true
sensitive_word_avoidance:
enabled: false
speech_to_text:
enabled: false
suggested_questions: []
suggested_questions_after_answer:
enabled: false
text_to_speech:
enabled: false
language: ''
voice: ''
graph:
edges:
- data:
sourceType: start
targetType: llm
id: 1777212688546-llm
source: '1777212688546'
sourceHandle: source
target: llm
targetHandle: target
type: custom
- data:
isInIteration: false
isInLoop: false
sourceType: llm
targetType: tool
id: llm-source-1777212849252-target
source: llm
sourceHandle: source
target: '1777212849252'
targetHandle: target
type: custom
zIndex: 0
- data:
isInIteration: false
isInLoop: false
sourceType: tool
targetType: answer
id: 1777212849252-source-answer-target
source: '1777212849252'
sourceHandle: source
target: answer
targetHandle: target
type: custom
zIndex: 0
nodes:
- data:
selected: false
title: 用户输入
type: start
variables:
- default: ''
hint: ''
label: 文章标题
options: []
placeholder: ''
required: true
type: text-input
variable: title
height: 109
id: '1777212688546'
position:
x: 189
y: 150.78962915804343
positionAbsolute:
x: 189
y: 150.78962915804343
selected: false
sourcePosition: right
targetPosition: left
type: custom
width: 242
- data:
context:
enabled: false
variable_selector: []
memory:
query_prompt_template: '{{#sys.query#}}


{{#sys.files#}}'
role_prefix:
assistant: ''
user: ''
window:
enabled: false
size: 10
model:
completion_params:
temperature: 0.7
mode: chat
name: Pro/moonshotai/Kimi-K2.5
provider: langgenius/siliconflow/siliconflow
prompt_template:
- id: 21b0492e-9b48-4ea4-a1b4-bd860f4ae0f2
role: system
text: "# Role\n你是一位深耕中小学语文教育 20 年的资深作文导师,擅长根据不同学段的教学大纲,指导学生完成从构思、起草到润色的全过程。\n\
\n# Task\n请根据以下要求,为我提供作文指导或创作:\n- **当前学段**:[小学/初中/高中]\n- **作文题目**:[在此输入题目]\n\
- **字数要求**:[如:400字/600字/800字]\n- **体裁要求**:[如:记叙文/议论文/说明文/读后感]\n- **核心诉求**:[如:提供提纲\
\ / 范文展示 / 润色我的草稿]\n\n# Section 1: 学段适配规则 (Internal Logic)\n1. **小学模式**:语言要生动活泼,多用修辞手法(比喻、拟人),侧重观察生活,情感表达要真挚自然,逻辑结构简单清晰(总分总)。\n\
2. **初中模式**:强调“以小见大”,立意要有一定的深度。记叙文要求细节描写(动作、心理、环境),议论文要求论点明确,论据典型。\n3.\
\ **高中模式**:语言要深刻、厚重,具有逻辑辨析度。议论文需具备多维度思考(思辨性),引用名言素材要新颖,结构要求严谨(起承转合)。\n\
\n# Section 2: 响应流程 (Response Steps)\n请按以下顺序分阶段输出内容:\n\n### 1. 思路启发与提纲\
\ (The Blueprint)\n - 分析题目:解析题目的核心意图和隐含要求。\n - 确定立意:提供 2-3 个不同的写作角度。\n\
\ - 搭建框架:提供一个逻辑严谨的写作大纲。\n\n### 2. 佳句/素材库 (The Toolbox)\n - 提供 3 个与主题相关的名言警句或文学素材。\n\
\ - 提供 3 组针对该主题的优美词汇或排比句式。\n\n### 3. 全文示范/润色建议 (The Masterpiece)\n \
\ - [如果是“提供范文”]:请写出一篇符合该学段水平的优秀范文,并标注出其中的亮点。\n - [如果是“润色草稿”]:请针对我提供的草稿,指出逻辑缺陷、修改病句,并提供一个升级后的对比段落。\n\
\n# Constraints\n- 严禁使用过于AI化的机械用语(如“综上所述”、“总而言之”)。\n- 语言风格必须符合学生的身份,不能写得像学术论文或官场报告。\n\
- 遵循最新的语文教学大纲标准。"
selected: false
title: 大模型写作
type: llm
vision:
enabled: false
height: 88
id: llm
position:
x: 380
y: 282
positionAbsolute:
x: 380
y: 282
selected: false
sourcePosition: right
targetPosition: left
type: custom
width: 242
- data:
answer: '请点击下载: {{#1777212849252.files#}}'
selected: false
title: 直接回复
type: answer
variables: []
height: 103
id: answer
position:
x: 650
y: 481
positionAbsolute:
x: 650
y: 481
selected: false
sourcePosition: right
targetPosition: left
type: custom
width: 242
- data:
is_team_authorization: true
paramSchemas:
- auto_generate: null
default: null
form: llm
human_description:
en_US: The Markdown content to be converted to Word document
ja_JP: Word ドキュメントに変換する Markdown コンテンツ
pt_BR: O conteúdo Markdown a ser convertido para documento Word
zh_Hans: 要转换为Word文档的Markdown内容
label:
en_US: Markdown Content
ja_JP: Markdown コンテンツ
pt_BR: Conteúdo Markdown
zh_Hans: Markdown内容
llm_description: The Markdown content that will be converted to a Word document
max: null
min: null
name: markdown_content
options: []
placeholder: null
precision: null
required: true
scope: null
template: null
type: string
- auto_generate: null
default: null
form: llm
human_description:
en_US: The title of the Word document
ja_JP: Word ドキュメントのタイトル
pt_BR: O título do documento Word
zh_Hans: Word文档的标题
label:
en_US: Document Title
ja_JP: ドキュメントタイトル
pt_BR: Título do Documento
zh_Hans: 文档标题
llm_description: The title that will be displayed at the top of the Word
document
max: null
min: null
name: title
options: []
placeholder: null
precision: null
required: false
scope: null
template: null
type: string
params:
markdown_content: ''
title: ''
plugin_id: stvlynn/doc
plugin_unique_identifier: stvlynn/doc:0.0.1@900d82963e63c505136dfc77f3e06329326e714ca66bed668224e811f73efc7b
provider_icon: /console/api/workspaces/current/plugin/icon?tenant_id=ca30802b-cc15-495f-aca3-42ad30495707&filename=cb0643689e2f8152d38c44a267a459fae99ff208b0bc164e27ccb053fc1844cd.svg
provider_id: stvlynn/doc/doc
provider_name: stvlynn/doc/doc
provider_type: builtin
selected: true
title: Markdown转DOCX转换器
tool_configurations: {}
tool_description: 将Markdown内容转换为DOCX(Word)文档
tool_label: Markdown转DOCX转换器
tool_name: markdown_to_docx_converter
tool_node_version: '2'
tool_parameters:
markdown_content:
type: mixed
value: '{{#llm.text#}}'
title:
type: mixed
value: '{{#1777212688546.title#}}'
type: tool
height: 52
id: '1777212849252'
position:
x: 510
y: 397
positionAbsolute:
x: 510
y: 397
selected: true
sourcePosition: right
targetPosition: left
type: custom
width: 242
viewport:
x: 26.313955203020214
y: -0.6343146456992486
zoom: 1
rag_pipeline_variables: []

4. 对话流-评价分了

问题分类中的只需要书写结果即可, 不用关键词和大模型, 组件会自动调用

5. 工作流-网络请求

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
app:
description: ''
icon: 🤖
icon_background: '#FFEAD5'
icon_type: emoji
mode: workflow
name: demo5-网络请求
use_icon_as_answer_icon: false
dependencies:
- current_identifier: null
type: marketplace
value:
marketplace_plugin_unique_identifier: langgenius/siliconflow:0.0.50@94cd52b1effc7c6d7cce24f394906de790b6496d0e3d1a0f15158b30e29863e4
version: null
kind: app
version: 0.6.0
workflow:
conversation_variables: []
environment_variables: []
features:
file_upload:
allowed_file_extensions:
- .JPG
- .JPEG
- .PNG
- .GIF
- .WEBP
- .SVG
allowed_file_types:
- image
allowed_file_upload_methods:
- local_file
- remote_url
enabled: false
fileUploadConfig:
attachment_image_file_size_limit: 2
audio_file_size_limit: 50
batch_count_limit: 5
file_size_limit: 15
file_upload_limit: 20
image_file_batch_limit: 10
image_file_size_limit: 10
single_chunk_attachment_limit: 10
video_file_size_limit: 100
workflow_file_upload_limit: 10
image:
enabled: false
number_limits: 3
transfer_methods:
- local_file
- remote_url
number_limits: 3
opening_statement: ''
retriever_resource:
enabled: true
sensitive_word_avoidance:
enabled: false
speech_to_text:
enabled: false
suggested_questions: []
suggested_questions_after_answer:
enabled: false
text_to_speech:
enabled: false
language: ''
voice: ''
graph:
edges:
- data:
isInIteration: false
isInLoop: false
sourceType: start
targetType: http-request
id: 1777215491451-source-1777215500148-target
source: '1777215491451'
sourceHandle: source
target: '1777215500148'
targetHandle: target
type: custom
zIndex: 0
- data:
isInIteration: false
isInLoop: false
sourceType: http-request
targetType: parameter-extractor
id: 1777215500148-source-1777215638255-target
source: '1777215500148'
sourceHandle: source
target: '1777215638255'
targetHandle: target
type: custom
zIndex: 0
- data:
isInIteration: false
isInLoop: false
sourceType: parameter-extractor
targetType: end
id: 1777215638255-source-1777215643263-target
source: '1777215638255'
sourceHandle: source
target: '1777215643263'
targetHandle: target
type: custom
zIndex: 0
nodes:
- data:
selected: false
title: 用户输入
type: start
variables: []
height: 73
id: '1777215491451'
position:
x: -20.999999999999943
y: 267
positionAbsolute:
x: -20.999999999999943
y: 267
selected: false
sourcePosition: right
targetPosition: left
type: custom
width: 242
- data:
authorization:
config: null
type: no-auth
body:
data:
- id: key-value-443
key: ''
type: text
value: '{

"username":"ck001",

"password":"123456",

"captcha":"9999",

"captchakey":1572

}'
type: json
headers: Content-Type:application/json
method: post
params: ''
retry_config:
max_retries: 3
retry_enabled: true
retry_interval: 100
selected: false
ssl_verify: true
timeout:
max_connect_timeout: 0
max_read_timeout: 0
max_write_timeout: 0
title: HTTP 请求
type: http-request
url: http://vip.ytesting.com/api/token/
variables: []
height: 138
id: '1777215500148'
position:
x: 97
y: 367
positionAbsolute:
x: 97
y: 367
selected: false
sourcePosition: right
targetPosition: left
type: custom
width: 242
- data:
instruction: ''
model:
completion_params:
temperature: 0.7
mode: chat
name: Pro/moonshotai/Kimi-K2.5
provider: langgenius/siliconflow/siliconflow
parameters:
- description: 提取登录的token
name: token
required: false
type: string
query:
- '1777215500148'
- body
reasoning_mode: prompt
selected: false
title: 参数提取器
type: parameter-extractor
vision:
enabled: false
height: 88
id: '1777215638255'
position:
x: 205.80908999402482
y: 527.4207416839131
positionAbsolute:
x: 205.80908999402482
y: 527.4207416839131
selected: false
sourcePosition: right
targetPosition: left
type: custom
width: 242
- data:
outputs:
- value_selector:
- '1777215500148'
- body
value_type: string
variable: body
- value_selector:
- '1777215638255'
- token
value_type: string
variable: token
selected: true
title: 输出
type: end
height: 114
id: '1777215643263'
position:
x: 409.98386534235044
y: 627.7734945003938
positionAbsolute:
x: 409.98386534235044
y: 627.7734945003938
selected: true
sourcePosition: right
targetPosition: left
type: custom
width: 242
viewport:
x: 205.5924062823509
y: -144.21074345838844
zoom: 1.0000000000000002
rag_pipeline_variables: []