FastGPT icon indicating copy to clipboard operation
FastGPT copied to clipboard

用api的方法无法把应用和知识库绑定在一起

Open gith-u-b opened this issue 4 months ago • 2 comments

url: api/core/app/version/publish?appId=6710656fad1b40b46c7988fa

参数:

{
		"nodes": [
			{
				"nodeId": "userGuide",
				"name": "系统配置",
				"intro": "",
				"flowNodeType": "userGuide",
				"position": {
					"x": 531.2422736065552,
					"y": -486.7611729549753
				},
				"version": "481",
				"inputs": [],
				"outputs": []
			},
			{
				"nodeId": "workflowStartNodeId",
				"name": "流程开始",
				"intro": "",
				"avatar": "core/workflow/template/workflowStart",
				"flowNodeType": "workflowStart",
				"position": {
					"x": 558.4082376415505,
					"y": 123.72387429194112
				},
				"version": "481",
				"inputs": [
					{
						"key": "userChatInput",
						"renderTypeList": [
							"reference",
							"textarea"
						],
						"valueType": "string",
						"label": "workflow:user_question",
						"toolDescription": "workflow:user_question",
						"required": true
					}
				],
				"outputs": [
					{
						"id": "userChatInput",
						"key": "userChatInput",
						"label": "common:core.module.input.label.user question",
						"type": "static",
						"valueType": "string"
					},
					{
						"id": "userFiles",
						"key": "userFiles",
						"label": "app:workflow.user_file_input",
						"description": "app:workflow.user_file_input_desc",
						"type": "static",
						"valueType": "arrayString"
					}
				]
			},
			{
				"nodeId": "7BdojPlukIQw",
				"name": "AI 对话",
				"intro": "AI 大模型对话",
				"avatar": "core/workflow/template/aiChat",
				"flowNodeType": "chatNode",
				"showStatus": true,
				"position": {
					"x": 1106.3238387960757,
					"y": -350.6030674683474
				},
				"version": "481",
				"inputs": [
					{
						"key": "model",
						"renderTypeList": [
							"settingLLMModel",
							"reference"
						],
						"label": "",
						"valueType": "string",
						"value": "gpt-4o-mini"
					},
					{
						"key": "temperature",
						"renderTypeList": [
							"hidden"
						],
						"label": "",
						"value": 0,
						"valueType": "number",
						"min": 0,
						"max": 10,
						"step": 1
					},
					{
						"key": "maxToken",
						"renderTypeList": [
							"hidden"
						],
						"label": "",
						"value": 4000,
						"valueType": "number",
						"min": 100,
						"max": 4000,
						"step": 50
					},
					{
						"key": "isResponseAnswerText",
						"renderTypeList": [
							"hidden"
						],
						"label": "",
						"value": true,
						"valueType": "boolean"
					},
					{
						"key": "aiChatQuoteRole",
						"renderTypeList": [
							"hidden"
						],
						"label": "",
						"valueType": "string",
						"value": "system"
					},
					{
						"key": "quoteTemplate",
						"renderTypeList": [
							"hidden"
						],
						"label": "",
						"valueType": "string"
					},
					{
						"key": "quotePrompt",
						"renderTypeList": [
							"hidden"
						],
						"label": "",
						"valueType": "string"
					},
					{
						"key": "systemPrompt",
						"renderTypeList": [
							"textarea",
							"reference"
						],
						"max": 3000,
						"valueType": "string",
						"label": "core.ai.Prompt",
						"description": "core.app.tip.systemPromptTip",
						"placeholder": "core.app.tip.chatNodeSystemPromptTip",
						"value": ""
					},
					{
						"key": "history",
						"renderTypeList": [
							"numberInput",
							"reference"
						],
						"valueType": "chatHistory",
						"label": "core.module.input.label.chat history",
						"required": true,
						"min": 0,
						"max": 30,
						"value": 6
					},
					{
						"key": "userChatInput",
						"renderTypeList": [
							"reference",
							"textarea"
						],
						"valueType": "string",
						"label": "common:core.module.input.label.user question",
						"required": true,
						"toolDescription": "common:core.module.input.label.user question",
						"value": [
							"workflowStartNodeId",
							"userChatInput"
						]
					},
					{
						"key": "quoteQA",
						"renderTypeList": [
							"settingDatasetQuotePrompt"
						],
						"label": "",
						"debugLabel": "common:core.module.Dataset quote.label",
						"description": "",
						"valueType": "datasetQuote",
						"value": [
							"iKBoX2vIzETU",
							"quoteQA"
						]
					},
					{
						"key": "aiChatVision",
						"renderTypeList": [
							"hidden"
						],
						"label": "",
						"valueType": "boolean",
						"value": true
					}
				],
				"outputs": [
					{
						"id": "history",
						"key": "history",
						"required": true,
						"label": "common:core.module.output.label.New context",
						"description": "common:core.module.output.description.New context",
						"valueType": "chatHistory",
						"valueDesc": "{\n  obj: System | Human | AI;\n  value: string;\n}[]",
						"type": "static"
					},
					{
						"id": "answerText",
						"key": "answerText",
						"required": true,
						"label": "common:core.module.output.label.Ai response content",
						"description": "common:core.module.output.description.Ai response content",
						"valueType": "string",
						"type": "static"
					}
				]
			},
			{
				"nodeId": "iKBoX2vIzETU",
				"name": "知识库搜索",
				"intro": "调用“语义检索”和“全文检索”能力,从“知识库”中查找可能与问题相关的参考内容",
				"avatar": "core/workflow/template/datasetSearch",
				"flowNodeType": "datasetSearchNode",
				"showStatus": true,
				"position": {
					"x": 918.5901682164496,
					"y": -227.11542247619582
				},
				"version": "481",
				"inputs": [
					{
						"key": "datasets",
						"renderTypeList": [
							"selectDataset",
							"reference"
						],
						"label": "core.module.input.label.Select dataset",
						"value": [
							{
								"datasetId": "670e2c154ee371ab3d80096e"
							}
						],
						"valueType": "selectDataset",
						"list": [],
						"required": true
					},
					{
						"key": "similarity",
						"renderTypeList": [
							"selectDatasetParamsModal"
						],
						"label": "",
						"value": 0.4,
						"valueType": "number"
					},
					{
						"key": "limit",
						"renderTypeList": [
							"hidden"
						],
						"label": "",
						"value": 1500,
						"valueType": "number"
					},
					{
						"key": "searchMode",
						"renderTypeList": [
							"hidden"
						],
						"label": "",
						"valueType": "string",
						"value": "embedding"
					},
					{
						"key": "usingReRank",
						"renderTypeList": [
							"hidden"
						],
						"label": "",
						"valueType": "boolean",
						"value": false
					},
					{
						"key": "datasetSearchUsingExtensionQuery",
						"renderTypeList": [
							"hidden"
						],
						"label": "",
						"valueType": "boolean",
						"value": true
					},
					{
						"key": "datasetSearchExtensionModel",
						"renderTypeList": [
							"hidden"
						],
						"label": "",
						"valueType": "string"
					},
					{
						"key": "datasetSearchExtensionBg",
						"renderTypeList": [
							"hidden"
						],
						"label": "",
						"valueType": "string",
						"value": ""
					},
					{
						"key": "userChatInput",
						"renderTypeList": [
							"reference",
							"textarea"
						],
						"valueType": "string",
						"label": "workflow:user_question",
						"toolDescription": "workflow:content_to_search",
						"required": true,
						"value": [
							"workflowStartNodeId",
							"userChatInput"
						]
					}
				],
				"outputs": [
					{
						"id": "quoteQA",
						"key": "quoteQA",
						"label": "common:core.module.Dataset quote.label",
						"description": "workflow:special_array_format",
						"type": "static",
						"valueType": "datasetQuote",
						"valueDesc": "{\n  id: string;\n  datasetId: string;\n  collectionId: string;\n  sourceName: string;\n  sourceId?: string;\n  q: string;\n  a: string\n}[]"
					}
				]
			}
		],
		"edges": [
			{
				"source": "workflowStartNodeId",
				"target": "iKBoX2vIzETU",
				"sourceHandle": "workflowStartNodeId-source-right",
				"targetHandle": "iKBoX2vIzETU-target-left"
			},
			{
				"source": "iKBoX2vIzETU",
				"target": "7BdojPlukIQw",
				"sourceHandle": "iKBoX2vIzETU-source-right",
				"targetHandle": "7BdojPlukIQw-target-left"
			}
		],
		"chatConfig": {
		},
	  "isPublish": true,
	  "type": "simple",
	  "versionName": "2024-10-17 10:16:04"
	}

