@tiger16601/n8n-nodes-fastgpt 1.1.5 → 1.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,574 +3,573 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.knowledgeFields = exports.knowledgeOperations = void 0;
4
4
  const GenericFunctions_1 = require("./GenericFunctions");
5
5
  exports.knowledgeOperations = [
6
- {
7
- displayName: 'Operation',
8
- name: 'operation',
9
- type: 'options',
10
- noDataExpression: true,
11
- displayOptions: {
12
- show: {
13
- resource: ['knowledge'],
14
- },
15
- },
16
- options: [
17
- {
18
- name: '获取知识库列表',
19
- value: '获取知识库列表',
20
- action: '获取知识库列表',
21
- description: '获取已经创建的知识库',
22
- routing: {
23
- request: {
24
- method: 'POST',
25
- url: '/core/dataset/list',
26
- // [FIX] 新FastGPT API: parentId需同时作为query string参数,body由字段routing.send处理
27
- qs: {
28
- parentId: '={{ $parameter.parentId }}',
29
- },
30
- },
31
- output: { postReceive: [GenericFunctions_1.sendErrorPostReceive] },
32
- },
33
- },
34
- {
35
- name: '获取知识库详情',
36
- value: '获取知识库详情',
37
- action: '获取知识库详情',
38
- description: '获取指定ID的知识库详情',
39
- routing: {
40
- request: {
41
- method: 'GET',
42
- url: '/core/dataset/detail',
43
- },
44
- output: { postReceive: [GenericFunctions_1.sendErrorPostReceive] },
45
- },
46
- },
47
- {
48
- name: '删除一个知识库',
49
- value: '删除一个知识库',
50
- action: '删除一个知识库',
51
- description: '删除指定ID的知识库',
52
- routing: {
53
- request: {
54
- method: 'DELETE',
55
- url: '/core/dataset/delete',
56
- },
57
- output: { postReceive: [GenericFunctions_1.sendErrorPostReceive] },
58
- },
59
- },
60
- {
61
- name: '创建一个知识库',
62
- value: '创建一个知识库',
63
- action: '创建一个知识库',
64
- description: '创建一个知识库或者文件夹',
65
- routing: {
66
- request: {
67
- method: 'POST',
68
- url: '/core/dataset/create',
69
- },
70
- output: { postReceive: [GenericFunctions_1.sendErrorPostReceive] },
71
- },
72
- },
73
- {
74
- name: '知识库检索',
75
- value: '知识库检索',
76
- action: '知识库检索',
77
- description: '在指定的知识库检索,返回知识库的召回结果',
78
- routing: {
79
- request: {
80
- method: 'POST',
81
- url: '/core/dataset/searchTest',
82
- },
83
- output: { postReceive: [GenericFunctions_1.sendErrorPostReceive] },
84
- },
85
- },
86
- // [FIX] 新增"创建训练订单"操作,对应FastGPT的createTrainingUsage API
87
- {
88
- name: '创建训练订单',
89
- value: '创建训练订单',
90
- action: '创建训练订单',
91
- description: '创建知识库训练订单,返回billId可用于添加知识库数据时进行账单聚合',
92
- routing: {
93
- request: {
94
- method: 'POST',
95
- url: '/support/wallet/usage/createTrainingUsage',
96
- },
97
- output: { postReceive: [GenericFunctions_1.sendErrorPostReceive] },
98
- },
99
- },
100
- ],
101
- default: '获取知识库列表',
6
+ {
7
+ displayName: "Operation",
8
+ name: "operation",
9
+ type: "options",
10
+ noDataExpression: true,
11
+ displayOptions: {
12
+ show: {
13
+ resource: ["knowledge"],
14
+ },
102
15
  },
16
+ options: [
17
+ {
18
+ name: "获取知识库列表",
19
+ value: "获取知识库列表",
20
+ action: "获取知识库列表",
21
+ description: "获取已经创建的知识库",
22
+ routing: {
23
+ request: {
24
+ method: "POST",
25
+ url: "/core/dataset/list",
26
+ // [FIX] 新FastGPT API: parentId需同时作为query string参数,body由字段routing.send处理
27
+ qs: {
28
+ parentId: "={{ $parameter.parentId }}",
29
+ },
30
+ },
31
+ output: { postReceive: [GenericFunctions_1.sendErrorPostReceive] },
32
+ },
33
+ },
34
+ {
35
+ name: "获取知识库详情",
36
+ value: "获取知识库详情",
37
+ action: "获取知识库详情",
38
+ description: "获取指定ID的知识库详情",
39
+ routing: {
40
+ request: {
41
+ method: "GET",
42
+ url: "/core/dataset/detail",
43
+ },
44
+ output: { postReceive: [GenericFunctions_1.sendErrorPostReceive] },
45
+ },
46
+ },
47
+ {
48
+ name: "删除一个知识库",
49
+ value: "删除一个知识库",
50
+ action: "删除一个知识库",
51
+ description: "删除指定ID的知识库",
52
+ routing: {
53
+ request: {
54
+ method: "DELETE",
55
+ url: "/core/dataset/delete",
56
+ },
57
+ output: { postReceive: [GenericFunctions_1.sendErrorPostReceive] },
58
+ },
59
+ },
60
+ {
61
+ name: "创建一个知识库",
62
+ value: "创建一个知识库",
63
+ action: "创建一个知识库",
64
+ description: "创建一个知识库或者文件夹",
65
+ routing: {
66
+ request: {
67
+ method: "POST",
68
+ url: "/core/dataset/create",
69
+ },
70
+ output: { postReceive: [GenericFunctions_1.sendErrorPostReceive] },
71
+ },
72
+ },
73
+ {
74
+ name: "知识库检索",
75
+ value: "知识库检索",
76
+ action: "知识库检索",
77
+ description: "在指定的知识库检索,返回知识库的召回结果",
78
+ routing: {
79
+ request: {
80
+ method: "POST",
81
+ url: "/core/dataset/searchTest",
82
+ },
83
+ output: { postReceive: [GenericFunctions_1.sendErrorPostReceive] },
84
+ },
85
+ },
86
+ // [FIX] 新增"创建训练订单"操作,对应FastGPT的createTrainingUsage API
87
+ {
88
+ name: "创建训练订单",
89
+ value: "创建训练订单",
90
+ action: "创建训练订单",
91
+ description:
92
+ "创建知识库训练订单,返回billId可用于添加知识库数据时进行账单聚合",
93
+ routing: {
94
+ request: {
95
+ method: "POST",
96
+ url: "/support/wallet/usage/createTrainingUsage",
97
+ },
98
+ output: { postReceive: [GenericFunctions_1.sendErrorPostReceive] },
99
+ },
100
+ },
101
+ ],
102
+ default: "获取知识库列表",
103
+ },
103
104
  ];
104
105
  const completeOperations = [
105
- // [FIX] 新增parentId字段,用于新FastGPT API获取知识库列表及创建知识库时指定父级知识库
106
- {
107
- displayName: '父级知识库ID',
108
- name: 'parentId',
109
- type: 'string',
110
- default: '',
111
- displayOptions: {
112
- show: {
113
- operation: ['获取知识库列表'],
114
- resource: ['knowledge'],
115
- },
116
- },
117
- description: '父级知识库ID,留空/null则代表根目录',
118
- routing: {
119
- send: {
120
- type: 'body',
121
- property: 'parentId',
122
- },
123
- },
106
+ // [FIX] 新增parentId字段,用于新FastGPT API获取知识库列表及创建知识库时指定父级知识库
107
+ {
108
+ displayName: "父级知识库ID",
109
+ name: "parentId",
110
+ type: "string",
111
+ default: "",
112
+ displayOptions: {
113
+ show: {
114
+ operation: ["获取知识库列表"],
115
+ resource: ["knowledge"],
116
+ },
124
117
  },
125
- {
126
- displayName: '知识库ID',
127
- name: 'knowledgeId',
128
- type: 'string',
129
- default: '',
130
- displayOptions: {
131
- show: {
132
- operation: ['获取知识库详情', '删除一个知识库'],
133
- resource: ['knowledge'],
134
- },
135
- },
136
- routing: {
137
- send: {
138
- type: 'query',
139
- property: 'id',
140
- },
141
- },
118
+ description: "父级知识库ID,留空/null则代表根目录",
119
+ routing: {
120
+ send: {
121
+ type: "body",
122
+ property: "parentId",
123
+ },
142
124
  },
143
- {
144
- displayName: '类型',
145
- // knowledgeType修改为type
146
- name: 'type',
147
- type: 'options',
148
- default: 'dataset',
149
- displayOptions: {
150
- show: {
151
- operation: ['创建一个知识库'],
152
- resource: ['knowledge'],
153
- },
154
- },
155
- options: [
156
- {
157
- name: '普通知识库',
158
- value: 'dataset',
159
- },
160
- {
161
- name: '文件夹',
162
- value: 'folder',
163
- },
164
- ],
165
- routing: {
166
- send: {
167
- type: 'body',
168
- property: 'type',
169
- },
170
- },
125
+ },
126
+ {
127
+ displayName: "知识库ID",
128
+ name: "knowledgeId",
129
+ type: "string",
130
+ default: "",
131
+ displayOptions: {
132
+ show: {
133
+ operation: ["获取知识库详情", "删除一个知识库"],
134
+ resource: ["knowledge"],
135
+ },
171
136
  },
172
- {
173
- displayName: '名称',
174
- name: 'knowledgeName',
175
- type: 'string',
176
- default: '',
177
- required: true,
178
- displayOptions: {
179
- show: {
180
- operation: ['创建一个知识库'],
181
- resource: ['knowledge'],
182
- },
183
- },
184
- routing: {
185
- send: {
186
- type: 'body',
187
- property: 'name',
188
- },
189
- },
137
+ routing: {
138
+ send: {
139
+ type: "query",
140
+ property: "id",
141
+ },
190
142
  },
191
- {
192
- displayName: '简介',
193
- name: 'knowledgeIntro',
194
- type: 'string',
195
- default: '',
196
- displayOptions: {
197
- show: {
198
- operation: ['创建一个知识库'],
199
- resource: ['knowledge'],
200
- },
201
- },
202
- routing: {
203
- send: {
204
- type: 'body',
205
- property: 'intro',
206
- },
207
- },
143
+ },
144
+ {
145
+ displayName: "类型",
146
+ // knowledgeType修改为type
147
+ name: "type",
148
+ type: "options",
149
+ default: "dataset",
150
+ displayOptions: {
151
+ show: {
152
+ operation: ["创建一个知识库"],
153
+ resource: ["knowledge"],
154
+ },
208
155
  },
209
- {
210
- displayName: '选择知识库',
211
- name: 'knowledgeDatasetId',
212
- type: 'options',
213
- default: '',
214
- displayOptions: {
215
- show: {
216
- operation: ['知识库检索'],
217
- resource: ['knowledge'],
218
- },
219
- },
220
- typeOptions: {
221
- loadOptions: {
222
- routing: {
223
- request: {
224
- // [FIX] 新FastGPT API: 改为POST,parentId需同时作为query string和body参数
225
- method: 'POST',
226
- url: '/core/dataset/list',
227
- qs: {
228
- parentId: '',
229
- },
230
- body: {
231
- parentId: '',
232
- },
233
- },
234
- output: {
235
- postReceive: [
236
- {
237
- type: 'rootProperty',
238
- properties: {
239
- property: 'data',
240
- },
241
- },
242
- {
243
- type: 'filter',
244
- properties: {
245
- pass: "={{ $responseItem.type === 'dataset' }}",
246
- },
247
- },
248
- {
249
- type: 'setKeyValue',
250
- properties: {
251
- name: '={{$responseItem.name}}',
252
- value: '={{$responseItem._id}}',
253
- },
254
- },
255
- {
256
- type: 'sort',
257
- properties: {
258
- key: 'name',
259
- },
260
- },
261
- ],
262
- },
263
- },
264
- },
265
- },
266
- routing: {
267
- send: {
268
- type: 'body',
269
- property: 'datasetId',
270
- },
271
- },
156
+ options: [
157
+ {
158
+ name: "普通知识库",
159
+ value: "dataset",
160
+ },
161
+ {
162
+ name: "文件夹",
163
+ value: "folder",
164
+ },
165
+ ],
166
+ routing: {
167
+ send: {
168
+ type: "body",
169
+ property: "type",
170
+ },
272
171
  },
273
- {
274
- displayName: '检索文本',
275
- name: 'knowledgeSearchText',
276
- type: 'string',
277
- default: '',
278
- displayOptions: {
279
- show: {
280
- operation: ['知识库检索'],
281
- resource: ['knowledge'],
282
- },
283
- },
284
- routing: {
285
- send: {
286
- type: 'body',
287
- property: 'text',
288
- },
289
- },
172
+ },
173
+ {
174
+ displayName: "名称",
175
+ name: "knowledgeName",
176
+ type: "string",
177
+ default: "",
178
+ required: true,
179
+ displayOptions: {
180
+ show: {
181
+ operation: ["创建一个知识库"],
182
+ resource: ["knowledge"],
183
+ },
290
184
  },
291
- {
292
- displayName: '最大Tokens数量',
293
- name: 'knowledgeSearchLimit',
294
- type: 'number',
295
- default: 5000,
296
- displayOptions: {
297
- show: {
298
- operation: ['知识库检索'],
299
- resource: ['knowledge'],
300
- },
301
- },
302
- routing: {
303
- send: {
304
- type: 'body',
305
- property: 'limit',
306
- },
307
- },
185
+ routing: {
186
+ send: {
187
+ type: "body",
188
+ property: "name",
189
+ },
308
190
  },
309
- {
310
- displayName: '最低相关度',
311
- name: 'knowledgeSearchSimilarity',
312
- type: 'number',
313
- default: 0,
314
- typeOptions: {
315
- maxValue: 1,
316
- minValue: 0
317
- },
318
- displayOptions: {
319
- show: {
320
- operation: ['知识库检索'],
321
- resource: ['knowledge'],
322
- },
323
- },
324
- routing: {
325
- send: {
326
- type: 'body',
327
- property: 'similarity',
328
- },
329
- },
191
+ },
192
+ {
193
+ displayName: "简介",
194
+ name: "knowledgeIntro",
195
+ type: "string",
196
+ default: "",
197
+ displayOptions: {
198
+ show: {
199
+ operation: ["创建一个知识库"],
200
+ resource: ["knowledge"],
201
+ },
330
202
  },
331
- {
332
- displayName: '类型',
333
- name: 'knowledgeDatasetSearchMode',
334
- type: 'options',
335
- default: 'embedding',
336
- required: true,
337
- displayOptions: {
338
- show: {
339
- operation: ['知识库检索'],
340
- resource: ['knowledge'],
341
- },
342
- },
343
- options: [
344
- {
345
- name: '语义检索',
346
- value: 'embedding',
347
- description: '使用向量进行文本相关性查询'
348
- },
349
- {
350
- name: '全文检索',
351
- value: 'fullTextRecall',
352
- description: '使用传统的全文检索,适合查找一些关键词和主谓语特殊的数据'
353
- },
354
- {
355
- name: '混合检索',
356
- value: 'mixedRecall',
357
- description: '使用向量检索与全文检索的综合结果返回,使用 RRF 算法进行排序。'
358
- },
359
- ],
360
- routing: {
361
- send: {
362
- type: 'body',
363
- property: 'searchMode',
364
- },
365
- },
203
+ routing: {
204
+ send: {
205
+ type: "body",
206
+ property: "intro",
207
+ },
366
208
  },
367
- {
368
- displayName: '使用ReRank',
369
- name: 'knowledgeSearchReRank',
370
- type: 'boolean',
371
- default: false,
372
- displayOptions: {
373
- show: {
374
- operation: ['知识库检索'],
375
- resource: ['knowledge'],
376
- },
377
- },
378
- routing: {
379
- send: {
380
- type: 'body',
381
- property: 'usingReRank',
382
- },
383
- },
209
+ },
210
+ {
211
+ displayName: "选择知识库",
212
+ name: "knowledgeDatasetId",
213
+ type: "options",
214
+ default: "",
215
+ displayOptions: {
216
+ show: {
217
+ operation: ["知识库检索"],
218
+ resource: ["knowledge"],
219
+ },
384
220
  },
385
- // FIX: 新增知识库检索的问题优化相关字段
386
- {
387
- displayName: '使用问题优化',
388
- name: 'knowledgeSearchExtensionQuery',
389
- type: 'boolean',
390
- default: false,
391
- description: '启用问题优化,对检索文本进行改写以提升召回率',
392
- displayOptions: {
393
- show: {
394
- operation: ['知识库检索'],
395
- resource: ['knowledge'],
396
- },
397
- },
221
+ typeOptions: {
222
+ loadOptions: {
398
223
  routing: {
399
- send: {
400
- type: 'body',
401
- property: 'datasetSearchUsingExtensionQuery',
402
- },
224
+ request: {
225
+ // [FIX] 新FastGPT API: 改为POST,parentId需同时作为query string和body参数
226
+ method: "POST",
227
+ url: "/core/dataset/list",
228
+ qs: {
229
+ parentId: "",
230
+ },
231
+ body: {
232
+ parentId: "",
233
+ },
234
+ },
235
+ output: {
236
+ postReceive: [
237
+ {
238
+ type: "rootProperty",
239
+ properties: {
240
+ property: "data",
241
+ },
242
+ },
243
+ {
244
+ type: "filter",
245
+ properties: {
246
+ pass: "={{ $responseItem.type === 'dataset' }}",
247
+ },
248
+ },
249
+ {
250
+ type: "setKeyValue",
251
+ properties: {
252
+ name: "={{$responseItem.name}}",
253
+ value: "={{$responseItem._id}}",
254
+ },
255
+ },
256
+ {
257
+ type: "sort",
258
+ properties: {
259
+ key: "name",
260
+ },
261
+ },
262
+ ],
263
+ },
403
264
  },
265
+ },
404
266
  },
405
- {
406
- displayName: '问题优化模型',
407
- name: 'knowledgeSearchExtensionModel',
408
- type: 'string',
409
- default: '',
410
- description: '用于问题优化的模型,如:gpt-5。需先启用"使用问题优化"',
411
- displayOptions: {
412
- show: {
413
- operation: ['知识库检索'],
414
- resource: ['knowledge'],
415
- },
416
- },
417
- routing: {
418
- send: {
419
- type: 'body',
420
- property: 'datasetSearchExtensionModel',
421
- },
422
- },
267
+ routing: {
268
+ send: {
269
+ type: "body",
270
+ property: "datasetId",
271
+ },
423
272
  },
424
- {
425
- displayName: '问题优化背景',
426
- name: 'knowledgeSearchExtensionBg',
427
- type: 'string',
428
- default: '',
429
- description: '问题优化的背景描述,用于帮助模型更好地理解上下文',
430
- displayOptions: {
431
- show: {
432
- operation: ['知识库检索'],
433
- resource: ['knowledge'],
434
- },
435
- },
436
- routing: {
437
- send: {
438
- type: 'body',
439
- property: 'datasetSearchExtensionBg',
440
- },
441
- },
273
+ },
274
+ {
275
+ displayName: "检索文本",
276
+ name: "knowledgeSearchText",
277
+ type: "string",
278
+ default: "",
279
+ displayOptions: {
280
+ show: {
281
+ operation: ["知识库检索"],
282
+ resource: ["knowledge"],
283
+ },
442
284
  },
443
- // [FIX] 新增"创建训练订单"相关字段
444
- {
445
- displayName: '知识库ID',
446
- name: 'trainingDatasetId',
447
- type: 'string',
448
- default: '',
449
- required: true,
450
- displayOptions: {
451
- show: {
452
- operation: ['创建训练订单'],
453
- resource: ['knowledge'],
454
- },
455
- },
456
- routing: {
457
- send: {
458
- type: 'body',
459
- property: 'datasetId',
460
- },
461
- },
285
+ routing: {
286
+ send: {
287
+ type: "body",
288
+ property: "text",
289
+ },
462
290
  },
463
- {
464
- displayName: '订单名称',
465
- name: 'trainingName',
466
- type: 'string',
467
- default: '',
468
- displayOptions: {
469
- show: {
470
- operation: ['创建训练订单'],
471
- resource: ['knowledge'],
472
- },
473
- },
474
- description: '可选,自定义订单名称,例如:文档训练-fastgpt.docx',
475
- routing: {
476
- send: {
477
- type: 'body',
478
- property: 'name',
479
- },
480
- },
291
+ },
292
+ {
293
+ displayName: "最大Tokens数量",
294
+ name: "knowledgeSearchLimit",
295
+ type: "number",
296
+ default: 5000,
297
+ displayOptions: {
298
+ show: {
299
+ operation: ["知识库检索"],
300
+ resource: ["knowledge"],
301
+ },
302
+ },
303
+ routing: {
304
+ send: {
305
+ type: "body",
306
+ property: "limit",
307
+ },
308
+ },
309
+ },
310
+ {
311
+ displayName: "最低相关度",
312
+ name: "knowledgeSearchSimilarity",
313
+ type: "number",
314
+ default: 0,
315
+ typeOptions: {
316
+ maxValue: 1,
317
+ minValue: 0,
318
+ },
319
+ displayOptions: {
320
+ show: {
321
+ operation: ["知识库检索"],
322
+ resource: ["knowledge"],
323
+ },
324
+ },
325
+ routing: {
326
+ send: {
327
+ type: "body",
328
+ property: "similarity",
329
+ },
330
+ },
331
+ },
332
+ {
333
+ displayName: "类型",
334
+ name: "knowledgeDatasetSearchMode",
335
+ type: "options",
336
+ default: "embedding",
337
+ required: true,
338
+ displayOptions: {
339
+ show: {
340
+ operation: ["知识库检索"],
341
+ resource: ["knowledge"],
342
+ },
343
+ },
344
+ options: [
345
+ {
346
+ name: "语义检索",
347
+ value: "embedding",
348
+ description: "使用向量进行文本相关性查询",
349
+ },
350
+ {
351
+ name: "全文检索",
352
+ value: "fullTextRecall",
353
+ description: "使用传统的全文检索,适合查找一些关键词和主谓语特殊的数据",
354
+ },
355
+ {
356
+ name: "混合检索",
357
+ value: "mixedRecall",
358
+ description:
359
+ "使用向量检索与全文检索的综合结果返回,使用 RRF 算法进行排序。",
360
+ },
361
+ ],
362
+ routing: {
363
+ send: {
364
+ type: "body",
365
+ property: "searchMode",
366
+ },
367
+ },
368
+ },
369
+ {
370
+ displayName: "使用ReRank",
371
+ name: "knowledgeSearchReRank",
372
+ type: "boolean",
373
+ default: false,
374
+ displayOptions: {
375
+ show: {
376
+ operation: ["知识库检索"],
377
+ resource: ["knowledge"],
378
+ },
379
+ },
380
+ routing: {
381
+ send: {
382
+ type: "body",
383
+ property: "usingReRank",
384
+ },
385
+ },
386
+ },
387
+ // FIX: 新增知识库检索的问题优化相关字段
388
+ {
389
+ displayName: "使用问题优化",
390
+ name: "knowledgeSearchExtensionQuery",
391
+ type: "boolean",
392
+ default: false,
393
+ description: "启用问题优化,对检索文本进行改写以提升召回率",
394
+ displayOptions: {
395
+ show: {
396
+ operation: ["知识库检索"],
397
+ resource: ["knowledge"],
398
+ },
399
+ },
400
+ routing: {
401
+ send: {
402
+ type: "body",
403
+ property: "datasetSearchUsingExtensionQuery",
404
+ },
405
+ },
406
+ },
407
+ {
408
+ displayName: "问题优化模型",
409
+ name: "knowledgeSearchExtensionModel",
410
+ type: "string",
411
+ default: "",
412
+ description: '用于问题优化的模型,如:gpt-5。需先启用"使用问题优化"',
413
+ displayOptions: {
414
+ show: {
415
+ operation: ["知识库检索"],
416
+ resource: ["knowledge"],
417
+ },
418
+ },
419
+ routing: {
420
+ send: {
421
+ type: "body",
422
+ property: "datasetSearchExtensionModel",
423
+ },
424
+ },
425
+ },
426
+ {
427
+ displayName: "问题优化背景",
428
+ name: "knowledgeSearchExtensionBg",
429
+ type: "string",
430
+ default: "",
431
+ description: "问题优化的背景描述,用于帮助模型更好地理解上下文",
432
+ displayOptions: {
433
+ show: {
434
+ operation: ["知识库检索"],
435
+ resource: ["knowledge"],
436
+ },
437
+ },
438
+ routing: {
439
+ send: {
440
+ type: "body",
441
+ property: "datasetSearchExtensionBg",
442
+ },
443
+ },
444
+ },
445
+ // [FIX] 新增"创建训练订单"相关字段
446
+ {
447
+ displayName: "知识库ID",
448
+ name: "trainingDatasetId",
449
+ type: "string",
450
+ default: "",
451
+ required: true,
452
+ displayOptions: {
453
+ show: {
454
+ operation: ["创建训练订单"],
455
+ resource: ["knowledge"],
456
+ },
457
+ },
458
+ routing: {
459
+ send: {
460
+ type: "body",
461
+ property: "datasetId",
462
+ },
463
+ },
464
+ },
465
+ {
466
+ displayName: "订单名称",
467
+ name: "trainingName",
468
+ type: "string",
469
+ default: "",
470
+ displayOptions: {
471
+ show: {
472
+ operation: ["创建训练订单"],
473
+ resource: ["knowledge"],
474
+ },
475
+ },
476
+ description: "可选,自定义订单名称,例如:文档训练-fastgpt.docx",
477
+ routing: {
478
+ send: {
479
+ type: "body",
480
+ property: "name",
481
+ },
481
482
  },
483
+ },
482
484
  ];
483
485
  const sharedOperations = [
484
- {
485
- displayName: '选项',
486
- name: 'options',
487
- placeholder: '添加选项',
488
- description: 'Additional options to add',
489
- type: 'collection',
490
- default: {},
486
+ {
487
+ displayName: "选项",
488
+ name: "options",
489
+ placeholder: "添加选项",
490
+ description: "Additional options to add",
491
+ type: "collection",
492
+ default: {},
493
+ displayOptions: {
494
+ show: {
495
+ operation: ["创建一个知识库"],
496
+ resource: ["knowledge"],
497
+ },
498
+ },
499
+ options: [
500
+ // [新增] 可选参数:头像、向量模型、文本处理模型、图片理解模型
501
+ {
502
+ displayName: "父级知识库ID",
503
+ name: "parentId",
504
+ type: "string",
505
+ default: "",
491
506
  displayOptions: {
492
- show: {
493
- operation: ['创建一个知识库'],
494
- resource: ['knowledge'],
495
- },
507
+ show: {
508
+ "/operation": ["创建一个知识库"],
509
+ "/resource": ["knowledge"],
510
+ },
496
511
  },
497
- options: [
498
- // [新增] 可选参数:头像、向量模型、文本处理模型、图片理解模型
499
- {
500
- displayName: '父级知识库ID',
501
- name: 'parentId',
502
- type: 'string',
503
- default: '',
504
- displayOptions: {
505
- show: {
506
- '/operation': ['创建一个知识库'],
507
- '/resource': ['knowledge'],
508
- },
509
- },
510
- routing: {
511
- send: {
512
- type: 'body',
513
- property: 'parentId',
514
- },
515
- },
516
- },
517
- {
518
- displayName: '头像地址',
519
- name: 'knowledgeAvatar',
520
- type: 'string',
521
- default: '',
522
- description: '知识库头像的URL地址,可选',
523
- routing: {
524
- send: {
525
- type: 'body',
526
- property: 'avatar',
527
- },
528
- },
529
- },
530
- {
531
- displayName: '向量模型',
532
- name: 'knowledgeVectorModel',
533
- type: 'string',
534
- default: '',
535
- description: '建议留空使用系统默认。例如:text-embedding-ada-002',
536
- routing: {
537
- send: {
538
- type: 'body',
539
- property: 'vectorModel',
540
- },
541
- },
542
- },
543
- {
544
- displayName: '文本处理模型',
545
- name: 'knowledgeAgentModel',
546
- type: 'string',
547
- default: '',
548
- description: '建议留空使用系统默认。例如:gpt-3.5-turbo-16k',
549
- routing: {
550
- send: {
551
- type: 'body',
552
- property: 'agentModel',
553
- },
554
- },
555
- },
556
- {
557
- displayName: '图片理解模型',
558
- name: 'knowledgeVlmModel',
559
- type: 'string',
560
- default: '',
561
- description: '建议留空使用系统默认。例如:gpt-4.1',
562
- routing: {
563
- send: {
564
- type: 'body',
565
- property: 'vlmModel',
566
- },
567
- },
568
- },
569
- ],
570
- },
571
- ];
572
- exports.knowledgeFields = [
573
- ...completeOperations,
574
- ...sharedOperations,
512
+ routing: {
513
+ send: {
514
+ type: "body",
515
+ property: "parentId",
516
+ },
517
+ },
518
+ },
519
+ {
520
+ displayName: "头像地址",
521
+ name: "avatar",
522
+ type: "string",
523
+ default: "",
524
+ description: "知识库头像的URL地址,可选",
525
+ routing: {
526
+ send: {
527
+ type: "body",
528
+ property: "avatar",
529
+ },
530
+ },
531
+ },
532
+ {
533
+ displayName: "向量模型",
534
+ name: "vectorModel",
535
+ type: "string",
536
+ default: "",
537
+ description: "建议留空使用系统默认。例如:text-embedding-ada-002",
538
+ routing: {
539
+ send: {
540
+ type: "body",
541
+ property: "vectorModel",
542
+ },
543
+ },
544
+ },
545
+ {
546
+ displayName: "文本处理模型",
547
+ name: "agentModel",
548
+ type: "string",
549
+ default: "",
550
+ description: "建议留空使用系统默认。例如:gpt-3.5-turbo-16k",
551
+ routing: {
552
+ send: {
553
+ type: "body",
554
+ property: "agentModel",
555
+ },
556
+ },
557
+ },
558
+ {
559
+ displayName: "图片理解模型",
560
+ name: "vlmModel",
561
+ type: "string",
562
+ default: "",
563
+ description: "建议留空使用系统默认。例如:gpt-4.1",
564
+ routing: {
565
+ send: {
566
+ type: "body",
567
+ property: "vlmModel",
568
+ },
569
+ },
570
+ },
571
+ ],
572
+ },
575
573
  ];
576
- //# sourceMappingURL=KnowledgeDescription.js.map
574
+ exports.knowledgeFields = [...completeOperations, ...sharedOperations];
575
+ //# sourceMappingURL=KnowledgeDescription.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tiger16601/n8n-nodes-fastgpt",
3
- "version": "1.1.5",
3
+ "version": "1.1.6",
4
4
  "description": "Fastgpt智能问答",
5
5
  "keywords": [
6
6
  "n8n-community-node-package",