增加ai配置和ai广场功能
This commit is contained in:
1 parent
244b4bd9fd
commit
d9a50e23dd
27 files changed
+3808
-57
No files matched your search
@@ -0,0 +1,66 @@
|
||||
import request from "@/utils/request";
|
||||
|
||||
/** AI 服务商列表(可按 provider_type 过滤) */
|
||||
export function getAiProviderList(params) {
|
||||
return request({ url: "/platform/ai/provider/list", method: "get", params });
|
||||
}
|
||||
|
||||
export function createAiProvider(data) {
|
||||
return request({ url: "/platform/ai/provider", method: "post", data });
|
||||
}
|
||||
|
||||
export function updateAiProvider(id, data) {
|
||||
return request({ url: `/platform/ai/provider/${id}`, method: "put", data });
|
||||
}
|
||||
|
||||
export function deleteAiProvider(id) {
|
||||
return request({ url: `/platform/ai/provider/${id}`, method: "delete" });
|
||||
}
|
||||
|
||||
/** 连通性测试 { id, model? } */
|
||||
export function testAiProvider(data) {
|
||||
return request({ url: "/platform/ai/provider/test", method: "post", data });
|
||||
}
|
||||
|
||||
/** Playground 对话 { provider_id, model, messages } */
|
||||
export function aiChat(data) {
|
||||
return request({ url: "/platform/ai/chat", method: "post", data });
|
||||
}
|
||||
|
||||
export function getOcrConfig() {
|
||||
return request({ url: "/platform/ai/ocrConfig", method: "get" });
|
||||
}
|
||||
|
||||
export function saveOcrConfig(data) {
|
||||
return request({ url: "/platform/ai/ocrConfig", method: "post", data });
|
||||
}
|
||||
|
||||
/** OCR 识别占位接口 */
|
||||
export function ocrRecognize(data) {
|
||||
return request({ url: "/platform/ai/ocr/recognize", method: "post", data });
|
||||
}
|
||||
|
||||
/** AI 会话列表 */
|
||||
export function getAiChatSessions() {
|
||||
return request({ url: "/platform/ai/chat/sessions", method: "get" });
|
||||
}
|
||||
|
||||
/** 新建 AI 会话 { provider_id, model } */
|
||||
export function createAiChatSession(data) {
|
||||
return request({ url: "/platform/ai/chat/session", method: "post", data });
|
||||
}
|
||||
|
||||
/** 会话消息列表 */
|
||||
export function getAiChatSessionMessages(id) {
|
||||
return request({ url: `/platform/ai/chat/session/${id}/messages`, method: "get" });
|
||||
}
|
||||
|
||||
/** 重命名 / 置顶会话 { title?, is_top? } */
|
||||
export function updateAiChatSession(id, data) {
|
||||
return request({ url: `/platform/ai/chat/session/${id}`, method: "put", data });
|
||||
}
|
||||
|
||||
/** 删除会话 */
|
||||
export function deleteAiChatSession(id) {
|
||||
return request({ url: `/platform/ai/chat/session/${id}`, method: "delete" });
|
||||
}
|
||||
Reference in new issue
Block a user