From 287a666e1b2bb155e86aa88ebace201d1e8a51f6 Mon Sep 17 00:00:00 2001
From: zhou zhou <3272660260@qq.com>
Date: 星期四, 19 三月 2026 13:26:02 +0800
Subject: [PATCH] #AI.国际化

---
 rsf-admin/src/api/ai/chat.js |   40 ++++++++++++++++++++++++++++++++++++++--
 1 files changed, 38 insertions(+), 2 deletions(-)

diff --git a/rsf-admin/src/api/ai/chat.js b/rsf-admin/src/api/ai/chat.js
index b11da93..1b2117b 100644
--- a/rsf-admin/src/api/ai/chat.js
+++ b/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,42 @@
     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 clearAiSessionMemory = async (sessionId) => {
+    const res = await request.post(`ai/chat/session/memory/clear/${sessionId}`);
+    const { code, msg, data } = res.data;
+    if (code === 200) {
+        return data;
+    }
+    throw new Error(msg || "娓呯┖ AI 浼氳瘽璁板繂澶辫触");
+};
+
+export const retainAiSessionLatestRound = async (sessionId) => {
+    const res = await request.post(`ai/chat/session/memory/retain-latest/${sessionId}`);
+    const { code, msg, data } = res.data;
+    if (code === 200) {
+        return data;
+    }
+    throw new Error(msg || "浠呬繚鐣欏綋鍓嶈疆璁板繂澶辫触");
+};
+
 export const streamAiChat = async (payload, { signal, onEvent } = {}) => {
     const token = getToken();
     const response = await fetch(`${PREFIX_BASE_URL}ai/chat/stream`, {

--
Gitblit v1.9.1