mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-23 13:03:50 +00:00
perf: 文案优化
This commit is contained in:
@@ -60,9 +60,9 @@ export const chatProblem = `
|
||||
`;
|
||||
|
||||
export const versionIntro = `
|
||||
## Fast GPT V2.3
|
||||
* 数据集导出功能,可用于知识库分享。
|
||||
## Fast GPT V2.4
|
||||
* 优化文件拆分功能,可自定义提示词。
|
||||
* 优化文件拆分和索引生成的速度。
|
||||
* 定制知识库:创建模型时可以选择【知识库】模型, 可以手动导入知识点或者直接导入一个文件自动学习。
|
||||
`;
|
||||
|
||||
|
@@ -119,6 +119,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
|
||||
try {
|
||||
const json = JSON.parse(data);
|
||||
const content: string = json?.choices?.[0].delta.content || '';
|
||||
// 空内容不要。首行换行符不要
|
||||
if (!content || (responseContent === '' && content === '\n')) return;
|
||||
|
||||
responseContent += content;
|
||||
|
@@ -110,7 +110,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
|
||||
|
||||
prompts.unshift({
|
||||
obj: 'SYSTEM',
|
||||
value: `${model.systemPrompt} 知识库内容是最新的,知识库内容为: "${systemPrompt}"`
|
||||
value: `${model.systemPrompt} 知识库内容是最新的,知识库内容为: "${systemPrompt}"`
|
||||
});
|
||||
|
||||
// 控制在 tokens 数量,防止超出
|
||||
|
@@ -148,8 +148,8 @@ const ModelDataCard = ({ model }: { model: ModelSchema }) => {
|
||||
>
|
||||
手动输入
|
||||
</MenuItem>
|
||||
<MenuItem onClick={onOpenSelectFileModal}>文件导入</MenuItem>
|
||||
<MenuItem onClick={onOpenSelectUrlModal}>网站地址导入</MenuItem>
|
||||
<MenuItem onClick={onOpenSelectFileModal}>文件QA拆分</MenuItem>
|
||||
<MenuItem onClick={onOpenSelectUrlModal}>网站内容QA拆分</MenuItem>
|
||||
<MenuItem onClick={onOpenSelectJsonModal}>JSON导入</MenuItem>
|
||||
</MenuList>
|
||||
</Menu>
|
||||
|
@@ -37,7 +37,7 @@ const ModelDetail = ({ modelId }: { modelId: string }) => {
|
||||
setLoading(true);
|
||||
try {
|
||||
const res = await getModelById(modelId);
|
||||
console.log(res);
|
||||
// console.log(res);
|
||||
res.security.expiredTime /= 60 * 60 * 1000;
|
||||
setModel(res);
|
||||
formHooks.reset(res);
|
||||
|
@@ -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