refactor(loop): extract speak voice backfill into applyBatchVoice (M57)
This commit is contained in:
1 parent
39ae883a4e
commit
c9da488749
2 files changed
+10
-5
No files matched your search
@@ -86,6 +86,15 @@ func (l *Loop) withSpeakSpec(schemas []model.ToolSpec) []model.ToolSpec {
|
||||
return append(out, *spec)
|
||||
}
|
||||
|
||||
// applyBatchVoice 把一批工具调用的语音结论回填进本回合的 Result。
|
||||
// 后面批次里没有 speak 时保留前面那批的结论 —— 「这条回复想用语音」
|
||||
// 发生在哪一批都算数。
|
||||
func applyBatchVoice(res *Result, batch *toolRunResult) {
|
||||
if batch.voice != nil {
|
||||
res.Voice = batch.voice
|
||||
}
|
||||
}
|
||||
|
||||
// captureVoice 从一批调用的结局里提取本回合的出站语音结论。返回 nil
|
||||
// 表示「这一批没有要求语音」,Result.Voice 因此保持 nil,客户端按纯
|
||||
// 文本呈现 —— 与没有 speak 之前逐字节一致。
|
||||
|
||||
Reference in new issue
Block a user