chenzx
2025-01-10 babeb4aa56f623f6ff62554c5becaf2a7d1e187e
20250110接口更新
1 文件已重命名
5个文件已修改
61 ■■■■■ 已修改文件
.vs/PolicyControl/FileContentIndex/16911364-62da-410c-b2f6-047496297e5f.vsidx 补丁 | 查看 | 原始文档 | blame | 历史
.vs/PolicyControl/v17/fileList.bin 补丁 | 查看 | 原始文档 | blame | 历史
GasolineBlend.BLL/AgentDataBLL.cs 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
GasolineBlend.DAL/AgentDataDAL.cs 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
GasolineBlend/Controllers/AgentDataController.cs 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
GasolineBlend/Controllers/ChatHistoryController.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
.vs/PolicyControl/FileContentIndex/16911364-62da-410c-b2f6-047496297e5f.vsidx
Binary files differ
.vs/PolicyControl/v17/fileList.bin
Binary files differ
GasolineBlend.BLL/AgentDataBLL.cs
@@ -32,6 +32,11 @@
            return new PaginatedResult<AgentDataPage>(totalData, totalCount, totalPage);
        }
        public List<AgentDataPage> GetAgentDescription(string Text)
        {
            return _acc.GetAgentDescription(Text);
        }
        public bool DelAgentDataById(int id)
        {
            return _acc.DelAgentDataById(id);
GasolineBlend.DAL/AgentDataDAL.cs
@@ -11,6 +11,7 @@
using Google.Protobuf.WellKnownTypes;
using Microsoft.Office.Interop.Excel;
using MySql.Data.MySqlClient;
using static System.Net.Mime.MediaTypeNames;
namespace GasolineBlend.DAL
{
@@ -108,6 +109,36 @@
            }
        }
        public List<AgentDataPage> GetAgentDescription(string Text)
        {
            using (IDbConnection connection = new MySqlConnection(connectionString))
            {
                string[] models = Text.Split(',');
                var sql = $"SELECT prompt from agentdata WHERE 1=1 ";
                if (models != null)
                {
                    sql += $" and ( ";
                    for (int i=0;i< models.Length;i++)
                    {
                        if (i == 0)
                        {
                            sql += $" name like '%{models[i]}%' ";
                        }
                        else {
                            sql += $" or name like '%{models[i]}%' ";
                        }
                    }
                    sql += $" ) ";
                }
                else
                {
                    sql += $" and id = 0";
                }
                return connection.Query<AgentDataPage>(sql).ToList();
            }
        }
        public bool DelAgentDataById(int id)
        {
            using (IDbConnection connection = new MySqlConnection(connectionString))
GasolineBlend/Controllers/AgentDataController.cs
@@ -55,6 +55,29 @@
        }
        /// <summary>
        ///获取智能体详细
        /// </summary>
        /// <param name="Keyword"></param>
        /// <returns></returns>
        [HttpPost]
        public ActionResult GetAgentDescription(string Text)
        {
            try
            {
                var list = _acc.GetAgentDescription(Text);
                return SuccessNoShow(data: list);
            }
            catch (Exception e)
            {
                LogHelper.Write(Level.Error, "获取智能体详细 GetAgentDescription", e, OperatorProvider.Instance.Current == null ? "GuestEx" : OperatorProvider.Instance.Current.LoginName);
                return Error();
            }
        }
        /// <summary>
        ///删除智能体
        /// </summary>
        /// <param name="Keyword"></param>
GasolineBlend/Controllers/ChatHistoryController.cs
@@ -58,7 +58,7 @@
            {
                var model = _acc.GetPromptApi(AgentId);
                if (model[0].ModelApi != null && model[0].ModelKey != null) {
                    string apiUrl = "http://122.51.217.202/v1/chat-messages";
                    string apiUrl = model[0].ModelApi;
                    // 设置授权令牌
                    string bearerToken = model[0].ModelKey;
                    string jsonContent = $@"{{