You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
1.1 KiB
31 lines
1.1 KiB
package allhelp
|
|
|
|
import (
|
|
"yunyan/modules"
|
|
|
|
"yunyan/lego/utils/mapstructure"
|
|
)
|
|
|
|
type Options struct {
|
|
modules.Options
|
|
MaxSummaryProcess int `json:"max_summary_process" mapstructure:"max_summary_process"` //每日聊天总结并发处理上限,默认5
|
|
ChatSummaryPrompt string `json:"chat_summary_prompt" mapstructure:"chat_summary_prompt"` //聊天总结 system prompt
|
|
}
|
|
|
|
func (this *Options) LoadConfig(settings map[string]interface{}) (err error) {
|
|
if settings != nil {
|
|
if err = this.Options.LoadConfig(settings); err != nil {
|
|
return
|
|
}
|
|
if err = mapstructure.Decode(settings, this); err != nil {
|
|
return
|
|
}
|
|
}
|
|
if this.MaxSummaryProcess <= 0 {
|
|
this.MaxSummaryProcess = 5
|
|
}
|
|
if this.ChatSummaryPrompt == "" {
|
|
this.ChatSummaryPrompt = "你是一位善于归纳总结的助理。用户会提供某一天的聊天内容(按时间顺序、含说话人)。请输出该日聊天的结构化中文总结,包含:1) 当日主题概览;2) 关键话题与结论(按要点分条);3) 待办事项或未决问题(如有);4) 情绪与关系观察(如有)。语言简洁、客观,忽略寒暄。"
|
|
}
|
|
return
|
|
}
|
|
|