houzhongjian
2025-06-12 11697cb7da4e5d78d21bd2f5c107da456a08c594
src/api/ai/chat/message/index.ts
@@ -13,10 +13,20 @@
  model: number // 模型标志
  modelId: number // 模型编号
  content: string // 聊天内容
  thinking: string // 聊天思考
  thinkingFlag: boolean // 聊天思考
  conclusion: string // 聊天结论
  tokens: number // 消耗 Token 数量
  segmentIds?: number[] // 段落编号
  segments?: {
    id: number // 段落编号
    content: string // 段落内容
    documentId: number // 文档编号
    documentName: string // 文档名称
  }[]
  createTime: Date // 创建时间
  roleAvatar: string // 角色头像
  userAvatar: string // 创建时间
  userAvatar: string // 用户头像
}
// AI chat 聊天
@@ -28,6 +38,21 @@
    })
  },
  // 消息列表
  getChatMessagePageListByConversationId: async (params: number | null) => {
    return await request.get({
      url: `/ai/chat/message/page-list-by-conversation-id`,
      params: params
    })
  },
  // 消息列表【工业大模型专用】
  getEnergyChatMessageListByConversationId: async (conversationId: number | null) => {
    return await request.get({
      url: `/ai/chat/message/energy-list-by-conversation-id?conversationId=${conversationId}`
    })
  },
  // 发送 Stream 消息
  // 为什么不用 axios 呢?因为它不支持 SSE 调用
  sendChatMessageStream: async (