-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: question guide * fix * fix * fix * change interface * fix
- Loading branch information
1 parent
fd31a0b
commit e35ce2c
Showing
40 changed files
with
1,071 additions
and
34 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
--- | ||
title: "自定义词库地址" | ||
description: "FastGPT 自定义输入提示的接口地址" | ||
icon: "code" | ||
draft: false | ||
toc: true | ||
weight: 350 | ||
--- | ||
|
||
![](/imgs/questionGuide.png) | ||
|
||
## 什么是输入提示 | ||
可自定义开启或关闭,当输入提示开启,并且词库中存在数据时,用户在输入问题时如果输入命中词库,那么会在输入框上方展示对应的智能推荐数据 | ||
|
||
用户可配置词库,选择存储在 FastGPT 数据库中,或者提供自定义接口获取词库 | ||
|
||
## 数据格式 | ||
词库的形式为一个字符串数组,定义的词库接口应该有两种方法 —— GET & POST | ||
|
||
### GET | ||
对于 GET 方法,用于获取词库数据,FastGPT 会给接口发送数据 query 为 | ||
``` | ||
{ | ||
appId: 'xxxx' | ||
} | ||
``` | ||
返回数据格式应当为 | ||
``` | ||
{ | ||
data: ['xxx', 'xxxx'] | ||
} | ||
``` | ||
|
||
### POST | ||
对于 POST 方法,用于更新词库数据,FastGPT 会给接口发送数据 body 为 | ||
``` | ||
{ | ||
appId: 'xxxx', | ||
text: ['xxx', 'xxxx'] | ||
} | ||
``` | ||
接口应当按照获取的数据格式存储相对应的词库数组 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import { TeamCollectionName } from '@fastgpt/global/support/user/team/constant'; | ||
import { connectionMongo, type Model } from '../../common/mongo'; | ||
const { Schema, model, models } = connectionMongo; | ||
|
||
export const AppQGuideCollectionName = 'app_question_guides'; | ||
|
||
type AppQGuideSchemaType = { | ||
_id: string; | ||
appId: string; | ||
teamId: string; | ||
text: string; | ||
}; | ||
|
||
const AppQGuideSchema = new Schema({ | ||
appId: { | ||
type: Schema.Types.ObjectId, | ||
ref: AppQGuideCollectionName, | ||
required: true | ||
}, | ||
teamId: { | ||
type: Schema.Types.ObjectId, | ||
ref: TeamCollectionName, | ||
required: true | ||
}, | ||
text: { | ||
type: String, | ||
default: '' | ||
} | ||
}); | ||
|
||
try { | ||
AppQGuideSchema.index({ appId: 1 }); | ||
} catch (error) { | ||
console.log(error); | ||
} | ||
|
||
export const MongoAppQGuide: Model<AppQGuideSchemaType> = | ||
models[AppQGuideCollectionName] || model(AppQGuideCollectionName, AppQGuideSchema); | ||
|
||
MongoAppQGuide.syncIndexes(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
packages/web/components/common/Icon/icons/core/app/inputGuides.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.