|
|
|
import { defHttp } from '@/utils/axios/index'
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @description 对话列表
|
|
|
|
*/
|
|
|
|
export async function conversationList() {
|
|
|
|
return defHttp.get({
|
|
|
|
url: `/open-chat/chat/conversation/list`,
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @description 对话历史记录
|
|
|
|
*/
|
|
|
|
export async function historyMessage(params: {
|
|
|
|
conversationId: string
|
|
|
|
current: number
|
|
|
|
size: number
|
|
|
|
}) {
|
|
|
|
return defHttp.get({
|
|
|
|
url: `/open-chat/chat/chatMessageLog/page`,
|
|
|
|
params,
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @description 发送消息
|
|
|
|
*/
|
|
|
|
export async function sendMessage(data: {
|
|
|
|
roleId: number
|
|
|
|
conversationId: string
|
|
|
|
question: string
|
|
|
|
}) {
|
|
|
|
return defHttp.post({
|
|
|
|
url: `/open-chat/chat/session`,
|
|
|
|
data,
|
|
|
|
timeout: 30 * 1000,
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @description 获取chat信息
|
|
|
|
*/
|
|
|
|
export async function chatInfo() {
|
|
|
|
return defHttp.get({
|
|
|
|
url: `/open-chat/chat/ai/getWxUserInfo`,
|
|
|
|
})
|
|
|
|
}
|