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
64db0e4f
authored
Apr 08, 2024
by
Archer
Committed by
GitHub
Apr 08, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update queryExtension.ts
修复问题扩展历史记录问题
parent
5cfa4328
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletions
+2
-1
packages/service/core/ai/functions/queryExtension.ts
+2
-1
No files found.
packages/service/core/ai/functions/queryExtension.ts
View file @
64db0e4f
...
...
@@ -3,6 +3,7 @@ import { getAIApi } from '../config';
import
{
ChatItemType
}
from
'@fastgpt/global/core/chat/type'
;
import
{
countGptMessagesTokens
}
from
'@fastgpt/global/common/string/tiktoken'
;
import
{
ChatCompletionMessageParam
}
from
'@fastgpt/global/core/ai/type'
;
import
{
chatValue2RuntimePrompt
}
from
'@fastgpt/global/core/chat/adapt'
;
/*
query extension - 问题扩展
...
...
@@ -117,7 +118,7 @@ A: ${chatBg}
const
historyFewShot
=
histories
.
map
((
item
)
=>
{
const
role
=
item
.
obj
===
'Human'
?
'Q'
:
'A'
;
return
`
${
role
}
:
${
item
.
value
}
`
;
return
`
${
role
}
:
${
chatValue2RuntimePrompt
(
item
.
value
).
text
}
`
;
})
.
join
(
'\n'
);
const
concatFewShot
=
`
${
systemFewShot
}${
historyFewShot
}
`
.
trim
();
...
...
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