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
8817e4d2
authored
Jun 01, 2023
by
archer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: qa must pay
parent
c9ee6fab
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
7 additions
and
8 deletions
+7
-8
public/docs/chatProblem.md
+0
-1
public/docs/intro.md
+0
-1
src/pages/kb/components/SelectFileModal.tsx
+1
-1
src/pages/number/index.tsx
+1
-1
src/service/events/generateQA.ts
+5
-4
No files found.
public/docs/chatProblem.md
View file @
8817e4d2
...
...
@@ -14,7 +14,6 @@
如果使用了自己的 Api Key,不会计费。可以在账号页,看到详细账单。
| 计费项 | 价格: 元/ 1K tokens(包含上下文)|
| --- | --- |
| claude - 对话 | 免费 |
| 知识库 - 索引 | 免费 |
| chatgpt - 对话 | 0.025 |
| gpt4 - 对话 | 0.5 |
...
...
public/docs/intro.md
View file @
8817e4d2
...
...
@@ -18,7 +18,6 @@ FastGpt 项目完全开源,可随意私有化部署,去除平台风险忧虑
如果使用了自己的 Api Key,不会计费。可以在账号页,看到详细账单。
| 计费项 | 价格: 元/ 1K tokens(包含上下文)|
| --- | --- |
| claude - 对话 | 免费 |
| 知识库 - 索引 | 免费 |
| chatgpt - 对话 | 0.025 |
| gpt4 - 对话 | 0.5 |
...
...
src/pages/kb/components/SelectFileModal.tsx
View file @
8817e4d2
...
...
@@ -67,7 +67,7 @@ const SelectFileModal = ({
chunks
:
[]
});
const
{
openConfirm
,
ConfirmChild
}
=
useConfirm
({
content
:
`确认导入该文件,需要一定时间进行拆解,该任务无法终止!如果余额不足,未完成的任务会被直接清除。一共
${
content
:
`确认导入该文件,需要一定时间进行拆解,该任务无法终止!
QA 拆分仅能使用余额,
如果余额不足,未完成的任务会被直接清除。一共
${
splitRes
.
chunks
.
length
}
组。
${
splitRes
.
tokens
?
`大约
${
splitRes
.
tokens
}
个tokens。`
:
''
}
`
});
...
...
src/pages/number/index.tsx
View file @
8817e4d2
...
...
@@ -136,7 +136,7 @@ const NumberSetting = () => {
</
Button
>
</
Flex
>
<
Box
fontSize=
{
'xs'
}
color=
{
'blackAlpha.500'
}
>
如果填写了自己的 openai 账号,
将不会计费
如果填写了自己的 openai 账号,
网页上 openai 模型对话不会计费。
</
Box
>
</
Box
>
<
Flex
mt=
{
6
}
alignItems=
{
'center'
}
>
...
...
src/service/events/generateQA.ts
View file @
8817e4d2
...
...
@@ -76,10 +76,11 @@ export async function generateQA(): Promise<any> {
const
kbId
=
String
(
data
.
kbId
);
// 余额校验并获取 openapi Key
const
{
userOpenAiKey
,
systemAuthKey
}
=
await
getApiKey
({
const
{
systemAuthKey
}
=
await
getApiKey
({
model
:
OpenAiChatEnum
.
GPT35
,
userId
,
type
:
'training'
type
:
'training'
,
mustPay
:
true
});
const
startTime
=
Date
.
now
();
...
...
@@ -89,7 +90,7 @@ export async function generateQA(): Promise<any> {
[
data
.
q
].
map
((
text
)
=>
modelServiceToolMap
[
OpenAiChatEnum
.
GPT35
]
.
chatCompletion
({
apiKey
:
userOpenAiKey
||
systemAuthKey
,
apiKey
:
systemAuthKey
,
temperature
:
0.8
,
messages
:
[
{
...
...
@@ -114,7 +115,7 @@ A2:
console
.
log
(
`split result length: `
,
result
.
length
);
// 计费
pushSplitDataBill
({
isPay
:
!
userOpenAiKey
&&
result
.
length
>
0
,
isPay
:
result
.
length
>
0
,
userId
:
data
.
userId
,
type
:
BillTypeEnum
.
QA
,
textLen
:
responseMessages
.
map
((
item
)
=>
item
.
value
).
join
(
''
).
length
,
...
...
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