mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-23 05:12:39 +00:00
Perf input guide (#1557)
* perf: input guide code * perf: input guide ui * Chat input guide api * Update app chat config store * perf: app chat config field * perf: app context * perf: params * fix: ts * perf: filter private config * perf: filter private config * perf: import workflow * perf: limit max tip amount
This commit is contained in:
48
docSite/content/docs/course/chat_input_guide.md
Normal file
48
docSite/content/docs/course/chat_input_guide.md
Normal file
@@ -0,0 +1,48 @@
|
||||
---
|
||||
title: "对话问题引导"
|
||||
description: "FastGPT 对话问题引导"
|
||||
icon: "code"
|
||||
draft: false
|
||||
toc: true
|
||||
weight: 350
|
||||
---
|
||||
|
||||

|
||||
|
||||
## 什么是自定义问题引导
|
||||
|
||||
你可以为你的应用提前预设一些问题,用户在输入时,会根据输入的内容,动态搜索这些问题作为提示,从而引导用户更快的进行提问。
|
||||
|
||||
你可以直接在 FastGPT 中配置词库,或者提供自定义词库接口。
|
||||
|
||||
## 自定义词库接口
|
||||
|
||||
**请求:**
|
||||
|
||||
```bash
|
||||
curl --location --request GET 'http://localhost:3000/api/core/chat/inputGuide/query?appId=663c75302caf8315b1c00194&searchKey=你'
|
||||
```
|
||||
|
||||
**响应**
|
||||
|
||||
```json
|
||||
{
|
||||
"code": 200,
|
||||
"statusText": "",
|
||||
"message": "",
|
||||
"data": [
|
||||
"是你",
|
||||
"你是谁呀",
|
||||
"你好好呀",
|
||||
"你好呀",
|
||||
"你是谁!",
|
||||
"你好"
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
**参数说明:**
|
||||
|
||||
- appId - 应用ID
|
||||
- searchKey - 搜索关键字
|
@@ -1,43 +0,0 @@
|
||||
---
|
||||
title: "自定义词库地址"
|
||||
description: "FastGPT 自定义输入提示的接口地址"
|
||||
icon: "code"
|
||||
draft: false
|
||||
toc: true
|
||||
weight: 350
|
||||
---
|
||||
|
||||

|
||||
|
||||
## 什么是输入提示
|
||||
可自定义开启或关闭,当输入提示开启,并且词库中存在数据时,用户在输入问题时如果输入命中词库,那么会在输入框上方展示对应的智能推荐数据
|
||||
|
||||
用户可配置词库,选择存储在 FastGPT 数据库中,或者提供自定义接口获取词库
|
||||
|
||||
## 数据格式
|
||||
词库的形式为一个字符串数组,定义的词库接口应该有两种方法 —— GET & POST
|
||||
|
||||
### GET
|
||||
对于 GET 方法,用于获取词库数据,FastGPT 会给接口发送数据 query 为
|
||||
```
|
||||
{
|
||||
appId: 'xxxx'
|
||||
}
|
||||
```
|
||||
返回数据格式应当为
|
||||
```
|
||||
{
|
||||
data: ['xxx', 'xxxx']
|
||||
}
|
||||
```
|
||||
|
||||
### POST
|
||||
对于 POST 方法,用于更新词库数据,FastGPT 会给接口发送数据 body 为
|
||||
```
|
||||
{
|
||||
appId: 'xxxx',
|
||||
text: ['xxx', 'xxxx']
|
||||
}
|
||||
```
|
||||
接口应当按照获取的数据格式存储相对应的词库数组
|
||||
|
Reference in New Issue
Block a user