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.
 
 
 
 
 
 

59 lines
2.0 KiB

package echomeet
import (
"yunyan/modules"
"yunyan/lego/utils/mapstructure"
)
type (
IOptions interface {
modules.IOptions
}
// SummaryOptions 总结所用对话模型配置。
// 字节走豆包:填 Apikey + Model;
// Google 走 Gemini:填 Apikey + Model(Endpoint 可选);
// 阿里 / 微软走 OpenAI 兼容端点(阿里 DashScope、微软 Azure OpenAI):填 BaseURL + Token + Model。
SummaryOptions struct {
Apikey string // 豆包 / Gemini API Key
Token string // OpenAI 兼容端点 API Key
BaseURL string // OpenAI 兼容端点地址
Model string // 模型 ID
Endpoint string // Gemini 自定义 endpoint(可选)
}
// ProviderOptions 单个服务商的三段式配置:转写 / 翻译 / 总结,
// 由 echomeet 模块内部按服务商组合成完整的「会议撰写→翻译→总结」链路。
// Transcribe、Translate 为原样透传给底层 sys 包 OnInit 的配置块。
ProviderOptions struct {
Callback string // 转写结果异步回调地址(字节、阿里使用;Google/微软走轮询可留空)
Transcribe map[string]interface{} // 转写服务配置
Translate map[string]interface{} // 翻译服务配置
Summary SummaryOptions // 总结(对话模型)配置
}
Options struct {
modules.Options
// DefaultService 默认服务商:留空 / Auto = 按源语言自动路由(以前的方案);
// 指定 ByteDance / Ali / Google / Microsoft = 该会议的撰写、翻译、总结全部走此服务商。
// 客户端请求若显式带了 ServiceType,则以请求为准、覆盖此默认值。
DefaultService string
ByteDance ProviderOptions
Ali ProviderOptions
Google ProviderOptions
Microsoft ProviderOptions
}
)
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
}
}
return
}