

export type TMessage = {
  content: string,
  dislikeReason: string,
  isDislike: boolean,
  isLike: boolean,
  isStreaming: boolean,
  msgId: number,
  msgTime: string,
  msgUk: string,
  originalAgentId: string,
  role: string
}



export enum EContentType {
  TextPlain = 'text/plain',
  ApplicationJson = 'application/json',
  AiseekAudioChunk = 'aiseek/audio_chunk',
  AiseekThinking = 'aiseek/thinking',
  AiseekFunctionCall = 'aiseek/function_call',
  AiseekMultimodal = 'aiseek/multimodal',
  AiseekQA = 'aiseek/qa'
}

export enum EChatRole {
  System = 'system',
  User = 'user',
  Assistant = 'assistant',
  Function = 'function',
  Tool = 'tool'
}

// 导出对应的联合类型
// export type TChatRole = `${ChatRole}`; // TypeScript 4.1+ 模板字面量类型
// 或兼容写法：
export type TChatRole = EChatRole[keyof EChatRole];

export type TContentType = EContentType[keyof EContentType];


export type TRequestMessage = {
  content: any;
  contentType: TContentType;
  role: TChatRole;
};

export type TRequestBody = {
  agentId: string;
  isEnableOutputAudioStream: boolean;
  isEnableSearch: boolean;
  isEnableThinking: boolean;
  loginId: string;
  messages: TRequestMessage[];
  sessionId: string;
};

export type TAppendMessage  = {
    content: any,
    contentType: TContentType,
    isStreaming: false,
    msgUk: string,
    role: TChatRole
}
export type TAppendMessages = {
  agentId: string,
  loginId: string,
  messages: TAppendMessage[],
  sessionId: string
}

export type TMessageHistories = {
  data: TMessage|TRobotMessage[];
  nextId: string;
  totalCount: 0;
};