v4.6.4-Outlink (#589)
This commit is contained in:
9
projects/app/src/service/moduleDispatch/utils.ts
Normal file
9
projects/app/src/service/moduleDispatch/utils.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import type { ChatItemType } from '@fastgpt/global/core/chat/type.d';
|
||||
|
||||
export const getHistories = (history?: ChatItemType[] | number, histories: ChatItemType[] = []) => {
|
||||
if (!history) return [];
|
||||
if (typeof history === 'number') return histories.slice(-history);
|
||||
if (Array.isArray(history)) return history;
|
||||
|
||||
return [];
|
||||
};
|
||||
Reference in New Issue
Block a user