Commit 8036ed61 by archer

perf: qa

parent 85e6a0f3
......@@ -103,7 +103,7 @@ export async function appKbSearch({
.map((item) => `'${item}'`)
.join(',')}) AND vector <#> '[${promptVector[0]}]' < -${similarity} order by vector <#> '[${
promptVector[0]
}]' limit 15;
}]' limit 10;
COMMIT;`
);
......
......@@ -29,14 +29,14 @@ const fileExtension = '.txt,.doc,.docx,.pdf,.md';
const modeMap = {
[TrainingModeEnum.qa]: {
maxLen: 9000,
maxLen: 8000,
slideLen: 3000,
price: ChatModelMap[OpenAiChatEnum.GPT35].price,
isPrompt: true
},
[TrainingModeEnum.index]: {
maxLen: 2000,
slideLen: 600,
maxLen: 1400,
slideLen: 700,
price: embeddingPrice,
isPrompt: false
}
......
......@@ -94,9 +94,9 @@ export async function generateQA(): Promise<any> {
messages: [
{
obj: ChatRoleEnum.System,
value: `你是出题人
${data.prompt || '下面是"一段长文本"'}
从中选出15至30个题目和答案.答案详细.按格式返回: Q1:
value: `你是出题人.
${data.prompt || '用户会发送一段长文本'}.
从中选出 25 个问题和答案. 答案详细完整. 按格式回答: Q1:
A1:
Q2:
A2:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment