v4.6.9-alpha (#918)

Co-authored-by: Mufei <327958099@qq.com>
Co-authored-by: heheer <71265218+newfish-cmyk@users.noreply.github.com>
This commit is contained in:
Archer
2024-03-04 00:05:25 +08:00
committed by GitHub
parent f9f0b4bffd
commit 42a8184ea0
153 changed files with 4906 additions and 4307 deletions

View File

@@ -1,7 +1,7 @@
import { replaceVariable } from '@fastgpt/global/common/string/tools';
import { getAIApi } from '../config';
import { ChatItemType } from '@fastgpt/global/core/chat/type';
import { countGptMessagesChars } from '../../chat/utils';
import { countGptMessagesTokens } from '@fastgpt/global/common/string/tiktoken';
/*
query extension - 问题扩展
@@ -106,7 +106,7 @@ export const queryExtension = async ({
rawQuery: string;
extensionQueries: string[];
model: string;
charsLength: number;
tokens: number;
}> => {
const systemFewShot = chatBg
? `Q: 对话背景。
@@ -148,7 +148,7 @@ A: ${chatBg}
rawQuery: query,
extensionQueries: [],
model,
charsLength: 0
tokens: 0
};
}
@@ -161,7 +161,7 @@ A: ${chatBg}
rawQuery: query,
extensionQueries: queries,
model,
charsLength: countGptMessagesChars(messages)
tokens: countGptMessagesTokens(messages)
};
} catch (error) {
console.log(error);
@@ -169,7 +169,7 @@ A: ${chatBg}
rawQuery: query,
extensionQueries: [],
model,
charsLength: 0
tokens: 0
};
}
};