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.
74 lines
2.1 KiB
74 lines
2.1 KiB
package echomeet
|
|
|
|
import (
|
|
"yunyan/comm"
|
|
"yunyan/modules"
|
|
|
|
"yunyan/lego/core"
|
|
)
|
|
|
|
func NewModule() core.IModule {
|
|
m := new(Echomeet)
|
|
return m
|
|
}
|
|
|
|
type Echomeet struct {
|
|
modules.ModuleBase
|
|
options *Options
|
|
api *apiComp
|
|
model *modelComp
|
|
cache *modelCacheComp
|
|
tasks *tasksComp
|
|
providers *providersComp
|
|
analyze comm.IAnalyze
|
|
}
|
|
|
|
func (this *Echomeet) GetType() core.M_Modules {
|
|
return comm.ModuleEchomeet
|
|
}
|
|
func (this *Echomeet) NewOptions() (options core.IModuleOptions) {
|
|
return new(Options)
|
|
}
|
|
func (this *Echomeet) Init(service core.IService, module core.IModule, options core.IModuleOptions) (err error) {
|
|
this.options = options.(*Options)
|
|
if err = this.ModuleBase.Init(service, module, options); err != nil {
|
|
return
|
|
}
|
|
return
|
|
}
|
|
|
|
func (this *Echomeet) Start() (err error) {
|
|
if err = this.ModuleBase.Start(); err != nil {
|
|
return
|
|
}
|
|
|
|
return
|
|
}
|
|
|
|
// MeetCapabilities 实现 comm.IEchomeet:把编排快照里的语言/总结模型汇总给同进程的其他模块
|
|
// (user 的 v3 配置下发)。读内存快照,不查库;echomeet_getcapabilities 接口用的是同一份数据。
|
|
func (this *Echomeet) MeetCapabilities() (c comm.MeetCapabilities) {
|
|
if this.providers == nil {
|
|
return
|
|
}
|
|
c.TranscribeLanguages, c.TranscribeAnyLanguage = this.providers.TranscribeLanguages()
|
|
c.TranslateLanguages, c.TranslateAnyLanguage = this.providers.TranslateLanguages()
|
|
clientChoice, items := this.providers.SummaryServices()
|
|
c.SummaryClientChoice = clientChoice
|
|
c.SummaryServices = make([]comm.MeetSummaryService, 0, len(items))
|
|
for _, it := range items {
|
|
c.SummaryServices = append(c.SummaryServices, comm.MeetSummaryService{
|
|
SvcId: it.SvcId, Name: it.Name, IsDefault: it.IsDefault,
|
|
})
|
|
}
|
|
return
|
|
}
|
|
|
|
func (this *Echomeet) OnInstallComp() {
|
|
this.ModuleBase.OnInstallComp()
|
|
this.api = this.RegisterComp(new(apiComp)).(*apiComp)
|
|
this.model = this.RegisterComp(new(modelComp)).(*modelComp)
|
|
this.cache = this.RegisterComp(new(modelCacheComp)).(*modelCacheComp)
|
|
this.providers = this.RegisterComp(new(providersComp)).(*providersComp)
|
|
this.tasks = this.RegisterComp(new(tasksComp)).(*tasksComp)
|
|
}
|
|
|