UNPKG

@lobehub/ui

Version:

Lobe UI is an open-source UI component library for building AIGC web apps

38 lines (37 loc) 877 B
import type { ChatMessageError, LLMMessage, LLMRoleType } from "../types"; export type MessageDispatch = { message: LLMMessage; type: 'addMessage'; } | { index: number; message: LLMMessage; type: 'insertMessage'; } | { index: number; type: 'deleteMessage'; } | { type: 'resetMessages'; } | { index: number; message: string; type: 'updateMessage'; } | { index: number; role: LLMRoleType; type: 'updateMessageRole'; } | { message: string; type: 'addUserMessage'; } | { responseStream: string[]; type: 'updateLatestBotMessage'; } | { index: number; message: string; type: 'updateMessageChoice'; } | { error: ChatMessageError | undefined; index: number; type: 'setErrorMessage'; }; export declare const messagesReducer: (state: LLMMessage[], payload: MessageDispatch) => LLMMessage[];