公共知识库开发
This commit is contained in:
parent
73775bfb16
commit
fcda9641fc
@ -1,7 +1,5 @@
|
||||
import request from '@/config/axios'
|
||||
import { fetchEventSource } from '@microsoft/fetch-event-source'
|
||||
import { getAccessToken } from '@/utils/auth'
|
||||
import { config } from '@/config/axios/config'
|
||||
|
||||
|
||||
// 聊天VO
|
||||
export interface ChatMessageVO {
|
||||
@ -31,38 +29,6 @@ export const ChatMessageApi = {
|
||||
})
|
||||
},
|
||||
|
||||
// 发送 Stream 消息
|
||||
// 为什么不用 axios 呢?因为它不支持 SSE 调用
|
||||
sendChatMessageStream: async (
|
||||
userId: string,
|
||||
content: string,
|
||||
userName: string,
|
||||
deptFull: string,
|
||||
postName: string,
|
||||
) => {
|
||||
const token = getAccessToken()
|
||||
return await request.get({
|
||||
//url: `${config.base_url}/ai/chat?query=${content}&token=${token}`
|
||||
url: `${config.ai_url}/chat?query=${content}&token=${token}&userid=${userId}&username=${userName}&deptfull=${deptFull}&postname=${postName}&memoryflag=1`
|
||||
})
|
||||
// return fetchEventSource(`${config.base_url}/ai/chat/message/send-stream`, {
|
||||
// method: 'post',
|
||||
// headers: {
|
||||
// 'Content-Type': 'application/json',
|
||||
// Authorization: `Bearer ${token}`
|
||||
// },
|
||||
// openWhenHidden: true,
|
||||
// body: JSON.stringify({
|
||||
// conversationId,
|
||||
// content,
|
||||
// useContext: enableContext
|
||||
// }),
|
||||
// onmessage: onMessage,
|
||||
// onerror: onError,
|
||||
// onclose: onClose,
|
||||
// signal: ctrl.signal
|
||||
// })
|
||||
},
|
||||
|
||||
// 删除消息
|
||||
deleteChatMessage: async (id: string) => {
|
||||
|
Loading…
Reference in New Issue
Block a user