-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path翻译助手.yml
More file actions
842 lines (773 loc) · 23.8 KB
/
Copy path翻译助手.yml
File metadata and controls
842 lines (773 loc) · 23.8 KB
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
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
app:
description: ''
icon: 📂
icon_background: '#FEF7C3'
mode: advanced-chat
name: 翻译助手
use_icon_as_answer_icon: false
dependencies:
- current_identifier: null
type: marketplace
value:
marketplace_plugin_unique_identifier: langgenius/deepseek:0.0.5@fd6efd37c2a931911de8ab9ca3ba2da303bef146d45ee87ad896b04b36d09403
kind: app
version: 0.3.0
workflow:
conversation_variables:
- description: 'Text to be translated. '
id: e520bb9f-da6f-49a3-9da6-a3c74f1d68d6
name: text
selector:
- conversation
- text
value: ''
value_type: string
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:
audio_file_size_limit: 50
batch_count_limit: 5
file_size_limit: 15
image_file_size_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: false
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
sourceType: if-else
targetType: document-extractor
id: 1727235780030-true-1727235420145-target
selected: false
source: '1727235780030'
sourceHandle: 'true'
target: '1727235420145'
targetHandle: target
type: custom
zIndex: 0
- data:
isInIteration: false
sourceType: assigner
targetType: answer
id: 1727243290238-source-1727243331745-target
selected: false
source: '1727243290238'
sourceHandle: source
target: '1727243331745'
targetHandle: target
type: custom
zIndex: 0
- data:
isInIteration: false
sourceType: llm
targetType: answer
id: 1727244691213-source-1727244764225-target
selected: false
source: '1727244691213'
sourceHandle: source
target: '1727244764225'
targetHandle: target
type: custom
zIndex: 0
- data:
isInIteration: false
sourceType: llm
targetType: answer
id: 17272454043470-source-1727245512406-target
selected: false
source: '17272454043470'
sourceHandle: source
target: '1727245512406'
targetHandle: target
type: custom
zIndex: 0
- data:
isInIteration: false
sourceType: llm
targetType: llm
id: 1727245644467-source-17272454043470-target
selected: false
source: '1727245644467'
sourceHandle: source
target: '17272454043470'
targetHandle: target
type: custom
zIndex: 0
- data:
isInIteration: false
sourceType: if-else
targetType: llm
id: 1727235780030-d8e58cc8-8c7c-4426-a596-32178b8fc6df-1727245644467-target
selected: false
source: '1727235780030'
sourceHandle: d8e58cc8-8c7c-4426-a596-32178b8fc6df
target: '1727245644467'
targetHandle: target
type: custom
zIndex: 0
- data:
isInIteration: false
sourceType: start
targetType: if-else
id: 1727234055352-source-1727235780030-target
selected: false
source: '1727234055352'
sourceHandle: source
target: '1727235780030'
targetHandle: target
type: custom
zIndex: 0
- data:
isInIteration: false
sourceType: document-extractor
targetType: assigner
id: 1727235420145-source-1727243290238-target
source: '1727235420145'
sourceHandle: source
target: '1727243290238'
targetHandle: target
type: custom
zIndex: 0
- data:
isInIteration: false
sourceType: answer
targetType: llm
id: 1727243331745-source-1727244691213-target
source: '1727243331745'
sourceHandle: source
target: '1727244691213'
targetHandle: target
type: custom
zIndex: 0
nodes:
- data:
desc: ''
selected: false
title: Start
type: start
variables:
- allowed_file_extensions: []
allowed_file_types:
- document
allowed_file_upload_methods:
- local_file
- remote_url
label: Document to translate
max_length: 5
options: []
required: true
type: file
variable: text
- label: 'Language to be translated in: '
max_length: 48
options: []
required: true
type: text-input
variable: target_language
height: 114
id: '1727234055352'
position:
x: 30
y: 286.5
positionAbsolute:
x: 30
y: 286.5
selected: false
sourcePosition: right
targetPosition: left
type: custom
width: 243
- data:
desc: ''
is_array_file: false
selected: false
title: Doc Extractor
type: document-extractor
variable_selector:
- '1727234055352'
- text
height: 90
id: '1727235420145'
position:
x: 638
y: 286.5
positionAbsolute:
x: 638
y: 286.5
selected: false
sourcePosition: right
targetPosition: left
type: custom
width: 243
- data:
cases:
- case_id: 'true'
conditions:
- comparison_operator: '='
id: aedd7231-30bc-450e-830f-068697835bc5
value: '1'
varType: number
variable_selector:
- sys
- dialogue_count
id: 'true'
logical_operator: and
- case_id: d8e58cc8-8c7c-4426-a596-32178b8fc6df
conditions:
- comparison_operator: '>'
id: 6f2dfa0d-f898-49d6-9d10-cd61ce884bed
value: '1'
varType: number
variable_selector:
- sys
- dialogue_count
id: d8e58cc8-8c7c-4426-a596-32178b8fc6df
logical_operator: and
desc: ''
selected: false
title: IF/ELSE
type: if-else
height: 172
id: '1727235780030'
position:
x: 334
y: 286.5
positionAbsolute:
x: 334
y: 286.5
selected: false
sourcePosition: right
targetPosition: left
type: custom
width: 243
- data:
assigned_variable_selector:
- conversation
- text
desc: ''
input_variable_selector:
- '1727235420145'
- text
selected: false
title: Variable Assigner
type: assigner
write_mode: over-write
height: 86
id: '1727243290238'
position:
x: 942
y: 286.5
positionAbsolute:
x: 942
y: 286.5
selected: false
sourcePosition: right
targetPosition: left
type: custom
width: 243
- data:
answer: 'Document Processed! '
desc: ''
selected: false
title: Answer
type: answer
variables: []
height: 100
id: '1727243331745'
position:
x: 1246
y: 286.5
positionAbsolute:
x: 1246
y: 286.5
selected: false
sourcePosition: right
targetPosition: left
type: custom
width: 243
- data:
context:
enabled: false
variable_selector: []
desc: ''
model:
completion_params: {}
mode: chat
name: deepseek-chat
provider: langgenius/deepseek/deepseek
prompt_template:
- id: 28742294-85bb-4612-8e4e-6e590bb48c99
role: system
text: 'You are a translator capable of translating multiple languages. Your
task is to accurately translate the given text from the source language
to {{#1727234055352.target_language#}}. Follow these steps to complete
the task:
1. Identify the source language of the input text.
2. Translate the text into {{#1727234055352.target_language#}}.
3. Ensure that the translation maintains the original meaning and context.
4. Use proper grammar, punctuation, and syntax in the translated text.
Make sure to handle idiomatic expressions and cultural nuances appropriately.
If the input text contains any specialized terminology or jargon, ensure
that the translation reflects the correct terms in the target language.
'
- id: 90c836a7-2dd0-4221-99b5-220ee47395fd
role: user
text: '{{#1727235420145.text#}}'
selected: false
title: LLM Translate
type: llm
variables: []
vision:
enabled: false
height: 88
id: '1727244691213'
position:
x: 1550
y: 286.5
positionAbsolute:
x: 1550
y: 286.5
selected: false
sourcePosition: right
targetPosition: left
type: custom
width: 243
- data:
answer: '{{#1727244691213.text#}}'
desc: ''
selected: false
title: Answer
type: answer
variables: []
height: 104
id: '1727244764225'
position:
x: 1854
y: 286.5
positionAbsolute:
x: 1854
y: 286.5
selected: false
sourcePosition: right
targetPosition: left
type: custom
width: 243
- data:
context:
enabled: false
variable_selector: []
desc: ''
model:
completion_params: {}
mode: chat
name: deepseek-chat
provider: langgenius/deepseek/deepseek
prompt_template:
- id: 28742294-85bb-4612-8e4e-6e590bb48c99
role: system
text: '<instructions>
You are a translator capable of translating multiple languages. Your task
is to accurately translate the given text from the source language to
the target language specified. Follow these steps to complete the task:
1. Identify the source language of the input text.
2. Translate the text into the target language specified.
3. Ensure that the translation maintains the original meaning and context.
4. Use proper grammar, punctuation, and syntax in the translated text.
5. Do not include any XML tags in the output.
Make sure to handle idiomatic expressions and cultural nuances appropriately.
If the input text contains any specialized terminology or jargon, ensure
that the translation reflects the correct terms in the target language.
</instructions>
<additional_instruction>
{{#1727245644467.text#}}
</additional_instruction>'
- id: 90c836a7-2dd0-4221-99b5-220ee47395fd
role: user
text: '{{#conversation.text#}}'
selected: false
title: LLM Translate
type: llm
variables: []
vision:
enabled: false
height: 88
id: '17272454043470'
position:
x: 942
y: 457.5
positionAbsolute:
x: 942
y: 457.5
selected: false
sourcePosition: right
targetPosition: left
type: custom
width: 243
- data:
answer: '{{#17272454043470.text#}}'
desc: ''
selected: false
title: Answer
type: answer
variables: []
height: 104
id: '1727245512406'
position:
x: 1246
y: 439
positionAbsolute:
x: 1246
y: 439
selected: false
sourcePosition: right
targetPosition: left
type: custom
width: 243
- data:
context:
enabled: false
variable_selector: []
desc: ''
memory:
query_prompt_template: '{{#sys.query#}}'
role_prefix:
assistant: ''
user: ''
window:
enabled: true
size: 15
model:
completion_params: {}
mode: chat
name: deepseek-chat
provider: langgenius/deepseek/deepseek
prompt_template:
- id: 1746f3a9-608a-462f-9532-34c71c38c8bb
role: system
text: '<instructions>
To complete the task of summarizing users'' requirements on translated
text in bullet points, follow these steps:
1. **Read the User''s Input**: Carefully read the user''s input to understand
their requirements, opinions on styles, and terms of translation.
2. **Identify Key Points**: Extract the key points from the user''s input.
Focus on specific requirements, preferences, and opinions related to the
translation.
3. **Summarize in Bullet Points**: Summarize the identified key points
in clear and concise bullet points. Ensure each bullet point addresses
a distinct requirement or opinion.
4. **Maintain Clarity and Brevity**: Ensure that the bullet points are
easy to understand and free from unnecessary details. Each point should
be brief and to the point.
5. **Avoid XML Tags in Output**: The final output should be free from
any XML tags. Only use bullet points to list the summarized requirements
and opinions.
Here are some examples to clarify the task further:
<examples>
<example>
<user_input>
I prefer the translation to maintain a formal tone. Also, please use the
term "client" instead of "customer". The translated text should be easy
to read and free from jargon.
</user_input>
<output>
- Maintain a formal tone in the translation.
- Use the term "client" instead of "customer".
- Ensure the translated text is easy to read.
- Avoid using jargon.
</output>
</example>
<example>
<user_input>
The translation should be culturally appropriate for a Japanese audience.
I would like the text to be concise and to the point. Please avoid using
slang or colloquial expressions.
</user_input>
<output>
- Ensure the translation is culturally appropriate for a Japanese audience.
- Make the text concise and to the point.
- Avoid using slang or colloquial expressions.
</output>
</example>
<example>
<user_input>
I want the translation to have a friendly and approachable tone. Use simple
language that can be understood by non-native speakers. Please ensure
technical terms are accurately translated.
</user_input>
<output>
- Use a friendly and approachable tone in the translation.
- Use simple language for non-native speakers.
- Ensure technical terms are accurately translated.
</output>
</example>
</examples>
</instructions>'
- id: 65bc0a91-f01d-481d-b86c-b07c75ad7b06
role: user
text: ''
selected: false
title: User Intent
type: llm
variables: []
vision:
enabled: false
height: 88
id: '1727245644467'
position:
x: 638
y: 439
positionAbsolute:
x: 638
y: 439
selected: true
sourcePosition: right
targetPosition: left
type: custom
width: 243
- data:
author: 'Dify '
desc: ''
height: 134
selected: false
showAuthor: true
text: '{"root":{"children":[{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"This
is where the workflow begins. The user is prompted to upload a document
and select the target language for translation.","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1,"textFormat":0}],"direction":"ltr","format":"","indent":0,"type":"root","version":1}}'
theme: blue
title: ''
type: ''
width: 244
height: 134
id: '1729515577873'
position:
x: 30
y: 121.42857142857143
positionAbsolute:
x: 30
y: 121.42857142857143
selected: false
sourcePosition: right
targetPosition: left
type: custom-note
width: 244
- data:
author: 'Dify '
desc: ''
height: 150
selected: false
showAuthor: true
text: '{"root":{"children":[{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"This
evaluates whether the workflow is on the first dialogue or a subsequent
one. It determines the next step based on the dialogue count.","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1,"textFormat":0}],"direction":"ltr","format":"","indent":0,"type":"root","version":1}}'
theme: blue
title: ''
type: ''
width: 240
height: 150
id: '1729515592502'
position:
x: 337.14285714285717
y: 517.1428571428572
positionAbsolute:
x: 337.14285714285717
y: 517.1428571428572
sourcePosition: right
targetPosition: left
type: custom-note
width: 240
- data:
author: 'Dify '
desc: ''
height: 137
selected: false
showAuthor: true
text: '{"root":{"children":[{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"Takes
the extracted text and assigns it to the ","type":"text","version":1},{"detail":0,"format":16,"mode":"normal","style":"","text":"conversation.text","type":"text","version":1},{"detail":0,"format":0,"mode":"normal","style":"","text":"
variable for further processing.","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1,"textFormat":0}],"direction":"ltr","format":"","indent":0,"type":"root","version":1}}'
theme: blue
title: ''
type: ''
width: 240
height: 137
id: '1729515609896'
position:
x: 942
y: 120
positionAbsolute:
x: 942
y: 120
selected: false
sourcePosition: right
targetPosition: left
type: custom-note
width: 240
- data:
author: 'Dify '
desc: ''
height: 116
selected: false
showAuthor: true
text: '{"root":{"children":[{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"Extracts
text from the uploaded document, preparing it for translation.","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1,"textFormat":0}],"direction":"ltr","format":"","indent":0,"type":"root","version":1}}'
theme: blue
title: ''
type: ''
width: 240
height: 116
id: '1729515625400'
position:
x: 638
y: 121.42857142857143
positionAbsolute:
x: 638
y: 121.42857142857143
selected: false
sourcePosition: right
targetPosition: left
type: custom-note
width: 240
- data:
author: 'Dify '
desc: ''
height: 139
selected: false
showAuthor: true
text: '{"root":{"children":[{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"This
node handles the translation of the extracted text using an AI language
model, based on the user''s selected target language.","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1,"textFormat":0}],"direction":"ltr","format":"","indent":0,"type":"root","version":1}}'
theme: blue
title: ''
type: ''
width: 242
height: 139
id: '1729515638942'
position:
x: 1548.5714285714287
y: 121.42857142857143
positionAbsolute:
x: 1548.5714285714287
y: 121.42857142857143
sourcePosition: right
targetPosition: left
type: custom-note
width: 242
- data:
author: 'Dify '
desc: ''
height: 103
selected: false
showAuthor: true
text: '{"root":{"children":[{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"Displays
the translated text to the user as the final output.","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1,"textFormat":0}],"direction":"ltr","format":"","indent":0,"type":"root","version":1}}'
theme: blue
title: ''
type: ''
width: 241
height: 103
id: '1729515841384'
position:
x: 1246
y: 121.42857142857143
positionAbsolute:
x: 1246
y: 121.42857142857143
selected: false
sourcePosition: right
targetPosition: left
type: custom-note
width: 241
- data:
author: 'Dify '
desc: ''
height: 290
selected: false
showAuthor: true
text: '{"root":{"children":[{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"The
","type":"text","version":1},{"detail":0,"format":1,"mode":"normal","style":"","text":"User
Intent Node","type":"text","version":1},{"detail":0,"format":0,"mode":"normal","style":"","text":"
is designed to interpret and summarize the user''s specific requirements
for the translation. It reads the user''s input, extracts key points such
as preferred tone, terminology, or style, and summarizes them in bullet
points. This helps the translation process ensure that the output aligns
with the user''s specific preferences, such as tone, language simplicity,
or cultural nuances.","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1,"textFormat":0}],"direction":"ltr","format":"","indent":0,"type":"root","version":1}}'
theme: blue
title: ''
type: ''
width: 257
height: 290
id: '1729515904656'
position:
x: 640
y: 587.1428571428572
positionAbsolute:
x: 640
y: 587.1428571428572
sourcePosition: right
targetPosition: left
type: custom-note
width: 257
- data:
author: 'Dify '
desc: ''
height: 117
selected: false
showAuthor: true
text: '{"root":{"children":[{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"Provides
the final translated output after refinement, completing the workflow.","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1,"textFormat":0}],"direction":"ltr","format":"","indent":0,"type":"root","version":1}}'
theme: blue
title: ''
type: ''
width: 240
height: 117
id: '1729515935481'
position:
x: 1854
y: 121.42857142857143
positionAbsolute:
x: 1854
y: 121.42857142857143
selected: false
sourcePosition: right
targetPosition: left
type: custom-note
width: 240
viewport:
x: 169.82058432148187
y: -69.45617563751324
zoom: 0.7937004741653179