mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-23 21:13:50 +00:00
20 lines
594 B
TypeScript
20 lines
594 B
TypeScript
import { ModuleInputKeyEnum } from '@fastgpt/global/core/module/constants';
|
|
import type { ChatItemType } from '@fastgpt/global/core/chat/type.d';
|
|
import type { ModuleDispatchProps } from '@/types/core/chat/type';
|
|
import { getHistories } from '../utils';
|
|
export type HistoryProps = ModuleDispatchProps<{
|
|
maxContext?: number;
|
|
[ModuleInputKeyEnum.history]: ChatItemType[];
|
|
}>;
|
|
|
|
export const dispatchHistory = (props: Record<string, any>) => {
|
|
const {
|
|
histories,
|
|
inputs: { maxContext }
|
|
} = props as HistoryProps;
|
|
|
|
return {
|
|
history: getHistories(maxContext, histories)
|
|
};
|
|
};
|