feat: 实现日志追踪链路 #185
@@ -121,7 +121,7 @@ func NewHistoryLambda(
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Infow("history assembled",
|
log.Debugw("history assembled",
|
||||||
"message_count", len(messages),
|
"message_count", len(messages),
|
||||||
"has_image", len(imageData) > 0,
|
"has_image", len(imageData) > 0,
|
||||||
"scenario", scenario)
|
"scenario", scenario)
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ func NewSTTLambda(sttService stt.Service) *compose.Lambda {
|
|||||||
return STTOutput{}, fmt.Errorf("stt: no audio data provided")
|
return STTOutput{}, fmt.Errorf("stt: no audio data provided")
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Infow("stt recognition started", "audio_bytes", len(input.AudioData))
|
log.Debugw("stt recognition started", "audio_bytes", len(input.AudioData))
|
||||||
|
|
||||||
// 调用 STT 服务
|
// 调用 STT 服务
|
||||||
text, err := sttService.Recognize(ctx, input.AudioData, stt.Options{
|
text, err := sttService.Recognize(ctx, input.AudioData, stt.Options{
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ func NewTTSLambda(ttsService tts.Service, ttsVoice string, ttsSpeed float64, tts
|
|||||||
for chunk := range ttsStream {
|
for chunk := range ttsStream {
|
||||||
select {
|
select {
|
||||||
case <-ctx.Done():
|
case <-ctx.Done():
|
||||||
log.Infow("TTS 流被中断")
|
log.Debugw("tts stream interrupted")
|
||||||
sw.Send(struct{}{}, ctx.Err())
|
sw.Send(struct{}{}, ctx.Err())
|
||||||
return
|
return
|
||||||
default:
|
default:
|
||||||
|
|||||||
Reference in New Issue
Block a user