如果工作流中包含交互节点,依然是调用该 API 接口,需要设置`detail=true`,并可以从`event=interactive`的数据中获取交互节点的配置信息。如果是`stream=false`,则可以从 choice 中获取`type=interactive`的元素,获取交互节点的选择信息。
...
...
@@ -559,69 +302,70 @@ event取值:
```json
{
"interactive": {
"type": "userSelect",
"params": {
"description": "测试",
"userSelectOptions": [
{
"value": "Confirm",
"key": "option1"
},
{
"value": "Cancel",
"key": "option2"
}
]
"interactive": {
"type": "userSelect",
"params": {
"description": "测试",
"userSelectOptions": [
{
"value": "Confirm",
"key": "option1"
},
{
"value": "Cancel",
"key": "option2"
}
]
}
}
}
```
</Tab>
<Tab value="表单输入">
```json
{
"interactive": {
"type": "userInput",
"params": {
"description": "测试",
"inputForm": [
{
"type": "input",
"key": "测试 1",
"label": "测试 1",
"description": "",
"value": "",
"defaultValue": "",
"valueType": "string",
"required": false,
"list": [
{
"label": "",
"value": ""
}
]
},
{
"type": "numberInput",
"key": "测试 2",
"label": "测试 2",
"description": "",
"value": "",
"defaultValue": "",
"valueType": "number",
"required": false,
"list": [
{
"label": "",
"value": ""
}
]
}
]
"interactive": {
"type": "userInput",
"params": {
"description": "测试",
"inputForm": [
{
"type": "input",
"key": "测试 1",
"label": "测试 1",
"description": "",
"value": "",
"defaultValue": "",
"valueType": "string",
"required": false,
"list": [
{
"label": "",
"value": ""
}
]
},
{
"type": "numberInput",
"key": "测试 2",
"label": "测试 2",
"description": "",
"value": "",
"defaultValue": "",
"valueType": "number",
"required": false,
"list": [
{
"label": "",
"value": ""
}
]
}
]
}
}
}
```
...
...
@@ -679,17 +423,15 @@ curl --location --request POST 'https://api.fastgpt.in/api/v1/chat/completions'
</Tab>
</Tabs>
## 请求插件
插件的接口与对话接口一致,仅请求参数略有区别,有以下规定:
* 调用插件类型的应用时,接口默认为`detail`模式。
* 无需传入 `chatId`,因为插件只能运行一轮。
* 无需传入`messages`。
* 通过传递`variables`来代表插件的输入。
* 通过获取`pluginData`来获取插件输出。
- 调用插件类型的应用时,接口默认为`detail`模式。
- 无需传入 `chatId`,因为插件只能运行一轮。
- 无需传入`messages`。
- 通过传递`variables`来代表插件的输入。
- 通过获取`pluginData`来获取插件输出。
### 请求示例
...
...
@@ -711,73 +453,73 @@ curl --location --request POST 'http://localhost:3000/api/v1/chat/completions' \
@@ -7,7 +7,7 @@ The FastGPT project is open-sourced under the Apache License 2.0, but includes t
- FastGPT may be used for commercial purposes, such as operating it as "backend-as-a-service" for other applications or providing it as an enterprise development platform. However, you must contact us to obtain a commercial license under the following circumstances:
- Multi-tenant SaaS Service: Unless explicit written authorization from FastGPT is obtained, you may not use the source code of tryfastgpt.ai to operate a multi-tenant SaaS service similar to tryfastgpt.ai.
- Multi-tenant SaaS Service: Unless explicit written authorization from FastGPT is obtained, you may not use the source code of fastgpt.io to operate a multi-tenant SaaS service similar to fastgpt.io.
- Logo and Copyright Information: You may not remove or modify the FastGPT logo or copyright information within the FastGPT console.
For commercial licensing inquiries, please contact us via email at dennis@sealos.io.