From 605467fb93b73eb3d019933f7499ec8ad1837420 Mon Sep 17 00:00:00 2001 From: wujingjing <gersonwu@qq.com> Date: 星期三, 18 十二月 2024 14:51:11 +0800 Subject: [PATCH] 流式回答展示 --- src/components/chat/model/types.ts | 40 +++++++++++++++++++++++++++++++++++++++- 1 files changed, 39 insertions(+), 1 deletions(-) diff --git a/src/components/chat/model/types.ts b/src/components/chat/model/types.ts index 262dc7a..6128cea 100644 --- a/src/components/chat/model/types.ts +++ b/src/components/chat/model/types.ts @@ -12,6 +12,7 @@ Summary = 'summary', Url = 'url', Map = 'map', + // Report = 'report', } export const answerTypeMapCom = { @@ -19,6 +20,7 @@ [AnswerType.RecordSet]: RecordSetCom, [AnswerType.Text]: NormalTextCom, [AnswerType.Summary]: SummaryCom, + // [AnswerType.Report]: ReportCom, }; export const enum RoleEnum { @@ -46,6 +48,7 @@ errCode?: string; errMsg?: string; origin?: any; + createTime?: string; }; export interface ChatMessage { @@ -53,10 +56,45 @@ role: RoleEnum; content?: ChatContent; state?: null | '1' | '0'; - sectionAId?:string + sectionAId?: string; + createTime?: string; + stepList?: StepItem[]; + stepIsShow?: boolean; + isStopMsg?: boolean; + /** @description 鏄惁琚�夋嫨鍒嗕韩 */ + isChecked: boolean; + conclusion?: any[]; } export const roleImageMap = { [RoleEnum.user]: userPic, [RoleEnum.assistant]: assistantPic, }; + +export const enum StepEnum { + Loading, + Success, + Error, +} +export const stepEnumMap = { + [StepEnum.Loading]: 'process', + [StepEnum.Success]: 'process', + [StepEnum.Error]: 'process', +}; +export const enum MultiChatType { + Select = 'select', + Summary = 'summary', + Result = 'result', +} +type SubStep = { + data:any; + type: MultiChatType; +}; + +export type StepItem = { + title: string; + status: StepEnum; + // 娑堣�楁椂闂� + ms?: string | number; + subStep?: SubStep[]; +}; -- Gitblit v1.9.3