feat(wechat): 关注公众号后自动回复欢迎语(被动回复,可后台配置) #12

Merged
Blizzard merged 42 commits from feat/site into main 2026-07-22 07:24:18 +00:00
3 changed files with 11 additions and 1 deletions
Showing only changes of commit a4669a0d82 - Show all commits
@@ -172,8 +172,18 @@ func (o *Orchestrator) emitUsage(t *contract.Task, b *harness.Budget) {
}
uid, _ := t.Meta[contract.MetaUserID].(string)
tid, _ := t.Meta[contract.MetaTenantID].(string)
// 记录本任务**实际所用模型**(语音任务=语音池,其余=工作池),让计费按真实模型定价,
// 别把语音快模型的账记到工作模型头上(否则 SaveUsageEvent 会拿激活 chat 模型兜底,错价)。
pool := o.pool
if meta(t, contract.MetaModelProfile) == contract.ModelProfileVoice && o.voicePool != nil && o.voicePool.Ready() {
pool = o.voicePool
}
model := ""
if mn, ok := pool.(interface{ ModelName() string }); ok {
model = mn.ModelName()
}
if err := o.usageSink.PublishUsage(&contract.UsageEvent{
TaskID: t.ID, UserID: uid, TenantID: tid, PromptTok: p, CompTok: c, TotalTok: total,
TaskID: t.ID, UserID: uid, TenantID: tid, Model: model, PromptTok: p, CompTok: c, TotalTok: total,
Exceeded: b.Exceeded(), TS: time.Now().UnixMilli(),
}); err != nil {
log.Printf("[usage] 回写用量失败 task=%s: %v", t.ID, err)
Binary file not shown.
Binary file not shown.