4.6.4-alpha (#582)

This commit is contained in:
Archer
2023-12-08 15:01:11 +08:00
committed by GitHub
parent 54d52d8d25
commit b58249fc3a
66 changed files with 962 additions and 527 deletions

View File

@@ -368,20 +368,7 @@ export const appTemplates: (AppItemType & {
type: 'slider',
label: '单次搜索上限',
description: '最多取 n 条记录作为本次问题引用',
value: 5,
min: 1,
max: 20,
step: 1,
markList: [
{
label: '1',
value: 1
},
{
label: '20',
value: 20
}
],
value: 1500,
connected: true
},
{
@@ -1418,22 +1405,9 @@ export const appTemplates: (AppItemType & {
{
key: 'limit',
type: 'slider',
label: '单次搜索上限',
description: '最多取 n 条记录作为本次问题引用',
value: 5,
min: 1,
max: 20,
step: 1,
markList: [
{
label: '1',
value: 1
},
{
label: '20',
value: 20
}
],
label: '引用上限',
description: '单次搜索最大的 Tokens 数量中文约1字=1.7Tokens英文约1字=1Tokens',
value: 1500,
connected: true
},
{

View File

@@ -7,7 +7,8 @@ import type {
getHistoriesProps,
ClearHistoriesProps,
DelHistoryProps,
UpdateHistoryProps
UpdateHistoryProps,
DeleteChatItemProps
} from '@/global/core/chat/api';
import {
delChatHistoryById,
@@ -31,7 +32,7 @@ type State = {
setLastChatAppId: (id: string) => void;
lastChatId: string;
setLastChatId: (id: string) => void;
delOneHistoryItem: (e: { chatId: string; contentId?: string; index: number }) => Promise<any>;
delOneHistoryItem: (e: DeleteChatItemProps & { index: number }) => Promise<any>;
};
export const useChatStore = create<State>()(
@@ -119,7 +120,8 @@ export const useChatStore = create<State>()(
});
}
},
async delOneHistoryItem({ chatId, contentId, index }) {
async delOneHistoryItem({ index, ...props }) {
const { chatId, contentId } = props;
if (!chatId || !contentId) return;
try {
@@ -127,7 +129,7 @@ export const useChatStore = create<State>()(
...state,
history: state.history.filter((_, i) => i !== index)
}));
await delChatRecordById({ chatId, contentId });
await delChatRecordById(props);
} catch (err) {
console.log(err);
}