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
44e360b6
authored
Jul 17, 2023
by
archer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
name
parent
dc1599ba
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
76 additions
and
52 deletions
+76
-52
client/data/ChatModels.json
+6
-6
client/data/QAModels.json
+2
-2
client/public/docs/chatProblem.md
+3
-3
client/public/docs/intro.md
+3
-3
client/src/constants/app.ts
+12
-12
client/src/constants/flow/ModuleTemplate.ts
+1
-1
client/src/constants/model.ts
+2
-2
client/src/pages/api/admin/initv4.ts
+6
-6
client/src/pages/api/system/getInitData.ts
+8
-8
client/src/pages/app/detail/components/edit/index.tsx
+0
-2
client/src/pages/number/components/PayModal.tsx
+5
-5
client/src/types/mongoSchema.d.ts
+1
-1
client/src/utils/adapt.ts
+27
-1
No files found.
client/data/ChatModels.json
View file @
44e360b6
{
{
"
Gpt35
-4k"
:
{
"
FastAI
-4k"
:
{
"model"
:
"gpt-3.5-turbo"
,
"model"
:
"gpt-3.5-turbo"
,
"name"
:
"
Gpt35
-4k"
,
"name"
:
"
FastAI
-4k"
,
"contextMaxToken"
:
4000
,
"contextMaxToken"
:
4000
,
"systemMaxToken"
:
2400
,
"systemMaxToken"
:
2400
,
"maxTemperature"
:
1.2
,
"maxTemperature"
:
1.2
,
"price"
:
1.5
"price"
:
1.5
},
},
"
Gpt35
-16k"
:
{
"
FastAI
-16k"
:
{
"model"
:
"gpt-3.5-turbo-16k"
,
"model"
:
"gpt-3.5-turbo-16k"
,
"name"
:
"
Gpt35
-16k"
,
"name"
:
"
FastAI
-16k"
,
"contextMaxToken"
:
16000
,
"contextMaxToken"
:
16000
,
"systemMaxToken"
:
8000
,
"systemMaxToken"
:
8000
,
"maxTemperature"
:
1.2
,
"maxTemperature"
:
1.2
,
"price"
:
3
"price"
:
3
},
},
"
Gpt4
"
:
{
"
FastAI-Plus
"
:
{
"model"
:
"gpt-4"
,
"model"
:
"gpt-4"
,
"name"
:
"
Gpt4
"
,
"name"
:
"
FastAI-Plus
"
,
"contextMaxToken"
:
8000
,
"contextMaxToken"
:
8000
,
"systemMaxToken"
:
4000
,
"systemMaxToken"
:
4000
,
"maxTemperature"
:
1.2
,
"maxTemperature"
:
1.2
,
...
...
client/data/QAModels.json
View file @
44e360b6
{
{
"
Gpt35
-16k"
:
{
"
FastAI
-16k"
:
{
"model"
:
"gpt-3.5-turbo-16k"
,
"model"
:
"gpt-3.5-turbo-16k"
,
"name"
:
"
Gpt35
-16k"
,
"name"
:
"
FastAI
-16k"
,
"maxToken"
:
16000
,
"maxToken"
:
16000
,
"price"
:
3
"price"
:
3
}
}
...
...
client/public/docs/chatProblem.md
View file @
44e360b6
...
@@ -7,9 +7,9 @@
...
@@ -7,9 +7,9 @@
| 计费项 | 价格: 元/ 1K tokens(包含上下文)|
| 计费项 | 价格: 元/ 1K tokens(包含上下文)|
| --- | --- |
| --- | --- |
| 知识库 - 索引 | 0.001 |
| 知识库 - 索引 | 0.001 |
|
chatgpt
- 对话 | 0.015 |
|
FastAI4k
- 对话 | 0.015 |
|
chatgpt16K
- 对话 | 0.03 |
|
FastAI16k
- 对话 | 0.03 |
|
gpt4
- 对话 | 0.45 |
|
FastAI-Plus
- 对话 | 0.45 |
| 文件拆分 | 0.03 |
| 文件拆分 | 0.03 |
**其他问题**
**其他问题**
...
...
client/public/docs/intro.md
View file @
44e360b6
...
@@ -19,9 +19,9 @@ FastGpt 项目完全开源,可随意私有化部署,去除平台风险忧虑
...
@@ -19,9 +19,9 @@ FastGpt 项目完全开源,可随意私有化部署,去除平台风险忧虑
| 计费项 | 价格: 元/ 1K tokens(包含上下文)|
| 计费项 | 价格: 元/ 1K tokens(包含上下文)|
| --- | --- |
| --- | --- |
| 知识库 - 索引 | 0.001 |
| 知识库 - 索引 | 0.001 |
|
chatgpt
- 对话 | 0.015 |
|
FastAI4k
- 对话 | 0.015 |
|
chatgpt16K
- 对话 | 0.03 |
|
FastAI16k
- 对话 | 0.03 |
|
gpt4
- 对话 | 0.45 |
|
FastAI-Plus
- 对话 | 0.45 |
| 文件拆分 | 0.03 |
| 文件拆分 | 0.03 |
### 交流群/问题反馈
### 交流群/问题反馈
...
...
client/src/constants/app.ts
View file @
44e360b6
...
@@ -81,15 +81,15 @@ export const appTemplates: (AppItemType & { avatar: string; intro: string })[] =
...
@@ -81,15 +81,15 @@ export const appTemplates: (AppItemType & { avatar: string; intro: string })[] =
value
:
'gpt-3.5-turbo-16k'
,
value
:
'gpt-3.5-turbo-16k'
,
list
:
[
list
:
[
{
{
label
:
'
Gpt35
-4k'
,
label
:
'
FastAI
-4k'
,
value
:
'gpt-3.5-turbo'
value
:
'gpt-3.5-turbo'
},
},
{
{
label
:
'
Gpt35
-16k'
,
label
:
'
FastAI
-16k'
,
value
:
'gpt-3.5-turbo-16k'
value
:
'gpt-3.5-turbo-16k'
},
},
{
{
label
:
'
Gpt4
'
,
label
:
'
FastAI-Plus
'
,
value
:
'gpt-4'
value
:
'gpt-4'
}
}
],
],
...
@@ -344,15 +344,15 @@ export const appTemplates: (AppItemType & { avatar: string; intro: string })[] =
...
@@ -344,15 +344,15 @@ export const appTemplates: (AppItemType & { avatar: string; intro: string })[] =
value
:
'gpt-3.5-turbo-16k'
,
value
:
'gpt-3.5-turbo-16k'
,
list
:
[
list
:
[
{
{
label
:
'
Gpt35
-4k'
,
label
:
'
FastAI
-4k'
,
value
:
'gpt-3.5-turbo'
value
:
'gpt-3.5-turbo'
},
},
{
{
label
:
'
Gpt35
-16k'
,
label
:
'
FastAI
-16k'
,
value
:
'gpt-3.5-turbo-16k'
value
:
'gpt-3.5-turbo-16k'
},
},
{
{
label
:
'
Gpt4
'
,
label
:
'
FastAI-Plus
'
,
value
:
'gpt-4'
value
:
'gpt-4'
}
}
],
],
...
@@ -652,15 +652,15 @@ export const appTemplates: (AppItemType & { avatar: string; intro: string })[] =
...
@@ -652,15 +652,15 @@ export const appTemplates: (AppItemType & { avatar: string; intro: string })[] =
value
:
'gpt-3.5-turbo-16k'
,
value
:
'gpt-3.5-turbo-16k'
,
list
:
[
list
:
[
{
{
label
:
'
Gpt35
-4k'
,
label
:
'
FastAI
-4k'
,
value
:
'gpt-3.5-turbo'
value
:
'gpt-3.5-turbo'
},
},
{
{
label
:
'
Gpt35
-16k'
,
label
:
'
FastAI
-16k'
,
value
:
'gpt-3.5-turbo-16k'
value
:
'gpt-3.5-turbo-16k'
},
},
{
{
label
:
'
Gpt4
'
,
label
:
'
FastAI-Plus
'
,
value
:
'gpt-4'
value
:
'gpt-4'
}
}
],
],
...
@@ -979,15 +979,15 @@ export const appTemplates: (AppItemType & { avatar: string; intro: string })[] =
...
@@ -979,15 +979,15 @@ export const appTemplates: (AppItemType & { avatar: string; intro: string })[] =
value
:
'gpt-3.5-turbo'
,
value
:
'gpt-3.5-turbo'
,
list
:
[
list
:
[
{
{
label
:
'
Gpt35
-16k'
,
label
:
'
FastAI
-16k'
,
value
:
'gpt-3.5-turbo-16k'
value
:
'gpt-3.5-turbo-16k'
},
},
{
{
label
:
'
Gpt35
-4k'
,
label
:
'
FastAI
-4k'
,
value
:
'gpt-3.5-turbo'
value
:
'gpt-3.5-turbo'
},
},
{
{
label
:
'
Gpt4
-8k'
,
label
:
'
FastAI-Plus
-8k'
,
value
:
'gpt-4'
value
:
'gpt-4'
}
}
],
],
...
...
client/src/constants/flow/ModuleTemplate.ts
View file @
44e360b6
...
@@ -249,7 +249,7 @@ export const AnswerModule: AppModuleTemplateItemType = {
...
@@ -249,7 +249,7 @@ export const AnswerModule: AppModuleTemplateItemType = {
{
{
key: SpecificInputEnum.answerText,
key: SpecificInputEnum.answerText,
value: '',
value: '',
type: FlowInputItemTypeEnum.
input
,
type: FlowInputItemTypeEnum.
textarea
,
label: '回复的内容'
label: '回复的内容'
}
}
],
],
...
...
client/src/constants/model.ts
View file @
44e360b6
...
@@ -4,8 +4,8 @@ import type { AppSchema } from '@/types/mongoSchema';
...
@@ -4,8 +4,8 @@ import type { AppSchema } from '@/types/mongoSchema';
export
enum
OpenAiChatEnum
{
export
enum
OpenAiChatEnum
{
'GPT35'
=
'gpt-3.5-turbo'
,
'GPT35'
=
'gpt-3.5-turbo'
,
'GPT3516k'
=
'gpt-3.5-turbo-16k'
,
'GPT3516k'
=
'gpt-3.5-turbo-16k'
,
'
GPT4
'
=
'gpt-4'
,
'
FastAI-Plus
'
=
'gpt-4'
,
'
GPT4
32k'
=
'gpt-4-32k'
'
FastAI-Plus
32k'
=
'gpt-4-32k'
}
}
export
const
defaultApp
:
AppSchema
=
{
export
const
defaultApp
:
AppSchema
=
{
...
...
client/src/pages/api/admin/initv4.ts
View file @
44e360b6
...
@@ -69,15 +69,15 @@ const chatTemplate = ({
...
@@ -69,15 +69,15 @@ const chatTemplate = ({
value
:
model
,
value
:
model
,
list
:
[
list
:
[
{
{
label
:
'
Gpt35
-4k'
,
label
:
'
FastAI
-4k'
,
value
:
'gpt-3.5-turbo'
value
:
'gpt-3.5-turbo'
},
},
{
{
label
:
'
Gpt35
-16k'
,
label
:
'
FastAI
-16k'
,
value
:
'gpt-3.5-turbo-16k'
value
:
'gpt-3.5-turbo-16k'
},
},
{
{
label
:
'
Gpt4
'
,
label
:
'
FastAI-Plus
'
,
value
:
'gpt-4'
value
:
'gpt-4'
}
}
],
],
...
@@ -348,15 +348,15 @@ const kbTemplate = ({
...
@@ -348,15 +348,15 @@ const kbTemplate = ({
value
:
model
,
value
:
model
,
list
:
[
list
:
[
{
{
label
:
'
Gpt35
-4k'
,
label
:
'
FastAI
-4k'
,
value
:
'gpt-3.5-turbo'
value
:
'gpt-3.5-turbo'
},
},
{
{
label
:
'
Gpt35
-16k'
,
label
:
'
FastAI
-16k'
,
value
:
'gpt-3.5-turbo-16k'
value
:
'gpt-3.5-turbo-16k'
},
},
{
{
label
:
'
Gpt4
'
,
label
:
'
FastAI-Plus
'
,
value
:
'gpt-4'
value
:
'gpt-4'
}
}
],
],
...
...
client/src/pages/api/system/getInitData.ts
View file @
44e360b6
...
@@ -18,25 +18,25 @@ export type InitDateResponse = {
...
@@ -18,25 +18,25 @@ export type InitDateResponse = {
};
};
const
defaultmodels
=
{
const
defaultmodels
=
{
'
Gpt35
-4k'
:
{
'
FastAI
-4k'
:
{
model
:
'gpt-3.5-turbo'
,
model
:
'gpt-3.5-turbo'
,
name
:
'
Gpt35
-4k'
,
name
:
'
FastAI
-4k'
,
contextMaxToken
:
4000
,
contextMaxToken
:
4000
,
systemMaxToken
:
2400
,
systemMaxToken
:
2400
,
maxTemperature
:
1.2
,
maxTemperature
:
1.2
,
price
:
1.5
price
:
1.5
},
},
'
Gpt35
-16k'
:
{
'
FastAI
-16k'
:
{
model
:
'gpt-3.5-turbo'
,
model
:
'gpt-3.5-turbo'
,
name
:
'
Gpt35
-16k'
,
name
:
'
FastAI
-16k'
,
contextMaxToken
:
16000
,
contextMaxToken
:
16000
,
systemMaxToken
:
8000
,
systemMaxToken
:
8000
,
maxTemperature
:
1.2
,
maxTemperature
:
1.2
,
price
:
3
price
:
3
},
},
Gpt4
:
{
'FastAI-Plus'
:
{
model
:
'gpt-4'
,
model
:
'gpt-4'
,
name
:
'
Gpt4
'
,
name
:
'
FastAI-Plus
'
,
contextMaxToken
:
8000
,
contextMaxToken
:
8000
,
systemMaxToken
:
4000
,
systemMaxToken
:
4000
,
maxTemperature
:
1.2
,
maxTemperature
:
1.2
,
...
@@ -44,9 +44,9 @@ const defaultmodels = {
...
@@ -44,9 +44,9 @@ const defaultmodels = {
}
}
};
};
const
defaultQaModels
=
{
const
defaultQaModels
=
{
'
Gpt35
-16k'
:
{
'
FastAI
-16k'
:
{
model
:
'gpt-3.5-turbo'
,
model
:
'gpt-3.5-turbo'
,
name
:
'
Gpt35
-16k'
,
name
:
'
FastAI
-16k'
,
maxToken
:
16000
,
maxToken
:
16000
,
price
:
3
price
:
3
}
}
...
...
client/src/pages/app/detail/components/edit/index.tsx
View file @
44e360b6
...
@@ -227,8 +227,6 @@ const AppEdit = ({ app, fullScreen, onFullScreen }: Props) => {
...
@@ -227,8 +227,6 @@ const AppEdit = ({ app, fullScreen, onFullScreen }: Props) => {
const
{
mutate
:
onclickSave
,
isLoading
}
=
useRequest
({
const
{
mutate
:
onclickSave
,
isLoading
}
=
useRequest
({
mutationFn
:
()
=>
{
mutationFn
:
()
=>
{
console
.
log
(
flow2Modules
());
return
putAppById
(
app
.
_id
,
{
return
putAppById
(
app
.
_id
,
{
modules
:
flow2Modules
()
modules
:
flow2Modules
()
});
});
...
...
client/src/pages/number/components/PayModal.tsx
View file @
44e360b6
...
@@ -32,13 +32,13 @@ const PayModal = ({ onClose }: { onClose: () => void }) => {
...
@@ -32,13 +32,13 @@ const PayModal = ({ onClose }: { onClose: () => void }) => {
try
{
try
{
// 获取支付二维码
// 获取支付二维码
const
res
=
await
getPayCode
(
inputVal
);
const
res
=
await
getPayCode
(
inputVal
);
new
QRCode
(
document
.
getElementById
(
'payQRCode'
),
{
new
window
.
QRCode
(
document
.
getElementById
(
'payQRCode'
),
{
text
:
res
.
codeUrl
,
text
:
res
.
codeUrl
,
width
:
128
,
width
:
128
,
height
:
128
,
height
:
128
,
colorDark
:
'#000000'
,
colorDark
:
'#000000'
,
colorLight
:
'#ffffff'
,
colorLight
:
'#ffffff'
,
correctLevel
:
QRCode
.
CorrectLevel
.
H
correctLevel
:
window
.
QRCode
.
CorrectLevel
.
H
});
});
setPayId
(
res
.
payId
);
setPayId
(
res
.
payId
);
}
catch
(
err
)
{
}
catch
(
err
)
{
...
@@ -114,9 +114,9 @@ const PayModal = ({ onClose }: { onClose: () => void }) => {
...
@@ -114,9 +114,9 @@ const PayModal = ({ onClose }: { onClose: () => void }) => {
| 计费项 | 价格: 元/ 1K tokens(包含上下文)|
| 计费项 | 价格: 元/ 1K tokens(包含上下文)|
| --- | --- |
| --- | --- |
| 知识库 - 索引 | 0.001 |
| 知识库 - 索引 | 0.001 |
|
chatgpt
- 对话 | 0.015 |
|
FastAI4k
- 对话 | 0.015 |
|
chatgpt16K
- 对话 | 0.03 |
|
FastAI16k
- 对话 | 0.03 |
|
gpt4
- 对话 | 0.45 |
|
FastAI-Plus
- 对话 | 0.45 |
| 文件拆分 | 0.03 |`
}
| 文件拆分 | 0.03 |`
}
/>
/>
</>
</>
...
...
client/src/types/mongoSchema.d.ts
View file @
44e360b6
...
@@ -44,7 +44,7 @@ export interface AppSchema {
...
@@ -44,7 +44,7 @@ export interface AppSchema {
collection
:
number
;
collection
:
number
;
};
};
modules
:
AppModuleItemType
[];
modules
:
AppModuleItemType
[];
chat
:
{
chat
?
:
{
relatedKbs
:
string
[];
relatedKbs
:
string
[];
searchSimilarity
:
number
;
searchSimilarity
:
number
;
searchLimit
:
number
;
searchLimit
:
number
;
...
...
client/src/utils/adapt.ts
View file @
44e360b6
...
@@ -10,6 +10,7 @@ import type { FlowModuleItemType } from '@/types/flow';
...
@@ -10,6 +10,7 @@ import type { FlowModuleItemType } from '@/types/flow';
import
type
{
Edge
,
Node
}
from
'reactflow'
;
import
type
{
Edge
,
Node
}
from
'reactflow'
;
import
{
connectionLineStyle
}
from
'@/constants/flow'
;
import
{
connectionLineStyle
}
from
'@/constants/flow'
;
import
{
customAlphabet
}
from
'nanoid'
;
import
{
customAlphabet
}
from
'nanoid'
;
import
{
ModuleTemplates
}
from
'@/constants/flow/ModuleTemplate'
;
const
nanoid
=
customAlphabet
(
'abcdefghijklmnopqrstuvwxyz1234567890'
,
6
);
const
nanoid
=
customAlphabet
(
'abcdefghijklmnopqrstuvwxyz1234567890'
,
6
);
export
const
adaptBill
=
(
bill
:
BillSchema
):
UserBillType
=>
{
export
const
adaptBill
=
(
bill
:
BillSchema
):
UserBillType
=>
{
...
@@ -89,11 +90,36 @@ export const appModule2FlowNode = ({
...
@@ -89,11 +90,36 @@ export const appModule2FlowNode = ({
onChangeNode
:
FlowModuleItemType
[
'onChangeNode'
];
onChangeNode
:
FlowModuleItemType
[
'onChangeNode'
];
onDelNode
:
FlowModuleItemType
[
'onDelNode'
];
onDelNode
:
FlowModuleItemType
[
'onDelNode'
];
}):
Node
<
FlowModuleItemType
>
=>
{
}):
Node
<
FlowModuleItemType
>
=>
{
// init some static data
const
template
=
ModuleTemplates
.
map
((
templates
)
=>
templates
.
list
)
?.
flat
()
.
find
((
template
)
=>
template
.
flowType
===
item
.
flowType
)
||
item
;
// replace item data
const
moduleItem
=
{
...
item
,
logo
:
template
.
logo
,
name
:
template
.
name
,
intro
:
template
.
intro
,
type
:
template
.
type
,
url
:
template
.
url
,
inputs
:
template
.
inputs
.
map
((
templateInput
)
=>
({
...
templateInput
,
value
:
item
.
inputs
.
find
((
item
)
=>
item
.
key
===
templateInput
.
key
)?.
value
||
templateInput
.
value
})),
outputs
:
template
.
outputs
.
map
((
templateOutput
)
=>
({
...
templateOutput
,
targets
:
item
.
outputs
.
find
((
item
)
=>
item
.
key
===
templateOutput
.
key
)?.
targets
||
[]
}))
};
return
{
return
{
id
:
item
.
moduleId
,
id
:
item
.
moduleId
,
type
:
item
.
flowType
,
type
:
item
.
flowType
,
data
:
{
data
:
{
...
i
tem
,
...
moduleI
tem
,
onChangeNode
,
onChangeNode
,
onDelNode
onDelNode
},
},
...
...
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