import { STATIC_FILE_BASE_URL } from "@/config/constants";
|
|
export const AnswerType ={
|
Knowledge : 'knowledge',
|
RecordSet : 'recordset',
|
Text : 'text',
|
Summary : 'summary',
|
Url : 'url',
|
Map : 'map',
|
}
|
export type AnswerTypeType = typeof AnswerType;
|
|
// export const answerTypeMapCom = {
|
// [AnswerType.Knowledge]: knowledgeCom,
|
// [AnswerType.RecordSet]: RecordSetCom,
|
// [AnswerType.Text]: NormalTextCom,
|
// [AnswerType.Summary]: SummaryCom,
|
// };
|
|
export const RoleEnum= {
|
user : 'user',
|
assistant : 'assistant',
|
}
|
|
export type RoleEnumType = typeof RoleEnum;
|
|
export const AnswerState = {
|
Null: null,
|
Like: '1',
|
Unlike: '0',
|
};
|
|
export type AnswerStateType = typeof AnswerState;
|
export type ContextHistory = {
|
/** @description 数字字符串 */
|
ratio: string;
|
history_id: string;
|
question: string;
|
};
|
|
export type ChatContent = {
|
type: AnswerTypeType[keyof AnswerTypeType];
|
values: any;
|
askMoreList?: ContextHistory[];
|
errCode?: string;
|
errMsg?: string;
|
origin?: any;
|
};
|
|
export interface ChatMessage {
|
historyId: string;
|
role: RoleEnumType[keyof RoleEnumType];
|
content?: ChatContent;
|
state?: null | '1' | '0';
|
}
|
|
export const roleImageMap = {
|
[RoleEnum.user]: STATIC_FILE_BASE_URL+'/static/images/role/user.svg',
|
[RoleEnum.assistant]:STATIC_FILE_BASE_URL+ '/static/images/role/assistant.jpg',
|
};
|