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
f71ce25c
authored
Jul 17, 2023
by
archer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
flow chat
parent
ecce182a
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
57 additions
and
14 deletions
+57
-14
client/public/docs/chatProblem.md
+2
-3
client/public/docs/versionIntro.md
+7
-1
client/src/components/ChatBox/index.tsx
+30
-0
client/src/pages/app/detail/components/Settings.tsx
+1
-1
client/src/pages/app/detail/components/edit/components/NodeChat.tsx
+15
-3
client/src/pages/chat/index.tsx
+1
-0
client/src/pages/index.tsx
+0
-5
client/src/pages/number/components/PayModal.tsx
+1
-1
No files found.
client/public/docs/chatProblem.md
View file @
f71ce25c
### 常见问题
### 常见问题
**Git 地址**
:
[
项目地址
,完全开源,随便用。
](
https://github.com/labring
/FastGPT
)
**Git 地址**
:
[
项目地址
。V4-beta 暂为开源,在正式版发布后会开源。
](
https://github.com/c121914yu
/FastGPT
)
**问题文档**
:
[
先看文档,再提问
](
https://kjqvjse66l.feishu.cn/docx/HtrgdT0pkonP4kxGx8qcu6XDnGh
)
**问题文档**
:
[
先看文档,再提问
](
https://kjqvjse66l.feishu.cn/docx/HtrgdT0pkonP4kxGx8qcu6XDnGh
)
**价格表**
**价格表**
如果使用了自己的 Api Key,网页上 openai 模型聊天不会计费。可以在账号页,看到详细账单。
| 计费项 | 价格: 元/ 1K tokens(包含上下文)|
| 计费项 | 价格: 元/ 1K tokens(包含上下文)|
| --- | --- |
| --- | --- |
| 知识库 - 索引 | 0.00
1
|
| 知识库 - 索引 | 0.00
2
|
| FastAI4k - 对话 | 0.015 |
| FastAI4k - 对话 | 0.015 |
| FastAI16k - 对话 | 0.03 |
| FastAI16k - 对话 | 0.03 |
| FastAI-Plus - 对话 | 0.45 |
| FastAI-Plus - 对话 | 0.45 |
...
...
client/public/docs/versionIntro.md
View file @
f71ce25c
### Fast GPT V
3.9
### Fast GPT V
4.0-beta
<<<<<<< HEAD
1.
新增 - 直接分段训练,可调节段落大小。
1.
新增 - 直接分段训练,可调节段落大小。
2.
优化 - tokens 计算性能。
2.
优化 - tokens 计算性能。
3.
优化 - key 池管理,结合 one-api 项目,实现更方便的 key 池管理,具体参考
[
docker 部署 FastGpt
](
https://github.com/labring/FastGPT/blob/main/docs/deploy/docker.md
)
3.
优化 - key 池管理,结合 one-api 项目,实现更方便的 key 池管理,具体参考
[
docker 部署 FastGpt
](
https://github.com/labring/FastGPT/blob/main/docs/deploy/docker.md
)
4. 新增 - V2 版 OpenAPI,可以在任意第三方套壳 ChatGpt 项目中直接使用 FastGpt 的应用,注意!是直接,不需要改任何代码。具体参考[API 文档中《在第三方应用中使用 FastGpt》](https://kjqvjse66l.feishu.cn/docx/DmLedTWtUoNGX8xui9ocdUEjnNh)
4. 新增 - V2 版 OpenAPI,可以在任意第三方套壳 ChatGpt 项目中直接使用 FastGpt 的应用,注意!是直接,不需要改任何代码。具体参考[API 文档中《在第三方应用中使用 FastGpt》](https://kjqvjse66l.feishu.cn/docx/DmLedTWtUoNGX8xui9ocdUEjnNh)
=======
1.
全新交互,采用模块组合的方式构建知识库。
2.
问题分类 - 可以对用户的问题进行分类,再执行不同的操作。
3.
beta 版本尚未稳定,请以测试为主。详细使用文档后续会补上。
>>>>>>> 5f8a88d (flow chat)
client/src/components/ChatBox/index.tsx
View file @
f71ce25c
...
@@ -21,6 +21,7 @@ import MyIcon from '@/components/Icon';
...
@@ -21,6 +21,7 @@ import MyIcon from '@/components/Icon';
import
Avatar
from
'@/components/Avatar'
;
import
Avatar
from
'@/components/Avatar'
;
import
{
adaptChatItem_openAI
}
from
'@/utils/plugin/openai'
;
import
{
adaptChatItem_openAI
}
from
'@/utils/plugin/openai'
;
import
{
useMarkdown
}
from
'@/hooks/useMarkdown'
;
import
{
VariableItemType
}
from
'@/types/app'
;
import
{
VariableItemType
}
from
'@/types/app'
;
import
{
VariableInputEnum
}
from
'@/constants/app'
;
import
{
VariableInputEnum
}
from
'@/constants/app'
;
import
{
useForm
}
from
'react-hook-form'
;
import
{
useForm
}
from
'react-hook-form'
;
...
@@ -68,8 +69,34 @@ const VariableLabel = ({
...
@@ -68,8 +69,34 @@ const VariableLabel = ({
</
Box
>
</
Box
>
);
);
const
Empty
=
()
=>
{
const
{
data
:
chatProblem
}
=
useMarkdown
({
url
:
'/chatProblem.md'
});
const
{
data
:
versionIntro
}
=
useMarkdown
({
url
:
'/versionIntro.md'
});
return
(
<
Box
minH=
{
'100%'
}
w=
{
'85%'
}
maxW=
{
'600px'
}
m=
{
'auto'
}
py=
{
'5vh'
}
alignItems=
{
'center'
}
justifyContent=
{
'center'
}
>
{
/* version intro */
}
<
Card
p=
{
4
}
mb=
{
10
}
>
<
Markdown
source=
{
versionIntro
}
/>
</
Card
>
<
Card
p=
{
4
}
>
<
Markdown
source=
{
chatProblem
}
/>
</
Card
>
</
Box
>
);
};
const
ChatBox
=
(
const
ChatBox
=
(
{
{
showEmptyIntro
=
false
,
historyId
,
historyId
,
appAvatar
,
appAvatar
,
variableModules
,
variableModules
,
...
@@ -78,6 +105,7 @@ const ChatBox = (
...
@@ -78,6 +105,7 @@ const ChatBox = (
onStartChat
,
onStartChat
,
onDelMessage
onDelMessage
}:
{
}:
{
showEmptyIntro
?:
boolean
;
historyId
?:
string
;
historyId
?:
string
;
appAvatar
:
string
;
appAvatar
:
string
;
variableModules
?:
VariableItemType
[];
variableModules
?:
VariableItemType
[];
...
@@ -568,6 +596,8 @@ const ChatBox = (
...
@@ -568,6 +596,8 @@ const ChatBox = (
</
Flex
>
</
Flex
>
))
}
))
}
</
Box
>
</
Box
>
{
showEmptyIntro
&&
chatHistory
.
length
===
0
&&
!
hasVariableInput
&&
<
Empty
/>
}
</
Box
>
</
Box
>
</
Box
>
</
Box
>
{
/* input */
}
{
/* input */
}
...
...
client/src/pages/app/detail/components/Settings.tsx
View file @
f71ce25c
...
@@ -15,7 +15,7 @@ import MyIcon from '@/components/Icon';
...
@@ -15,7 +15,7 @@ import MyIcon from '@/components/Icon';
import
TotalUsage
from
'./Charts/TotalUsage'
;
import
TotalUsage
from
'./Charts/TotalUsage'
;
const
InfoModal
=
dynamic
(()
=>
import
(
'./InfoModal'
));
const
InfoModal
=
dynamic
(()
=>
import
(
'./InfoModal'
));
const
AppEdit
=
dynamic
(()
=>
import
(
'./edit'
),
{
ssr
:
true
})
;
import
AppEdit
from
'./edit'
;
import
styles
from
'../../list/index.module.scss'
;
import
styles
from
'../../list/index.module.scss'
;
const
Settings
=
({
appId
}:
{
appId
:
string
})
=>
{
const
Settings
=
({
appId
}:
{
appId
:
string
})
=>
{
...
...
client/src/pages/app/detail/components/edit/components/NodeChat.tsx
View file @
f71ce25c
...
@@ -11,6 +11,7 @@ import MySelect from '@/components/Select';
...
@@ -11,6 +11,7 @@ import MySelect from '@/components/Select';
import
{
chatModelList
}
from
'@/store/static'
;
import
{
chatModelList
}
from
'@/store/static'
;
import
MySlider
from
'@/components/Slider'
;
import
MySlider
from
'@/components/Slider'
;
import
{
Box
}
from
'@chakra-ui/react'
;
import
{
Box
}
from
'@chakra-ui/react'
;
import
{
formatPrice
}
from
'@/utils/user'
;
const
NodeChat
=
({
const
NodeChat
=
({
data
:
{
moduleId
,
inputs
,
outputs
,
onChangeNode
,
...
props
}
data
:
{
moduleId
,
inputs
,
outputs
,
onChangeNode
,
...
props
}
...
@@ -29,11 +30,21 @@ const NodeChat = ({
...
@@ -29,11 +30,21 @@ const NodeChat = ({
onChangeNode=
{
onChangeNode
}
onChangeNode=
{
onChangeNode
}
flowInputList=
{
inputs
}
flowInputList=
{
inputs
}
CustomComponent=
{
{
CustomComponent=
{
{
model
:
(
inputItem
)
=>
(
model
:
(
inputItem
)
=>
{
const
list
=
chatModelList
.
map
((
item
)
=>
{
const
priceStr
=
`(${formatPrice(item.price, 1000)}元/1k Tokens)`
;
return
{
value
:
item
.
model
,
label
:
`${item.name}${priceStr}`
};
});
return
(
<
MySelect
<
MySelect
width=
{
'100%'
}
width=
{
'100%'
}
value=
{
inputItem
.
value
}
value=
{
inputItem
.
value
}
list=
{
inputItem
.
list
||
[]
}
list=
{
list
}
onchange=
{
(
e
)
=>
{
onchange=
{
(
e
)
=>
{
onChangeNode
({
onChangeNode
({
moduleId
,
moduleId
,
...
@@ -67,7 +78,8 @@ const NodeChat = ({
...
@@ -67,7 +78,8 @@ const NodeChat = ({
});
});
}
}
}
}
/>
/>
),
);
},
maxToken
:
(
inputItem
)
=>
{
maxToken
:
(
inputItem
)
=>
{
const
model
=
inputs
.
find
((
item
)
=>
item
.
key
===
'model'
)?.
value
;
const
model
=
inputs
.
find
((
item
)
=>
item
.
key
===
'model'
)?.
value
;
const
modelData
=
chatModelList
.
find
((
item
)
=>
item
.
model
===
model
);
const
modelData
=
chatModelList
.
find
((
item
)
=>
item
.
model
===
model
);
...
...
client/src/pages/chat/index.tsx
View file @
f71ce25c
...
@@ -296,6 +296,7 @@ const Chat = () => {
...
@@ -296,6 +296,7 @@ const Chat = () => {
<
Box
flex=
{
1
}
>
<
Box
flex=
{
1
}
>
<
ChatBox
<
ChatBox
ref=
{
ChatBoxRef
}
ref=
{
ChatBoxRef
}
showEmptyIntro
historyId=
{
historyId
}
historyId=
{
historyId
}
appAvatar=
{
chatData
.
app
.
avatar
}
appAvatar=
{
chatData
.
app
.
avatar
}
variableModules=
{
chatData
.
app
.
variableModules
}
variableModules=
{
chatData
.
app
.
variableModules
}
...
...
client/src/pages/index.tsx
View file @
f71ce25c
...
@@ -13,7 +13,6 @@ import MyIcon from '@/components/Icon';
...
@@ -13,7 +13,6 @@ import MyIcon from '@/components/Icon';
const
Home
=
()
=>
{
const
Home
=
()
=>
{
const
router
=
useRouter
();
const
router
=
useRouter
();
const
{
inviterId
}
=
router
.
query
as
{
inviterId
:
string
};
const
{
inviterId
}
=
router
.
query
as
{
inviterId
:
string
};
const
{
data
}
=
useMarkdown
({
url
:
'/intro.md'
});
const
{
isPc
}
=
useGlobalStore
();
const
{
isPc
}
=
useGlobalStore
();
const
[
star
,
setStar
]
=
useState
(
1500
);
const
[
star
,
setStar
]
=
useState
(
1500
);
...
@@ -211,10 +210,6 @@ const Home = () => {
...
@@ -211,10 +210,6 @@ const Home = () => {
</
Flex
>
</
Flex
>
<
Box
w=
{
'100%'
}
mt=
{
'100vh'
}
px=
{
[
5
,
10
]
}
pb=
{
[
5
,
10
]
}
>
<
Box
w=
{
'100%'
}
mt=
{
'100vh'
}
px=
{
[
5
,
10
]
}
pb=
{
[
5
,
10
]
}
>
<
Card
p=
{
5
}
lineHeight=
{
2
}
>
<
Markdown
source=
{
data
}
isChatting=
{
false
}
/>
</
Card
>
<
Card
p=
{
5
}
mt=
{
4
}
textAlign=
{
'center'
}
>
<
Card
p=
{
5
}
mt=
{
4
}
textAlign=
{
'center'
}
>
{
beianText
&&
(
{
beianText
&&
(
<
Link
href=
"https://beian.miit.gov.cn/"
target=
"_blank"
>
<
Link
href=
"https://beian.miit.gov.cn/"
target=
"_blank"
>
...
...
client/src/pages/number/components/PayModal.tsx
View file @
f71ce25c
...
@@ -113,7 +113,7 @@ const PayModal = ({ onClose }: { onClose: () => void }) => {
...
@@ -113,7 +113,7 @@ const PayModal = ({ onClose }: { onClose: () => void }) => {
source=
{
`
source=
{
`
| 计费项 | 价格: 元/ 1K tokens(包含上下文)|
| 计费项 | 价格: 元/ 1K tokens(包含上下文)|
| --- | --- |
| --- | --- |
| 知识库 - 索引 | 0.00
1
|
| 知识库 - 索引 | 0.00
2
|
| FastAI4k - 对话 | 0.015 |
| FastAI4k - 对话 | 0.015 |
| FastAI16k - 对话 | 0.03 |
| FastAI16k - 对话 | 0.03 |
| FastAI-Plus - 对话 | 0.45 |
| FastAI-Plus - 对话 | 0.45 |
...
...
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