会话名称过长,使用ai进行总结更新,配置文件配置模型

This commit is contained in:
junleea 2025-05-12 12:59:57 +08:00
parent 1ccffac34b
commit 2d1427e0e4
2 changed files with 16 additions and 15 deletions

View File

@ -78,20 +78,21 @@ type ConfigStruct struct {
CID_BASE_DIR string `json:"cid_base_dir"` CID_BASE_DIR string `json:"cid_base_dir"`
FILE_BASE_DIR string `json:"file_base_dir"` FILE_BASE_DIR string `json:"file_base_dir"`
LOG_OUTPUT bool `json:"log_output"` LOG_OUTPUT bool `json:"log_output"`
MONITOR bool `json:"monitor"` // 状态监控及邮件通知 AISessionNameModelID int `json:"ai_session_name_model_id"` // 用于ai总结会话名称的模型id
SERVER_SQL_LOG bool `json:"server_sql_log"` // 服务器sql日志 MONITOR bool `json:"monitor"` // 状态监控及邮件通知
SERVER_PORT string `json:"server_port"` // 服务端口 SERVER_SQL_LOG bool `json:"server_sql_log"` // 服务器sql日志
LOG_SAVE_DAYS int `json:"log_save_days"` // 日志保存天数,-1表示不保存0表示永久保存 SERVER_PORT string `json:"server_port"` // 服务端口
SERVER_USER_TYPE string `json:"user_type"` // 服务器用户类型master: 主服务器slave: 从服务器,从服务器会定时同步数据 LOG_SAVE_DAYS int `json:"log_save_days"` // 日志保存天数,-1表示不保存0表示永久保存
MASTER_SERVER_DOMAIN string `json:"master_server_domain"` // 主服务器域名 SERVER_USER_TYPE string `json:"user_type"` // 服务器用户类型master: 主服务器slave: 从服务器,从服务器会定时同步数据
USER_SYNC_TIME int `json:"user_sync_time"` // 用户数据同步时间,单位秒 MASTER_SERVER_DOMAIN string `json:"master_server_domain"` // 主服务器域名
SERVER_NAME string `json:"server_name"` // 服务器名称,用于区分不同服务器 USER_SYNC_TIME int `json:"user_sync_time"` // 用户数据同步时间,单位秒
SPARK_PPT_USAGE bool `json:"spark_ppt_usage"` // 是否使用spark ppt功能 SERVER_NAME string `json:"server_name"` // 服务器名称,用于区分不同服务器
KBASE_SERVER []KBaseServer `json:"kbase_server"` // 知识库服务器列表 SPARK_PPT_USAGE bool `json:"spark_ppt_usage"` // 是否使用spark ppt功能
GITHUB_CLIENT_ID string `json:"github_client_id"` // github client id KBASE_SERVER []KBaseServer `json:"kbase_server"` // 知识库服务器列表
GITHUB_CLIENT_SECRET string `json:"github_client_secret"` // github client secret GITHUB_CLIENT_ID string `json:"github_client_id"` // github client id
GITEE_CLIENT_ID string `json:"gitee_client_id"` // gitee client id GITHUB_CLIENT_SECRET string `json:"github_client_secret"` // github client secret
GITEE_CLIENT_SECRET string `json:"gitee_client_secret"` // gitee client secret GITEE_CLIENT_ID string `json:"gitee_client_id"` // gitee client id
GITEE_CLIENT_SECRET string `json:"gitee_client_secret"` // gitee client secret
} }
type KBaseServer struct { type KBaseServer struct {

View File

@ -26,7 +26,7 @@ func UpdateSessionNameByAIAndID(id, userID int, originSessionName string) error
//获取ai总结的会话名称 //获取ai总结的会话名称
prompt := "请根据下面的对话内容提取为20字以内的主题作为会话名称\n" + originSessionName prompt := "请根据下面的对话内容提取为20字以内的主题作为会话名称\n" + originSessionName
//ai总结模型id //ai总结模型id
modelID := 24 //固定为混元lite模型免费 modelID := proto.Config.AISessionNameModelID //固定为混元lite模型免费
models := FindModelByID(modelID, 1) models := FindModelByID(modelID, 1)
if models == nil { if models == nil {
log.Println("UpdateSessionNameByAIAndID model not exist") log.Println("UpdateSessionNameByAIAndID model not exist")