Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
赵月辉
/
fastgpt-migrated
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Unverified
Commit
58cbf10c
authored
Jul 19, 2023
by
archer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
init
parent
7fe2017a
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
41 additions
and
65 deletions
+41
-65
client/public/docs/chatProblem.md
+1
-1
client/src/constants/flow/ModuleTemplate.ts
+1
-1
client/src/pages/api/admin/initv4.ts
+32
-60
client/src/pages/api/app/detail.tsx
+1
-2
client/src/pages/api/openapi/v1/chat/completions.ts
+4
-0
client/src/pages/kb/detail/components/Import/FileSelect.tsx
+2
-1
No files found.
client/public/docs/chatProblem.md
View file @
58cbf10c
### 常见问题
### 常见问题
**反馈问卷**
: 如果你遇到任何使用问题或有期望的功能,可以
[
填写该问卷
](
https://www.wjx.cn/vm/rLIw1uD.aspx#
)
**反馈问卷**
: 如果你遇到任何使用问题或有期望的功能,可以
[
填写该问卷
](
https://www.wjx.cn/vm/rLIw1uD.aspx#
)
**Git 地址**
:
[
项目地址。V4-preview 暂
为
开源,在正式版发布后会开源。
](
https://github.com/c121914yu/FastGPT
)
**Git 地址**
:
[
项目地址。V4-preview 暂
未
开源,在正式版发布后会开源。
](
https://github.com/c121914yu/FastGPT
)
**问题文档**
:
[
先看文档,再提问
](
https://kjqvjse66l.feishu.cn/docx/HtrgdT0pkonP4kxGx8qcu6XDnGh
)
**问题文档**
:
[
先看文档,再提问
](
https://kjqvjse66l.feishu.cn/docx/HtrgdT0pkonP4kxGx8qcu6XDnGh
)
**价格表**
**价格表**
| 计费项 | 价格: 元/ 1K tokens(包含上下文)|
| 计费项 | 价格: 元/ 1K tokens(包含上下文)|
...
...
client/src/constants/flow/ModuleTemplate.ts
View file @
58cbf10c
...
@@ -162,7 +162,7 @@ export const ChatModule: AppModuleTemplateItemType = {
...
@@ -162,7 +162,7 @@ export const ChatModule: AppModuleTemplateItemType = {
'限定模型对话范围,会被放置在本次提问前,拥有强引导和限定性。例如:\n1. 知识库是关于 Laf 的介绍,参考知识库回答问题,与 "Laf" 无关内容,直接回复: "我不知道"。\n2. 你仅回答关于 "xxx" 的问题,其他问题回复: "xxxx"',
'限定模型对话范围,会被放置在本次提问前,拥有强引导和限定性。例如:\n1. 知识库是关于 Laf 的介绍,参考知识库回答问题,与 "Laf" 无关内容,直接回复: "我不知道"。\n2. 你仅回答关于 "xxx" 的问题,其他问题回复: "xxxx"',
value: ''
value: ''
},
},
Input_Template_TFSwitch,
//
Input_Template_TFSwitch,
{
{
key: 'quotePrompt',
key: 'quotePrompt',
type: FlowInputItemTypeEnum.target,
type: FlowInputItemTypeEnum.target,
...
...
client/src/pages/api/admin/initv4.ts
View file @
58cbf10c
...
@@ -3,7 +3,6 @@ import type { NextApiRequest, NextApiResponse } from 'next';
...
@@ -3,7 +3,6 @@ import type { NextApiRequest, NextApiResponse } from 'next';
import
{
jsonRes
}
from
'@/service/response'
;
import
{
jsonRes
}
from
'@/service/response'
;
import
{
authUser
}
from
'@/service/utils/auth'
;
import
{
authUser
}
from
'@/service/utils/auth'
;
import
{
connectToDatabase
,
App
}
from
'@/service/mongo'
;
import
{
connectToDatabase
,
App
}
from
'@/service/mongo'
;
import
{
rawSearchKey
}
from
'@/constants/chat'
;
const
chatTemplate
=
({
const
chatTemplate
=
({
model
,
model
,
...
@@ -84,7 +83,7 @@ const chatTemplate = ({
...
@@ -84,7 +83,7 @@ const chatTemplate = ({
},
},
{
{
key
:
'temperature'
,
key
:
'temperature'
,
type
:
'
custom
'
,
type
:
'
slider
'
,
label
:
'温度'
,
label
:
'温度'
,
value
:
temperature
,
value
:
temperature
,
min
:
0
,
min
:
0
,
...
@@ -108,16 +107,16 @@ const chatTemplate = ({
...
@@ -108,16 +107,16 @@ const chatTemplate = ({
label
:
'回复上限'
,
label
:
'回复上限'
,
value
:
maxToken
,
value
:
maxToken
,
min
:
100
,
min
:
100
,
max
:
16
000
,
max
:
4
000
,
step
:
50
,
step
:
50
,
markList
:
[
markList
:
[
{
{
label
:
'0'
,
label
:
'
10
0'
,
value
:
0
value
:
10
0
},
},
{
{
label
:
'
16
000'
,
label
:
'
4
000'
,
value
:
16
000
value
:
4
000
}
}
],
],
connected
:
false
connected
:
false
...
@@ -145,12 +144,6 @@ const chatTemplate = ({
...
@@ -145,12 +144,6 @@ const chatTemplate = ({
connected
:
false
connected
:
false
},
},
{
{
key
:
'switch'
,
type
:
'target'
,
label
:
'触发器'
,
connected
:
false
},
{
key
:
'quotePrompt'
,
key
:
'quotePrompt'
,
type
:
'target'
,
type
:
'target'
,
label
:
'引用内容'
,
label
:
'引用内容'
,
...
@@ -284,8 +277,8 @@ const kbTemplate = ({
...
@@ -284,8 +277,8 @@ const kbTemplate = ({
}
}
],
],
position
:
{
position
:
{
x
:
-
210.2481710925384
3
,
x
:
-
196.8463268473848
3
,
y
:
665.7922967022607
y
:
797.3401378431948
},
},
moduleId
:
'v0nc1s'
moduleId
:
'v0nc1s'
},
},
...
@@ -327,8 +320,8 @@ const kbTemplate = ({
...
@@ -327,8 +320,8 @@ const kbTemplate = ({
}
}
],
],
position
:
{
position
:
{
x
:
-
196.84632684738483
,
x
:
211.58250540918442
,
y
:
797.3401378431948
y
:
611.8700401034965
},
},
moduleId
:
'k9y3jm'
moduleId
:
'k9y3jm'
},
},
...
@@ -345,25 +338,12 @@ const kbTemplate = ({
...
@@ -345,25 +338,12 @@ const kbTemplate = ({
type
:
'custom'
,
type
:
'custom'
,
label
:
'对话模型'
,
label
:
'对话模型'
,
value
:
model
,
value
:
model
,
list
:
[
list
:
[],
{
label
:
'FastAI-4k'
,
value
:
'gpt-3.5-turbo'
},
{
label
:
'FastAI-16k'
,
value
:
'gpt-3.5-turbo-16k'
},
{
label
:
'FastAI-Plus'
,
value
:
'gpt-4'
}
],
connected
:
false
connected
:
false
},
},
{
{
key
:
'temperature'
,
key
:
'temperature'
,
type
:
'
custom
'
,
type
:
'
slider
'
,
label
:
'温度'
,
label
:
'温度'
,
value
:
temperature
,
value
:
temperature
,
min
:
0
,
min
:
0
,
...
@@ -387,16 +367,16 @@ const kbTemplate = ({
...
@@ -387,16 +367,16 @@ const kbTemplate = ({
label
:
'回复上限'
,
label
:
'回复上限'
,
value
:
maxToken
,
value
:
maxToken
,
min
:
100
,
min
:
100
,
max
:
16
000
,
max
:
4
000
,
step
:
50
,
step
:
50
,
markList
:
[
markList
:
[
{
{
label
:
'0'
,
label
:
'
10
0'
,
value
:
0
value
:
10
0
},
},
{
{
label
:
'
16
000'
,
label
:
'
4
000'
,
value
:
16
000
value
:
4
000
}
}
],
],
connected
:
false
connected
:
false
...
@@ -424,12 +404,6 @@ const kbTemplate = ({
...
@@ -424,12 +404,6 @@ const kbTemplate = ({
connected
:
false
connected
:
false
},
},
{
{
key
:
'switch'
,
type
:
'target'
,
label
:
'触发器'
,
connected
:
true
},
{
key
:
'quotePrompt'
,
key
:
'quotePrompt'
,
type
:
'target'
,
type
:
'target'
,
label
:
'引用内容'
,
label
:
'引用内容'
,
...
@@ -481,7 +455,7 @@ const kbTemplate = ({
...
@@ -481,7 +455,7 @@ const kbTemplate = ({
},
},
{
{
key
:
'similarity'
,
key
:
'similarity'
,
type
:
'
custom
'
,
type
:
'
slider
'
,
label
:
'相似度'
,
label
:
'相似度'
,
value
:
searchSimilarity
,
value
:
searchSimilarity
,
min
:
0
,
min
:
0
,
...
@@ -489,8 +463,8 @@ const kbTemplate = ({
...
@@ -489,8 +463,8 @@ const kbTemplate = ({
step
:
0.01
,
step
:
0.01
,
markList
:
[
markList
:
[
{
{
label
:
'0'
,
label
:
'
10
0'
,
value
:
0
value
:
10
0
},
},
{
{
label
:
'1'
,
label
:
'1'
,
...
@@ -501,7 +475,7 @@ const kbTemplate = ({
...
@@ -501,7 +475,7 @@ const kbTemplate = ({
},
},
{
{
key
:
'limit'
,
key
:
'limit'
,
type
:
'
custom
'
,
type
:
'
slider
'
,
label
:
'单次搜索上限'
,
label
:
'单次搜索上限'
,
description
:
'最多取 n 条记录作为本次问题引用'
,
description
:
'最多取 n 条记录作为本次问题引用'
,
value
:
searchLimit
,
value
:
searchLimit
,
...
@@ -524,7 +498,7 @@ const kbTemplate = ({
...
@@ -524,7 +498,7 @@ const kbTemplate = ({
key
:
'switch'
,
key
:
'switch'
,
type
:
'target'
,
type
:
'target'
,
label
:
'触发器'
,
label
:
'触发器'
,
connected
:
tru
e
connected
:
fals
e
},
},
{
{
key
:
'userChatInput'
,
key
:
'userChatInput'
,
...
@@ -535,7 +509,7 @@ const kbTemplate = ({
...
@@ -535,7 +509,7 @@ const kbTemplate = ({
],
],
outputs
:
[
outputs
:
[
{
{
key
:
rawSearchKey
,
key
:
'rawSearch'
,
label
:
'源搜索数据'
,
label
:
'源搜索数据'
,
type
:
'hidden'
,
type
:
'hidden'
,
response
:
true
,
response
:
true
,
...
@@ -545,16 +519,14 @@ const kbTemplate = ({
...
@@ -545,16 +519,14 @@ const kbTemplate = ({
key
:
'isEmpty'
,
key
:
'isEmpty'
,
label
:
'搜索结果为空'
,
label
:
'搜索结果为空'
,
type
:
'source'
,
type
:
'source'
,
targets
:
[
targets
:
searchEmptyText
...(
searchEmptyText
?
[
?
[
{
{
moduleId
:
'w8av9y'
,
moduleId
:
'w8av9y'
,
key
:
'switch'
key
:
'switch'
}
}
]
]
:
[]
:
[])
]
},
},
{
{
key
:
'quotePrompt'
,
key
:
'quotePrompt'
,
...
@@ -593,7 +565,7 @@ const kbTemplate = ({
...
@@ -593,7 +565,7 @@ const kbTemplate = ({
{
{
key
:
'answerText'
,
key
:
'answerText'
,
value
:
searchEmptyText
,
value
:
searchEmptyText
,
type
:
'
input
'
,
type
:
'
textarea
'
,
label
:
'回复的内容'
,
label
:
'回复的内容'
,
connected
:
false
connected
:
false
}
}
...
...
client/src/pages/api/app/detail.tsx
View file @
58cbf10c
...
@@ -20,8 +20,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse<
...
@@ -20,8 +20,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse<
const
{
app
}
=
await
authApp
({
const
{
app
}
=
await
authApp
({
appId
,
appId
,
userId
,
userId
authOwner
:
false
});
});
jsonRes
(
res
,
{
jsonRes
(
res
,
{
...
...
client/src/pages/api/openapi/v1/chat/completions.ts
View file @
58cbf10c
...
@@ -125,6 +125,10 @@ export default withNextCors(async function handler(req: NextApiRequest, res: Nex
...
@@ -125,6 +125,10 @@ export default withNextCors(async function handler(req: NextApiRequest, res: Nex
billId
billId
});
});
if
(
!
answerText
)
{
throw
new
Error
(
'回复内容为空,可能模块编排出现问题'
);
}
// save chat
// save chat
if
(
typeof
chatId
===
'string'
)
{
if
(
typeof
chatId
===
'string'
)
{
await
saveChat
({
await
saveChat
({
...
...
client/src/pages/kb/detail/components/Import/FileSelect.tsx
View file @
58cbf10c
...
@@ -34,7 +34,8 @@ const FileSelect = ({ fileExtension, onSelectFile, isLoading, ...props }: Props)
...
@@ -34,7 +34,8 @@ const FileSelect = ({ fileExtension, onSelectFile, isLoading, ...props }: Props)
>
>
<
Flex
justifyContent=
{
'center'
}
alignItems=
{
'center'
}
>
<
Flex
justifyContent=
{
'center'
}
alignItems=
{
'center'
}
>
<
MyIcon
mr=
{
1
}
name=
{
'uploadFile'
}
w=
{
'16px'
}
/>
<
MyIcon
mr=
{
1
}
name=
{
'uploadFile'
}
w=
{
'16px'
}
/>
拖拽文件至此,或
{
' '
}
{
/* 拖拽文件至此,或{' '} */
}
点击
<
Box
ml=
{
1
}
as=
{
'span'
}
cursor=
{
'pointer'
}
color=
{
'myBlue.700'
}
onClick=
{
onOpen
}
>
<
Box
ml=
{
1
}
as=
{
'span'
}
cursor=
{
'pointer'
}
color=
{
'myBlue.700'
}
onClick=
{
onOpen
}
>
选择文件
选择文件
</
Box
>
</
Box
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment