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
008d0af0
authored
Oct 25, 2023
by
Archer
Committed by
GitHub
Oct 25, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Quote Modal UI and fix doc (#432)
parent
f2fb0aed
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
14 additions
and
12 deletions
+14
-12
docSite/content/docs/development/configuration.md
+1
-1
docSite/content/docs/development/intro.md
+1
-1
projects/app/src/components/ChatBox/QuoteModal.tsx
+8
-6
projects/app/src/global/common/string/tools.ts
+2
-2
projects/app/src/pages/api/system/getInitData.ts
+1
-1
projects/app/src/service/moduleDispatch/agent/classifyQuestion.ts
+1
-1
No files found.
docSite/content/docs/development/configuration.md
View file @
008d0af0
...
@@ -23,7 +23,7 @@ weight: 520
...
@@ -23,7 +23,7 @@ weight: 520
"SystemParams"
:
{
"SystemParams"
:
{
"vectorMaxProcess"
:
15
,
//
向量生成最大进程,结合数据库性能和
key
来设置
"vectorMaxProcess"
:
15
,
//
向量生成最大进程,结合数据库性能和
key
来设置
"qaMaxProcess"
:
15
,
//
QA
生成最大进程,结合数据库性能和
key
来设置
"qaMaxProcess"
:
15
,
//
QA
生成最大进程,结合数据库性能和
key
来设置
"pgHNSWEfSearch"
:
4
0
//
pg
vector
索引参数,越大精度高但速度慢
"pgHNSWEfSearch"
:
10
0
//
pg
vector
索引参数,越大精度高但速度慢
},
},
"ChatModels"
:
[
"ChatModels"
:
[
{
{
...
...
docSite/content/docs/development/intro.md
View file @
008d0af0
...
@@ -54,7 +54,7 @@ git clone git@github.com:<github_username>/FastGPT.git
...
@@ -54,7 +54,7 @@ git clone git@github.com:<github_username>/FastGPT.git
**环境变量**
**环境变量**
复制.env.template 文件,
生成一个.env.local 环境变量文件夹
,修改.env.local 里内容才是有效的变量。变量说明见 .env.template
复制.env.template 文件,
在同级目录下生成一个.env.local 文件
,修改.env.local 里内容才是有效的变量。变量说明见 .env.template
**config 配置文件**
**config 配置文件**
...
...
projects/app/src/components/ChatBox/QuoteModal.tsx
View file @
008d0af0
...
@@ -94,14 +94,16 @@ const QuoteModal = ({
...
@@ -94,14 +94,16 @@ const QuoteModal = ({
_notLast=
{
{
mb
:
2
}
}
_notLast=
{
{
mb
:
2
}
}
position=
{
'relative'
}
position=
{
'relative'
}
overflow=
{
'hidden'
}
overflow=
{
'hidden'
}
_hover=
{
{
'& .hover-data'
:
{
display
:
'flex'
}
}
}
>
>
{
!
isShare
&&
(
{
!
isShare
&&
(
<
Flex
alignItems=
{
'flex-end'
}
mb=
{
1
}
>
<
Flex
alignItems=
{
'flex-end'
}
mb=
{
3
}
color=
{
'myGray.500'
}
>
<
RawSourceText
sourceName=
{
item
.
sourceName
}
sourceId=
{
item
.
sourceId
}
/>
<
RawSourceText
sourceName=
{
item
.
sourceName
}
sourceId=
{
item
.
sourceId
}
/>
<
Box
flex=
{
1
}
/>
<
Box
flex=
{
1
}
/>
<
Link
<
Link
as=
{
NextLink
}
as=
{
NextLink
}
display=
{
'flex'
}
className=
"hover-data"
display=
{
'none'
}
alignItems=
{
'center'
}
alignItems=
{
'center'
}
color=
{
'myBlue.600'
}
color=
{
'myBlue.600'
}
href=
{
`/dataset/detail?datasetId=${item.datasetId}¤tTab=dataCard&collectionId=${item.collectionId}`
}
href=
{
`/dataset/detail?datasetId=${item.datasetId}¤tTab=dataCard&collectionId=${item.collectionId}`
}
...
@@ -112,10 +114,10 @@ const QuoteModal = ({
...
@@ -112,10 +114,10 @@ const QuoteModal = ({
</
Flex
>
</
Flex
>
)
}
)
}
<
Box
>
{
item
.
q
}
</
Box
>
<
Box
color=
{
'black'
}
>
{
item
.
q
}
</
Box
>
<
Box
>
{
item
.
a
}
</
Box
>
<
Box
color=
{
'black'
}
>
{
item
.
a
}
</
Box
>
{
!
isShare
&&
(
{
!
isShare
&&
(
<
Flex
alignItems=
{
'center'
}
mt=
{
2
}
gap=
{
4
}
>
<
Flex
alignItems=
{
'center'
}
mt=
{
3
}
gap=
{
4
}
color=
{
'myGray.500'
}
>
{
isPc
&&
(
{
isPc
&&
(
<
MyTooltip
label=
{
t
(
'core.dataset.data.id'
)
}
>
<
MyTooltip
label=
{
t
(
'core.dataset.data.id'
)
}
>
<
Flex
border=
{
theme
.
borders
.
base
}
px=
{
3
}
borderRadius=
{
'md'
}
>
<
Flex
border=
{
theme
.
borders
.
base
}
px=
{
3
}
borderRadius=
{
'md'
}
>
...
@@ -139,7 +141,7 @@ const QuoteModal = ({
...
@@ -139,7 +141,7 @@ const QuoteModal = ({
value=
{
item
.
score
*
100
}
value=
{
item
.
score
*
100
}
size=
"sm"
size=
"sm"
borderRadius=
{
'20px'
}
borderRadius=
{
'20px'
}
colorScheme=
"
g
ray"
colorScheme=
"
myG
ray"
border=
{
theme
.
borders
.
base
}
border=
{
theme
.
borders
.
base
}
/>
/>
<
Box
>
{
item
.
score
.
toFixed
(
4
)
}
</
Box
>
<
Box
>
{
item
.
score
.
toFixed
(
4
)
}
</
Box
>
...
...
projects/app/src/global/common/string/tools.ts
View file @
008d0af0
...
@@ -21,13 +21,13 @@ export function replaceVariable(text: string, obj: Record<string, string | numbe
...
@@ -21,13 +21,13 @@ export function replaceVariable(text: string, obj: Record<string, string | numbe
* maxLen > overlapLen
* maxLen > overlapLen
*/
*/
export
const
splitText2Chunks
=
({
text
=
''
,
maxLen
}:
{
text
:
string
;
maxLen
:
number
})
=>
{
export
const
splitText2Chunks
=
({
text
=
''
,
maxLen
}:
{
text
:
string
;
maxLen
:
number
})
=>
{
const
overlapLen
=
Math
.
floor
(
maxLen
*
0.
2
);
// Overlap length
const
overlapLen
=
Math
.
floor
(
maxLen
*
0.
15
);
// Overlap length
const
tempMarker
=
'SPLIT_HERE_SPLIT_HERE'
;
const
tempMarker
=
'SPLIT_HERE_SPLIT_HERE'
;
const
stepReg
:
Record
<
number
,
RegExp
>
=
{
const
stepReg
:
Record
<
number
,
RegExp
>
=
{
0
:
/
(
\
n
\
n
)
/
g
,
0
:
/
(
\
n
\
n
)
/
g
,
1
:
/
([
\
n
])
/
g
,
1
:
/
([
\
n
])
/
g
,
2
:
/
([
。
]
|
\
.
\
s
)
/
g
,
2
:
/
[
。
]
|
(?
!<
[
^
a
-
zA
-
Z
])
\
.
\
s
/
g
,
3
:
/
([
!?
]
|!
\s
|
\?\s)
/g
,
3
:
/
([
!?
]
|!
\s
|
\?\s)
/g
,
4
:
/
([
;
]
|
;
\
s
)
/
g
,
4
:
/
([
;
]
|
;
\
s
)
/
g
,
5
:
/
([
,
]
|
,
\
s
)
/
g
5
:
/
([
,
]
|
,
\
s
)
/
g
...
...
projects/app/src/pages/api/system/getInitData.ts
View file @
008d0af0
...
@@ -43,7 +43,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
...
@@ -43,7 +43,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
const
defaultSystemEnv
:
SystemEnvType
=
{
const
defaultSystemEnv
:
SystemEnvType
=
{
vectorMaxProcess
:
15
,
vectorMaxProcess
:
15
,
qaMaxProcess
:
15
,
qaMaxProcess
:
15
,
pgHNSWEfSearch
:
4
0
pgHNSWEfSearch
:
10
0
};
};
const
defaultFeConfigs
:
FeConfigsType
=
{
const
defaultFeConfigs
:
FeConfigsType
=
{
show_emptyChat
:
true
,
show_emptyChat
:
true
,
...
...
projects/app/src/service/moduleDispatch/agent/classifyQuestion.ts
View file @
008d0af0
...
@@ -131,7 +131,7 @@ ${systemPrompt}
...
@@ -131,7 +131,7 @@ ${systemPrompt}
tokens
:
response
.
usage
?.
total_tokens
||
0
tokens
:
response
.
usage
?.
total_tokens
||
0
};
};
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
log
(
'Your model may not support function_call'
);
console
.
log
(
'Your model may not support function_call'
,
error
);
return
{
return
{
arg
:
{},
arg
:
{},
...
...
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