chenzx
2024-12-11 4043a2fe2103c7960b74acbccdcc876d11f83f0f
GasolineBlend/Controllers/ChatHistoryController.cs
@@ -59,6 +59,7 @@
                Prompt = Prompt.Replace("\t", "").Replace("\n", "").Replace("\r", "").Replace("\f", "");
                Prompt = Prompt.Replace(" ", "");
                Prompt = Prompt.Replace("\"", "“");
                Prompt = Prompt.Replace("\\", "\\\\");
                var list = _acc.GetChatHistory6List(AgentId, UserId);
                string historylist = "";
               for (int i = list.Count - 1; i >= 0; i--) {
@@ -128,6 +129,7 @@
                                AgentId = AgentId,
                                Role = ro
                            };
                            bool plus = _acc.UpdataUserNoById(AgentId, UserId);
                            int chatHistoryId = _acc.AddChatHistoryData(chatHistoryDataPage);
                            if (i == 0)
                            {
@@ -139,7 +141,6 @@
                                return Error();
                            }
                        }
                        bool plus = _acc.UpdataUserNoById(AgentId, UserId);
                        int Count = _acc.GetChatHistoryCountList(UserId, AgentId,null);
                        JObject obj = JObject.Parse(responseContent);
                        obj.Add("Count", Count);
@@ -161,7 +162,7 @@
            }
        }
        /// <summary>
        ///删除智能体
        ///删除对话记录
        /// </summary>
        /// <param name="Keyword"></param>
        /// <returns></returns>
@@ -175,7 +176,7 @@
            }
            catch (Exception e)
            {
                LogHelper.Write(Level.Error, "删除智能体 DelChatHistoryDataById" +
                LogHelper.Write(Level.Error, "删除对话记录 DelChatHistoryDataById" +
                    "" +
                    "", e, OperatorProvider.Instance.Current == null ? "GuestEx" : OperatorProvider.Instance.Current.LoginName);
                return Error();