Files
lobe-chat/src/types/chatMessage.ts
T
canisminor1990 4e522a6e2b 🔧 chore: Update setting
This commit introduces new components, modules, and features related to chat, sessions, and settings. It includes modifications to configuration files, updates to dependencies, adjustments to styles and layouts, and additions of new components and modules. The changes also involve updates to functions, interfaces, selectors, actions, and reducers. Additionally, there are modifications to TypeScript interfaces and types, as well as changes to parameters and functions in certain files.
2023-07-15 15:48:20 +08:00

47 lines
771 B
TypeScript

import { LLMRoleType } from './llm';
import { BaseDataModel } from './meta';
/**
* 聊天消息错误对象
*/
export interface ChatMessageError {
/**
* 错误信息
*/
message: string;
status: number;
type: 'general' | 'llm';
}
export interface ChatMessage extends BaseDataModel {
archive?: boolean;
/**
* @title 内容
* @description 消息内容
*/
content: string;
error?: any;
// 扩展字段
extra?: {
// 翻译
translate: {
target: string;
to: string;
};
// 语音
} & Record<string, any>;
parentId?: string;
// 引用
quotaId?: string;
/**
* 角色
* @description 消息发送者的角色
*/
role: LLMRoleType;
}
export type ChatMessageMap = Record<string, ChatMessage>;