/** * Copyright (c) 2013-Now https://jeesite.com All rights reserved. * No deletion without permission, or be held responsible to law. * @author ThinkGem */ import { defHttp } from '@jeesite/core/utils/http/axios'; import { useGlobSetting } from '@jeesite/core/hooks/setting'; import { Conversation, Message } from './dto'; const { adminPath } = useGlobSetting(); export const saveConversation = (data: Conversation) => defHttp.postJson({ url: adminPath + '/ai/session', data }); export const getAllConversations = () => defHttp.get({ url: adminPath + '/ai/list' }); export const getMessagesByConversation = (params?: string) => defHttp.get({ url: adminPath + '/ai/getMessagesByConversation', params: { id: params } }); export const editConversation = (data: Conversation) => defHttp.postJson({ url: adminPath + '/ai/editConversation', data }); export const deleteConversation = (id: string) => defHttp.get({ url: adminPath + '/ai/deleteConversation', params: { id } });