Refa: align chat and search restful APIs (#14229)

### What problem does this PR solve?

Refactor /api/v1/chats to be more RESTful.

### Type of change

- [x] Refactoring

---------

Co-authored-by: Jin Hai <haijin.chn@gmail.com>
This commit is contained in:
buua436
2026-04-22 10:49:11 +08:00
committed by GitHub
parent bfac0195df
commit 6baf74afc1
14 changed files with 362 additions and 160 deletions

View File

@@ -52,7 +52,7 @@ export default {
// plugin
llmTools: `${webAPI}/plugin/llm_tools`,
chatsTranscriptions: `${restAPIv1}/chats/transcriptions`,
chatsTranscriptions: `${restAPIv1}/chat/audio/transcription`,
// knowledge base
@@ -147,12 +147,12 @@ export default {
`${restAPIv1}/chats/${chatId}/sessions/${sessionId}/messages/${msgId}`,
thumbup: (chatId: string, sessionId: string, msgId: string) =>
`${restAPIv1}/chats/${chatId}/sessions/${sessionId}/messages/${msgId}/feedback`,
completionUrl: (chatId: string, sessionId: string) =>
`${restAPIv1}/chats/${chatId}/sessions/${sessionId}/completions`,
chatsTts: `${restAPIv1}/chats/tts`,
ask: `${restAPIv1}/chats/ask`,
chatsMindmap: `${restAPIv1}/chats/mindmap`,
chatsRelatedQuestions: `${restAPIv1}/chats/related_questions`,
completionUrl: `${restAPIv1}/chat/completions`,
chatsTts: `${restAPIv1}/chat/audio/speech`,
searchCompletion: (searchId: string) =>
`${restAPIv1}/searches/${searchId}/completion`,
chatsMindmap: `${restAPIv1}/chat/mindmap`,
chatsRelatedQuestions: `${restAPIv1}/chat/recommandation`,
// next chat
fetchExternalChatInfo: (id: string) => `${restAPIv1}/chatbots/${id}/info`,