workcase web ai聊天
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { api } from '@/api/index'
|
||||
import { API_BASE_URL } from '@/config'
|
||||
import type { ResultDomain } from '@/types'
|
||||
import type { TbChat, TbChatMessage, ChatPrepareData, StopChatParam, CommentMessageParam, DifyFileInfo } from '@/types/ai'
|
||||
|
||||
@@ -37,7 +38,7 @@ export const aiChatAPI = {
|
||||
* @param chat 会话信息
|
||||
*/
|
||||
async deleteChat(chat: TbChat): Promise<ResultDomain<TbChat>> {
|
||||
const response = await api.delete<TbChat>(`${this.baseUrl}/conversation`, { data: chat })
|
||||
const response = await api.delete<TbChat>(`${this.baseUrl}/conversation`, chat )
|
||||
return response.data
|
||||
},
|
||||
|
||||
@@ -46,7 +47,7 @@ export const aiChatAPI = {
|
||||
* @param filter 筛选条件
|
||||
*/
|
||||
async getChatList(filter: TbChat): Promise<ResultDomain<TbChat>> {
|
||||
const response = await api.get<TbChat>(`${this.baseUrl}/conversations`, { data: filter })
|
||||
const response = await api.post<TbChat>(`${this.baseUrl}/conversation/list`, filter)
|
||||
return response.data
|
||||
},
|
||||
|
||||
@@ -77,7 +78,7 @@ export const aiChatAPI = {
|
||||
* @param sessionId 会话ID
|
||||
*/
|
||||
getStreamChatUrl(sessionId: string): string {
|
||||
return `${this.baseUrl}/stream?sessionId=${sessionId}`
|
||||
return `${API_BASE_URL}${this.baseUrl}/stream?sessionId=${sessionId}`
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user