You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
import { defHttp } from '@/utils/axios/index'
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @description 新建会话
|
|
|
|
*/
|
|
|
|
export async function addMessage(data: {
|
|
|
|
title: string
|
|
|
|
}) {
|
|
|
|
return defHttp.post({
|
|
|
|
url: `/open-chat/chat/conversation/save`,
|
|
|
|
data,
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @description 编辑会话名称
|
|
|
|
*/
|
|
|
|
export async function updateMessage(data: any) {
|
|
|
|
return defHttp.post({
|
|
|
|
url: `/open-chat/chat/conversation/update`,
|
|
|
|
data,
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @description 根据id删除会话
|
|
|
|
*/
|
|
|
|
export async function removeMessage(ids: string) {
|
|
|
|
return defHttp.post({
|
|
|
|
url: `/open-chat/chat/conversation/remove?ids=${ids}`,
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @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`,
|
|
|
|
})
|
|
|
|
}
|