wujingjing
2024-07-24 4eb6092c32df67d752101ab8ae23c9b2236db0dc
src/components/chat/model/types.ts
@@ -10,6 +10,8 @@
   RecordSet = 'recordset',
   Text = 'text',
   Summary = 'summary',
   Url = 'url',
   Map = 'map',
}
export const answerTypeMapCom = {
@@ -22,32 +24,38 @@
export const enum RoleEnum {
   user = 'user',
   assistant = 'assistant',
   system = 'system',
}
export const AnswerState = {
   Null: null,
   Like: '1',
   Unlike:'0',
   Unlike: '0',
};
export type AnswerStateType = typeof AnswerState;
export type ContextHistory = {
   /** @description 数字字符串 */
   ratio: string;
   history_id: string;
   question: string;
};
export type ChatContent = {
   type: AnswerType;
   values: any;
   askMoreList?: ContextHistory[];
   errCode?: string;
   errMsg?: string;
   origin?: any;
};
export interface ChatMessage {
   historyId:string,
   historyId: string;
   role: RoleEnum;
   content?: ChatContent;
   state?: null | '1' | '0'
   state?: null | '1' | '0';
}
export const roleImageMap = {
   [RoleEnum.user]: userPic,
   [RoleEnum.assistant]: assistantPic,
   [RoleEnum.system]: userPic,
};