会话名称过长,使用ai进行总结更新,配置文件配置模型
This commit is contained in:
parent
1ccffac34b
commit
2d1427e0e4
|
|
@ -78,6 +78,7 @@ 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"`
|
||||||
|
AISessionNameModelID int `json:"ai_session_name_model_id"` // 用于ai总结会话名称的模型id
|
||||||
MONITOR bool `json:"monitor"` // 状态监控及邮件通知
|
MONITOR bool `json:"monitor"` // 状态监控及邮件通知
|
||||||
SERVER_SQL_LOG bool `json:"server_sql_log"` // 服务器sql日志
|
SERVER_SQL_LOG bool `json:"server_sql_log"` // 服务器sql日志
|
||||||
SERVER_PORT string `json:"server_port"` // 服务端口
|
SERVER_PORT string `json:"server_port"` // 服务端口
|
||||||
|
|
|
||||||
|
|
@ -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")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue