Add modal to show completion response data (#324)

This commit is contained in:
Archer
2023-09-19 20:31:45 +08:00
committed by GitHub
parent ce7da2db66
commit ac4355d2e1
24 changed files with 486 additions and 156 deletions

View File

@@ -1,13 +1,16 @@
import { SystemInputEnum } from '@/constants/app';
import { ChatItemType } from '@/types/chat';
import type { ModuleDispatchProps } from '@/types/core/modules';
export type HistoryProps = {
export type HistoryProps = ModuleDispatchProps<{
maxContext: number;
[SystemInputEnum.history]: ChatItemType[];
};
}>;
export const dispatchHistory = (props: Record<string, any>) => {
const { maxContext = 5, history = [] } = props as HistoryProps;
const {
inputs: { maxContext = 5, history = [] }
} = props as HistoryProps;
return {
history: maxContext > 0 ? history.slice(-maxContext) : []