mirror of
https://github.com/labring/FastGPT.git
synced 2025-08-03 13:38:00 +00:00
4.6.4-alpha (#582)
This commit is contained in:
@@ -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
|
||||
},
|
||||
{
|
||||
|
@@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user