perf: 文案优化
This commit is contained in:
@@ -105,7 +105,8 @@ export async function generateAbstract(next = false): Promise<any> {
|
||||
isPay: !userApiKey && splitContents.length > 0,
|
||||
userId: dataItem.userId,
|
||||
type: 'abstract',
|
||||
text: systemPrompt.content + dataItem.text + rawContent
|
||||
text: systemPrompt.content + dataItem.text + rawContent,
|
||||
tokenLen: 0
|
||||
});
|
||||
} catch (error: any) {
|
||||
console.log('error: 生成摘要错误', dataItem?._id);
|
||||
|
||||
@@ -79,8 +79,10 @@ export async function generateQA(next = false): Promise<any> {
|
||||
.createChatCompletion(
|
||||
{
|
||||
model: ChatModelNameEnum.GPT35,
|
||||
temperature: 0.8,
|
||||
temperature: 0.7,
|
||||
n: 1,
|
||||
frequency_penalty: 1, // 越大,重复内容越少
|
||||
presence_penalty: -1, // 越大,越容易出现新内容
|
||||
messages: [
|
||||
systemPrompt,
|
||||
{
|
||||
|
||||
@@ -93,5 +93,5 @@ export const systemPromptFilter = (prompts: string[], maxTokens: number) => {
|
||||
}
|
||||
}
|
||||
|
||||
return splitText;
|
||||
return splitText.slice(0, splitText.length - 1);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user