【新增】AI:对话管理 50%

This commit is contained in:
YunaiV
2024-05-25 00:08:40 +08:00
parent ca40047f0b
commit d172d3db73
5 changed files with 196 additions and 18 deletions

View File

@ -1,10 +1,10 @@
import request from '@/config/axios'
// AI 聊天话 VO
// AI 聊天话 VO
export interface ChatConversationVO {
id: string // ID 编号
userId: number // 用户编号
title: string // 话标题
title: string // 话标题
pinned: boolean // 是否置顶
roleId: number // 角色编号
modelId: number // 模型编号
@ -20,24 +20,24 @@ export interface ChatConversationVO {
modelMaxContexts?: string // 模型的上下文的最大 Message 数量
}
// AI 聊天话 API
// AI 聊天话 API
export const ChatConversationApi = {
// 获得【我的】聊天
// 获得【我的】聊天
getChatConversationMy: async (id: string) => {
return await request.get({ url: `/ai/chat/conversation/get-my?id=${id}` })
},
// 新增【我的】聊天
// 新增【我的】聊天
createChatConversationMy: async (data?: ChatConversationVO) => {
return await request.post({ url: `/ai/chat/conversation/create-my`, data })
},
// 更新【我的】聊天
// 更新【我的】聊天
updateChatConversationMy: async (data: ChatConversationVO) => {
return await request.put({ url: `/ai/chat/conversation/update-my`, data })
},
// 删除【我的】聊天
// 删除【我的】聊天
deleteChatConversationMy: async (id: string) => {
return await request.delete({ url: `/ai/chat/conversation/delete-my?id=${id}` })
},
@ -47,8 +47,13 @@ export const ChatConversationApi = {
return await request.delete({ url: `/ai/chat/conversation/delete-my-all-except-pinned` })
},
// 获得【我的】聊天话列表
// 获得【我的】聊天话列表
getChatConversationMyList: async () => {
return await request.get({ url: `/ai/chat/conversation/my-list` })
},
// 获得对话分页
getChatConversationPage: async (params: any) => {
return await request.get({ url: `/ai/chat/conversation/page`, params })
}
}

View File

@ -6,7 +6,7 @@ import { config } from '@/config/axios/config'
// 聊天VO
export interface ChatMessageVO {
id: number // 编号
conversationId: number // 话编号
conversationId: number // 话编号
type: string // 消息类型
userId: string // 用户编号
roleId: string // 角色编号
@ -20,7 +20,7 @@ export interface ChatMessageVO {
}
export interface ChatMessageSendVO {
conversationId: string // 话编号
conversationId: string // 话编号
content: number // 聊天内容
}