-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathCot.yml
844 lines (770 loc) · 21.5 KB
/
Cot.yml
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
843
844
app:
description: 通过工作流实现将复杂任务进行拆解成子问题,逐步解答子问题,最后聚合答案得到最终答案
icon: seedling
icon_background: '#D3F8DF'
mode: advanced-chat
name: 任务拆解
use_icon_as_answer_icon: true
kind: app
version: 0.1.2
workflow:
conversation_variables:
- description: 记录迭代过程中的数据,在循环过程中能看见前面的结果
id: d2f1ac13-3c10-44ea-8cf0-dbd752577b6a
name: subtaskRet
value: []
value_type: array[object]
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
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: 1728709838888-llm
selected: false
source: '1728709838888'
sourceHandle: source
target: llm
targetHandle: target
type: custom
- data:
isInIteration: false
sourceType: llm
targetType: parameter-extractor
id: llm-source-1728730008819-target
selected: false
source: llm
sourceHandle: source
target: '1728730008819'
targetHandle: target
type: custom
zIndex: 0
- data:
isInIteration: true
iteration_id: '1728709933523'
sourceType: iteration-start
targetType: code
id: 1728709933523start-source-1728730342984-target
selected: false
source: 1728709933523start
sourceHandle: source
target: '1728730342984'
targetHandle: target
type: custom
zIndex: 1002
- data:
isInIteration: true
iteration_id: '1728709933523'
sourceType: code
targetType: llm
id: 1728730342984-source-1728730552797-target
selected: false
source: '1728730342984'
sourceHandle: source
target: '1728730552797'
targetHandle: target
type: custom
zIndex: 1002
- data:
isInIteration: false
sourceType: llm
targetType: answer
id: 1728731078833-source-answer-target
selected: false
source: '1728731078833'
sourceHandle: source
target: answer
targetHandle: target
type: custom
zIndex: 0
- data:
isInIteration: true
iteration_id: '1728709933523'
sourceType: llm
targetType: code
id: 1728730552797-source-1728905920547-target
selected: false
source: '1728730552797'
sourceHandle: source
target: '1728905920547'
targetHandle: target
type: custom
zIndex: 1002
- data:
isInIteration: true
iteration_id: '1728709933523'
sourceType: code
targetType: assigner
id: 1728905920547-source-1728903932962-target
selected: false
source: '1728905920547'
sourceHandle: source
target: '1728903932962'
targetHandle: target
type: custom
zIndex: 1002
- data:
isInIteration: false
sourceType: iteration
targetType: code
id: 1728709933523-source-1728906342693-target
selected: false
source: '1728709933523'
sourceHandle: source
target: '1728906342693'
targetHandle: target
type: custom
zIndex: 0
- data:
isInIteration: false
sourceType: code
targetType: llm
id: 1728906342693-source-1728731078833-target
selected: false
source: '1728906342693'
sourceHandle: source
target: '1728731078833'
targetHandle: target
type: custom
zIndex: 0
- data:
isInIteration: false
sourceType: parameter-extractor
targetType: assigner
id: 1728730008819-source-1728907440113-target
selected: false
source: '1728730008819'
sourceHandle: source
target: '1728907440113'
targetHandle: target
type: custom
zIndex: 0
- data:
isInIteration: false
sourceType: assigner
targetType: iteration
id: 1728907440113-source-1728709933523-target
selected: false
source: '1728907440113'
sourceHandle: source
target: '1728709933523'
targetHandle: target
type: custom
zIndex: 0
nodes:
- data:
desc: ''
selected: false
title: 开始
type: start
variables: []
height: 54
id: '1728709838888'
position:
x: 30
y: 479
positionAbsolute:
x: 30
y: 479
selected: false
sourcePosition: right
targetPosition: left
type: custom
width: 244
- data:
context:
enabled: false
variable_selector: []
desc: ''
model:
completion_params:
frequency_penalty: 0.3
presence_penalty: 0.2
temperature: 0.5
top_p: 0.85
mode: chat
name: gpt-4o-2024-08-06
provider: openai
prompt_template:
- edition_type: basic
id: e9dc2802-a5f3-4e1c-bae6-92a80e0e3634
role: system
text: '# Role:问题拆解专家
## Goals:
对于用户提出的问题进行拆解,将复杂问题转换为多个字问题或步骤,便于后续解答
## Constrains:
1. 不要直接给出答案
2. 拆解步骤要保证逻辑严谨,逐步推导
3. 拆解完成后即结束对话, 不会询问是否有其它问题
4. 如果是简单问题,不要硬拆,按1个步骤处理
## Skills:
1. 具有强大的问题分析能力
2. 擅长将复杂问题拆解为简单子问题或步骤
## Workflows:
1. 分析问题,提取问题的最终目的
2. 分解问题为简单子问题或步骤。为每一个解题步骤提供简单清晰的名称,帮助理解解题过程的结构。对每个步骤的任务进行简洁描述,确保问题解决的路径逐步清晰。
3. 按照格式输出
## OutputFormat
"""
[{"step":"步骤名称","desc":"任务描述"}]
"""
## Example1
### input
2020年诺贝尔奖获得者的年龄
### output
"""
[{"step":"确定2020年诺贝尔奖的获奖者","desc":"我们需要查找2020年获得诺贝尔奖的所有获奖者的名单"},{"step":"收集获奖者的出生年份","desc":"从确定的获奖者名单中,收集每位获奖者的出生年份,以便后续计算他们的年龄。"},{"step":"计算每位获奖者的年龄","desc":"根据当前年份减去每位获奖者的出生年份,计算出他们各自的年龄。"}]
"""
## Example2
### input
9.11和9.8 这两个数字谁更大?
### output
"""
[{"step":"获得整数和小数部分","desc":"分别获取数字的整数部分和小数部分"},{"step":"比较整数部分","desc":"按整数比较大小"},{"step":"比较小数部分","desc":"按小数比较大小"}]
"""
'
- id: 4483f953-2d33-49e4-9bf5-14de82b86d71
role: user
text: '{{#sys.query#}}'
selected: false
title: 问题拆解
type: llm
variables: []
vision:
configs:
detail: high
enabled: false
height: 98
id: llm
position:
x: 334
y: 479
positionAbsolute:
x: 334
y: 479
selected: false
sourcePosition: right
targetPosition: left
type: custom
width: 244
- data:
answer: '------
## 最终结论
{{#1728731078833.text#}}'
desc: ''
selected: false
title: 直接回复
type: answer
variables: []
height: 119
id: answer
position:
x: 765.5049840078232
y: 1260.9163854849558
positionAbsolute:
x: 765.5049840078232
y: 1260.9163854849558
selected: false
sourcePosition: right
targetPosition: left
type: custom
width: 244
- data:
desc: ''
height: 558
iterator_selector:
- '1728730008819'
- step_array
output_selector:
- '1728730552797'
- text
output_type: array[string]
selected: false
start_node_id: 1728709933523start
title: 迭代
type: iteration
width: 1359
height: 558
id: '1728709933523'
position:
x: -24.890530274573962
y: 653.6339946135099
positionAbsolute:
x: -24.890530274573962
y: 653.6339946135099
selected: false
sourcePosition: right
targetPosition: left
type: custom
width: 1359
zIndex: 1
- data:
desc: ''
isInIteration: true
selected: false
title: ''
type: iteration-start
draggable: false
height: 48
id: 1728709933523start
parentId: '1728709933523'
position:
x: 24
y: 68
positionAbsolute:
x: -0.8905302745739618
y: 721.6339946135099
selectable: false
sourcePosition: right
targetPosition: left
type: custom-iteration-start
width: 44
zIndex: 1002
- data:
desc: ''
instruction: '提取内容中的步骤数组,按如下格式输出:
[ { "step":"步骤名称", "desc":"任务描述" }, { "step":"步骤名称", "desc":"任务描述" }, ...
]'
model:
completion_params:
temperature: 0.7
mode: chat
name: gpt-4o-mini
provider: openai
parameters:
- description: 提取内容中的步骤数组
name: step_array
required: true
type: array[object]
query:
- llm
- text
reasoning_mode: prompt
selected: false
title: 问题拆解后参数提取
type: parameter-extractor
variables: []
vision:
configs:
detail: high
variable_selector:
- sys
- files
enabled: false
height: 98
id: '1728730008819'
position:
x: 638
y: 479
positionAbsolute:
x: 638
y: 479
selected: false
sourcePosition: right
targetPosition: left
type: custom
width: 244
- data:
code: "\ndef main(step_obj: dict, subtaskRet: list, index: int) -> dict:\n\
\ step = step_obj[\"step\"]\n desc = step_obj[\"desc\"]\n subtaskStr\
\ = json.dumps(subtaskRet)\n return {\n \"step\": step,\n \
\ \"desc\": desc,\n \"subtaskStr\": subtaskStr,\n \"idx\"\
: index+1\n }\n"
code_language: python3
desc: ''
isInIteration: true
iteration_id: '1728709933523'
outputs:
desc:
children: null
type: string
idx:
children: null
type: number
step:
children: null
type: string
subtaskStr:
children: null
type: string
selected: false
title: 解析对象
type: code
variables:
- value_selector:
- '1728709933523'
- item
variable: step_obj
- value_selector:
- conversation
- subtaskRet
variable: subtaskRet
- value_selector:
- '1728709933523'
- index
variable: index
height: 54
id: '1728730342984'
parentId: '1728709933523'
position:
x: 128
y: 68
positionAbsolute:
x: 103.10946972542604
y: 721.6339946135099
selected: false
sourcePosition: right
targetPosition: left
type: custom
width: 244
zIndex: 1002
- data:
context:
enabled: true
variable_selector:
- '1728709933523'
- item
desc: ''
isInIteration: true
iteration_id: '1728709933523'
model:
completion_params:
frequency_penalty: 0.3
presence_penalty: 0.2
temperature: 0.5
top_p: 0.85
mode: chat
name: gpt-4o-mini
provider: openai
prompt_template:
- id: fbd3a380-635b-4076-ae77-d4f1aed749bd
role: system
text: '## 问题
{{#sys.query#}}
## 任务背景
问题已在前置流程中拆分为多个字问题或步骤
### 步骤
{{#llm.text#}}
### 已完成步骤的结果
{{#1728730342984.subtaskStr#}}
## 任务说明
根据已拆分的步骤,解答当前步骤的任务。
本次任务的名称是:{{#1728730342984.step#}}
任务描述为: {{#1728730342984.desc#}}
## 注意事项
- 你只需要分析并回答当前步骤的问题,而非整个问题。
- 当前步骤根据需要参考前面已完成步骤的结果。
## 输出要求
- 可以用markdown格式,但是不要使用标题格式,其他格式可以用
'
selected: false
title: 子任务处理
type: llm
variables: []
vision:
configs:
detail: high
enabled: false
height: 98
id: '1728730552797'
parentId: '1728709933523'
position:
x: 432
y: 68
positionAbsolute:
x: 407.10946972542604
y: 721.6339946135099
selected: false
sourcePosition: right
targetPosition: left
type: custom
width: 244
zIndex: 1002
- data:
context:
enabled: false
variable_selector: []
desc: ''
model:
completion_params:
frequency_penalty: 0.3
presence_penalty: 0.2
temperature: 0.5
top_p: 0.85
mode: chat
name: gpt-4o-2024-08-06
provider: openai
prompt_template:
- id: 6685b05c-5b71-4cfa-bfc3-1f9bfa8e86d2
role: system
text: '## 问题
{{#sys.query#}}
## 任务
查看原问题,并综合下面的分析,给出问题的最终正确答案。
分析过程
{{#1728906342693.result#}}
'
selected: false
title: 聚合回答
type: llm
variables: []
vision:
configs:
detail: high
enabled: false
height: 98
id: '1728731078833'
position:
x: 352.0842544601609
y: 1260.9163854849558
positionAbsolute:
x: 352.0842544601609
y: 1260.9163854849558
selected: false
sourcePosition: right
targetPosition: left
type: custom
width: 244
- data:
assigned_variable_selector:
- conversation
- subtaskRet
desc: ''
input_variable_selector:
- '1728905920547'
- result
isInIteration: true
iteration_id: '1728709933523'
selected: false
title: 变量赋值
type: assigner
write_mode: append
height: 132
id: '1728903932962'
parentId: '1728709933523'
position:
x: 1099
y: 164.68675776816406
positionAbsolute:
x: 1074.1094697254262
y: 818.320752381674
selected: false
sourcePosition: right
targetPosition: left
type: custom
width: 244
zIndex: 1002
- data:
code: "\ndef main(step: str, desc: str, ret: str) -> dict:\n return {\n\
\ \"result\": {\n 'step': step,\n 'desc': desc,\n\
\ 'ret': ret\n }\n }\n"
code_language: python3
desc: ''
isInIteration: true
iteration_id: '1728709933523'
outputs:
result:
children: null
type: object
selected: false
title: 聚合结果
type: code
variables:
- value_selector:
- '1728730342984'
- step
variable: step
- value_selector:
- '1728730342984'
- desc
variable: desc
- value_selector:
- '1728730552797'
- text
variable: ret
height: 54
id: '1728905920547'
parentId: '1728709933523'
position:
x: 796
y: 96.14285714285711
positionAbsolute:
x: 771.109469725426
y: 749.776851756367
selected: false
sourcePosition: right
targetPosition: left
type: custom
width: 244
zIndex: 1002
- data:
code: "\ndef main(subtaskRet: list) -> dict:\n ret = json.dumps(subtaskRet,\
\ ensure_ascii=False)\n result = \"\"\n idx = 1\n for item in subtaskRet:\n\
\ result += \"步骤\" + str(idx) + \":\" + item['desc'] + \"\\n结果\"\
\ + str(idx) + \":\" + item['ret'] + \"\\n\\n\"\n idx += 1\n return\
\ {\n \"result\": result,\n }\n"
code_language: python3
desc: ''
outputs:
result:
children: null
type: string
selected: false
title: 分析结果
type: code
variables:
- value_selector:
- conversation
- subtaskRet
variable: subtaskRet
height: 54
id: '1728906342693'
position:
x: 0.6342726976510562
y: 1260.9163854849558
positionAbsolute:
x: 0.6342726976510562
y: 1260.9163854849558
selected: false
sourcePosition: right
targetPosition: left
type: custom
width: 244
- data:
assigned_variable_selector:
- conversation
- subtaskRet
desc: ''
input_variable_selector: []
selected: false
title: 子任务结果清空
type: assigner
write_mode: clear
height: 132
id: '1728907440113'
position:
x: 942
y: 479
positionAbsolute:
x: 942
y: 479
selected: false
sourcePosition: right
targetPosition: left
type: custom
width: 244
- data:
author: pipi
desc: ''
height: 88
selected: false
showAuthor: true
text: '{"root":{"children":[{"children":[{"detail":0,"format":0,"mode":"normal","style":"font-size:
14px;","text":"2. 迭代处理子问题","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: 88
id: '1730610800029'
position:
x: -282.2442432909295
y: 698.3743920725884
positionAbsolute:
x: -282.2442432909295
y: 698.3743920725884
selected: false
sourcePosition: right
targetPosition: left
type: custom-note
width: 240
- data:
author: pipi
desc: ''
height: 88
selected: false
showAuthor: true
text: '{"root":{"children":[{"children":[{"detail":0,"format":0,"mode":"normal","style":"font-size:
14px;","text":"1. 问题拆解","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: 88
id: '1730610837359'
position:
x: -277.04177217437274
y: 492.4798953476681
positionAbsolute:
x: -277.04177217437274
y: 492.4798953476681
selected: true
sourcePosition: right
targetPosition: left
type: custom-note
width: 240
- data:
author: pipi
desc: ''
height: 88
selected: false
showAuthor: true
text: '{"root":{"children":[{"children":[{"detail":0,"format":0,"mode":"normal","style":"font-size:
14px;","text":"3. 聚合子问题答案得出最终结论","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: 88
id: '1730610853795'
position:
x: -282.2442432909295
y: 1260.9163854849558
positionAbsolute:
x: -282.2442432909295
y: 1260.9163854849558
selected: false
sourcePosition: right
targetPosition: left
type: custom-note
width: 240
viewport:
x: 402.0697205282904
y: -347.7195105915991
zoom: 0.8753349769720372