zhou zhou
13 小时以前 5e40dee0e0a4e4cff4a1aafca2444f61c39cbf32
rsf-admin/src/api/ai/chat.js
@@ -13,9 +13,9 @@
    throw new Error(msg || "获取 AI 运行时信息失败");
};
export const getAiSessions = async (promptCode = "home.default") => {
export const getAiSessions = async (promptCode = "home.default", keyword = "") => {
    const res = await request.get("ai/chat/sessions", {
        params: { promptCode },
        params: { promptCode, keyword },
    });
    const { code, msg, data } = res.data;
    if (code === 200) {
@@ -33,6 +33,24 @@
    throw new Error(msg || "删除 AI 会话失败");
};
export const renameAiSession = async (sessionId, title) => {
    const res = await request.post(`ai/chat/session/rename/${sessionId}`, { title });
    const { code, msg, data } = res.data;
    if (code === 200) {
        return data;
    }
    throw new Error(msg || "重命名 AI 会话失败");
};
export const pinAiSession = async (sessionId, pinned) => {
    const res = await request.post(`ai/chat/session/pin/${sessionId}`, { pinned });
    const { code, msg, data } = res.data;
    if (code === 200) {
        return data;
    }
    throw new Error(msg || "更新 AI 会话置顶状态失败");
};
export const streamAiChat = async (payload, { signal, onEvent } = {}) => {
    const token = getToken();
    const response = await fetch(`${PREFIX_BASE_URL}ai/chat/stream`, {