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
006b1be2
authored
Aug 19, 2023
by
archer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
perf: quote prompt
parent
4d8c03ea
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
client/src/service/moduleDispatch/chat/oneapi.ts
+7
-7
No files found.
client/src/service/moduleDispatch/chat/oneapi.ts
View file @
006b1be2
...
@@ -201,7 +201,7 @@ function filterQuote({
...
@@ -201,7 +201,7 @@ function filterQuote({
maxToken
:
model
.
quoteMaxToken
,
maxToken
:
model
.
quoteMaxToken
,
messages
:
quoteQA
.
map
((
item
)
=>
({
messages
:
quoteQA
.
map
((
item
)
=>
({
obj
:
ChatRoleEnum
.
System
,
obj
:
ChatRoleEnum
.
System
,
value
:
item
.
a
?
`{
instruction:
${
item
.
q
}
,outpu
t:
${
item
.
a
}
}`
:
`{instruction:
${
item
.
q
}
}`
value
:
item
.
a
?
`{
user:
${
item
.
q
}
,assistan
t:
${
item
.
a
}
}`
:
`{instruction:
${
item
.
q
}
}`
}))
}))
});
});
...
@@ -210,11 +210,11 @@ function filterQuote({
...
@@ -210,11 +210,11 @@ function filterQuote({
const
quotePrompt
=
const
quotePrompt
=
filterQuoteQA
.
length
>
0
filterQuoteQA
.
length
>
0
?
`
下面是知识库内容:
?
`
${
filterQuoteQA
${
filterQuoteQA
.
map
((
item
)
=>
.
map
((
item
)
=>
(
item
.
a
?
`{instruction:
${
item
.
q
}
,output:
${
item
.
a
}
}`
:
`{instruction:
${
item
.
q
}
}`
))
item
.
a
?
`{user:
${
item
.
q
}
,assistant:
${
item
.
a
}
}`
:
`{instruction:
${
item
.
q
}
}`
.
join
(
'\n'
)}
)
`
.
join
(
'\n'
)}
`
:
''
;
:
''
;
return
{
return
{
...
@@ -240,7 +240,7 @@ function getChatMessages({
...
@@ -240,7 +240,7 @@ function getChatMessages({
const
limitText
=
(()
=>
{
const
limitText
=
(()
=>
{
if
(
limitPrompt
)
return
limitPrompt
;
if
(
limitPrompt
)
return
limitPrompt
;
if
(
quotePrompt
&&
!
limitPrompt
)
{
if
(
quotePrompt
&&
!
limitPrompt
)
{
return
'
严格按照知识库提供的内容回答,不要做过多
补充。'
;
return
'
根据我上文提供的内容回答下面问题,不要进行额外
补充。'
;
}
}
return
''
;
return
''
;
})();
})();
...
...
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