format-dialog-chat-finished-message.js 945 B

1234567891011121314151617181920212223242526272829
  1. import { jsonParse, jsonStringify } from '../../utils/utils';
  2. import { formatCodePython, formatCodeSql } from './format-code-string';
  3. /**
  4. * 当用户已发送消息,但是还未返回时
  5. * 此时界面上应该显示一个Loading状态
  6. */
  7. export default function formatDialogChatFinishedMessage(preMsg) {
  8. // 本次对话的消息内容
  9. const currentMsg = {
  10. /**
  11. * 客户端自定义字段
  12. */
  13. client_custom_type: '',
  14. /**
  15. * 会话展示时,可以通过此值,判断该如何进行内容显示
  16. * 当值为0时,可能显示加载中动画
  17. * 当值为1时,展示消息内容,展示 停止生成按钮
  18. * 当值为2时,可能展示反馈操作按钮
  19. */
  20. client_custom_chat_status: 2, // 此轮会话的状态值 0 加载中 1 进行中 2 已结束
  21. content: '', // 消息正文,markdown格式,需要进行解析
  22. system: '' // 系统消息
  23. };
  24. return currentMsg;
  25. }