这里返回

{
	"code": 200,
	"statusText": "",
	"message": "",
	"data": {}
}

但是在页面并没有发生变化

image

我通过api/core/app/version/latest?appId=671065cdad1b40b46c79891e获取信息

{
	"code": 200,
	"statusText": "",
	"message": "",
	"data": {
		"versionId": "67107b64ad1b40b46c799295",
		"nodes": [
			{
				"nodeId": "userGuide",
				"name": "系统配置",
				"intro": "",
				"flowNodeType": "userGuide",
				"position": {
					"x": 531.2422736065552,
					"y": -486.7611729549753
				},
				"version": "481",
				"inputs": [],
				"outputs": []
			},
			{
				"nodeId": "workflowStartNodeId",
				"name": "流程开始",
				"intro": "",
				"avatar": "core/workflow/template/workflowStart",
				"flowNodeType": "workflowStart",
				"position": {
					"x": 558.4082376415505,
					"y": 123.72387429194112
				},
				"version": "481",
				"inputs": [
					{
						"key": "userChatInput",
						"renderTypeList": [
							"reference",
							"textarea"
						],
						"valueType": "string",
						"label": "workflow:user_question",
						"toolDescription": "workflow:user_question",
						"required": true
					}
				],
				"outputs": [
					{
						"id": "userChatInput",
						"key": "userChatInput",
						"label": "common:core.module.input.label.user question",
						"type": "static",
						"valueType": "string"
					},
					{
						"id": "userFiles",
						"key": "userFiles",
						"label": "app:workflow.user_file_input",
						"description": "app:workflow.user_file_input_desc",
						"type": "static",
						"valueType": "arrayString"
					}
				]
			},
			{
				"nodeId": "7BdojPlukIQw",
				"name": "AI 对话",
				"intro": "AI 大模型对话",
				"avatar": "core/workflow/template/aiChat",
				"flowNodeType": "chatNode",
				"showStatus": true,
				"position": {
					"x": 1106.3238387960757,
					"y": -350.6030674683474
				},
				"version": "481",
				"inputs": [
					{
						"key": "model",
						"renderTypeList": [
							"settingLLMModel",
							"reference"
						],
						"label": "",
						"valueType": "string",
						"value": "gpt-4o-mini"
					},
					{
						"key": "temperature",
						"renderTypeList": [
							"hidden"
						],
						"label": "",
						"value": 0,
						"valueType": "number",
						"min": 0,
						"max": 10,
						"step": 1
					},
					{
						"key": "maxToken",
						"renderTypeList": [
							"hidden"
						],
						"label": "",
						"value": 4000,
						"valueType": "number",
						"min": 100,
						"max": 4000,
						"step": 50
					},
					{
						"key": "isResponseAnswerText",
						"renderTypeList": [
							"hidden"
						],
						"label": "",
						"value": true,
						"valueType": "boolean"
					},
					{
						"key": "aiChatQuoteRole",
						"renderTypeList": [
							"hidden"
						],
						"label": "",
						"valueType": "string",
						"value": "system"
					},
					{
						"key": "quoteTemplate",
						"renderTypeList": [
							"hidden"
						],
						"label": "",
						"valueType": "string"
					},
					{
						"key": "quotePrompt",
						"renderTypeList": [
							"hidden"
						],
						"label": "",
						"valueType": "string"
					},
					{
						"key": "systemPrompt",
						"renderTypeList": [
							"textarea",
							"reference"
						],
						"max": 3000,
						"valueType": "string",
						"label": "core.ai.Prompt",
						"description": "core.app.tip.systemPromptTip",
						"placeholder": "core.app.tip.chatNodeSystemPromptTip",
						"value": ""
					},
					{
						"key": "history",
						"renderTypeList": [
							"numberInput",
							"reference"
						],
						"valueType": "chatHistory",
						"label": "core.module.input.label.chat history",
						"required": true,
						"min": 0,
						"max": 30,
						"value": 6
					},
					{
						"key": "userChatInput",
						"renderTypeList": [
							"reference",
							"textarea"
						],
						"valueType": "string",
						"label": "common:core.module.input.label.user question",
						"required": true,
						"toolDescription": "common:core.module.input.label.user question",
						"value": [
							"workflowStartNodeId",
							"userChatInput"
						]
					},
					{
						"key": "quoteQA",
						"renderTypeList": [
							"settingDatasetQuotePrompt"
						],
						"label": "",
						"debugLabel": "common:core.module.Dataset quote.label",
						"description": "",
						"valueType": "datasetQuote",
						"value": [
							"iKBoX2vIzETU",
							"quoteQA"
						]
					},
					{
						"key": "aiChatVision",
						"renderTypeList": [
							"hidden"
						],
						"label": "",
						"valueType": "boolean",
						"value": true
					}
				],
				"outputs": [
					{
						"id": "history",
						"key": "history",
						"required": true,
						"label": "common:core.module.output.label.New context",
						"description": "common:core.module.output.description.New context",
						"valueType": "chatHistory",
						"valueDesc": "{\n  obj: System | Human | AI;\n  value: string;\n}[]",
						"type": "static"
					},
					{
						"id": "answerText",
						"key": "answerText",
						"required": true,
						"label": "common:core.module.output.label.Ai response content",
						"description": "common:core.module.output.description.Ai response content",
						"valueType": "string",
						"type": "static"
					}
				]
			},
			{
				"nodeId": "iKBoX2vIzETU",
				"name": "知识库搜索",
				"intro": "调用“语义检索”和“全文检索”能力,从“知识库”中查找可能与问题相关的参考内容",
				"avatar": "core/workflow/template/datasetSearch",
				"flowNodeType": "datasetSearchNode",
				"showStatus": true,
				"position": {
					"x": 918.5901682164496,
					"y": -227.11542247619582
				},
				"version": "481",
				"inputs": [
					{
						"key": "datasets",
						"renderTypeList": [
							"selectDataset",
							"reference"
						],
						"label": "core.module.input.label.Select dataset",
						"value": [
							{
								"datasetId": "670e2c154ee371ab3d80096e"
							}
						],
						"valueType": "selectDataset",
						"list": [],
						"required": true
					},
					{
						"key": "similarity",
						"renderTypeList": [
							"selectDatasetParamsModal"
						],
						"label": "",
						"value": 0.4,
						"valueType": "number"
					},
					{
						"key": "limit",
						"renderTypeList": [
							"hidden"
						],
						"label": "",
						"value": 1500,
						"valueType": "number"
					},
					{
						"key": "searchMode",
						"renderTypeList": [
							"hidden"
						],
						"label": "",
						"valueType": "string",
						"value": "embedding"
					},
					{
						"key": "usingReRank",
						"renderTypeList": [
							"hidden"
						],
						"label": "",
						"valueType": "boolean",
						"value": false
					},
					{
						"key": "datasetSearchUsingExtensionQuery",
						"renderTypeList": [
							"hidden"
						],
						"label": "",
						"valueType": "boolean",
						"value": true
					},
					{
						"key": "datasetSearchExtensionModel",
						"renderTypeList": [
							"hidden"
						],
						"label": "",
						"valueType": "string"
					},
					{
						"key": "datasetSearchExtensionBg",
						"renderTypeList": [
							"hidden"
						],
						"label": "",
						"valueType": "string",
						"value": ""
					},
					{
						"key": "userChatInput",
						"renderTypeList": [
							"reference",
							"textarea"
						],
						"valueType": "string",
						"label": "workflow:user_question",
						"toolDescription": "workflow:content_to_search",
						"required": true,
						"value": [
							"workflowStartNodeId",
							"userChatInput"
						]
					}
				],
				"outputs": [
					{
						"id": "quoteQA",
						"key": "quoteQA",
						"label": "common:core.module.Dataset quote.label",
						"description": "workflow:special_array_format",
						"type": "static",
						"valueType": "datasetQuote",
						"valueDesc": "{\n  id: string;\n  datasetId: string;\n  collectionId: string;\n  sourceName: string;\n  sourceId?: string;\n  q: string;\n  a: string\n}[]"
					}
				]
			}
		],
		"edges": [
			{
				"source": "workflowStartNodeId",
				"target": "iKBoX2vIzETU",
				"sourceHandle": "workflowStartNodeId-source-right",
				"targetHandle": "iKBoX2vIzETU-target-left"
			},
			{
				"source": "iKBoX2vIzETU",
				"target": "7BdojPlukIQw",
				"sourceHandle": "iKBoX2vIzETU-source-right",
				"targetHandle": "7BdojPlukIQw-target-left"
			}
		],
		"chatConfig": {
			"variables": [],
			"_id": "67107b64ad1b40b46c799296"
		}
	}
}

gith-u-b avatar Oct 17 '24 03:10 gith-u-b