Merge branch 'ChatGPTNextWeb:main' into main

This commit is contained in:
Hk-Gosuto 2024-03-30 14:23:57 +08:00 committed by GitHub
commit c74c0ac8e8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -654,6 +654,7 @@ export const useChatStore = createPersistStore(
messages: topicMessages, messages: topicMessages,
config: { config: {
model: getSummarizeModel(session.mask.modelConfig.model), model: getSummarizeModel(session.mask.modelConfig.model),
stream: false,
}, },
onFinish(message) { onFinish(message) {
get().updateCurrentSession( get().updateCurrentSession(
@ -698,6 +699,10 @@ export const useChatStore = createPersistStore(
historyMsgLength > modelConfig.compressMessageLengthThreshold && historyMsgLength > modelConfig.compressMessageLengthThreshold &&
modelConfig.sendMemory modelConfig.sendMemory
) { ) {
/** Destruct max_tokens while summarizing
* this param is just shit
**/
const { max_tokens, ...modelcfg } = modelConfig;
api.llm.chat({ api.llm.chat({
messages: toBeSummarizedMsgs.concat( messages: toBeSummarizedMsgs.concat(
createMessage({ createMessage({
@ -707,7 +712,7 @@ export const useChatStore = createPersistStore(
}), }),
), ),
config: { config: {
...modelConfig, ...modelcfg,
stream: true, stream: true,
model: getSummarizeModel(session.mask.modelConfig.model), model: getSummarizeModel(session.mask.modelConfig.model),
}, },