feat: add streaming text Chain example and simplify ASR flow

Add character-by-character fake input, event collection, request logging,
and a model pre-handler to the steps/trans example.

Split the ASR Chain into readable node functions, strip transcript markers,
configure the local ASR service, and remove the ASR example test files.

Co-authored-by: TRAE CLI <traecli@bytedance.com>
This commit is contained in:
zhaoyupeng.elqbandTRAE CLI committed 2026-11-18 21:26:29 +08:00
1 parent 2cf82034ec
commit ee8afb10db
9 files changed
+325 -357

No files matched your search

+25
View File
@@ -0,0 +1,25 @@
package internal
import (
"time"
"github.com/cloudwego/eino/schema"
)
func FakeInput() *schema.StreamReader[[]byte] {
input, writer := schema.Pipe[[]byte](0)
go func() {
defer writer.Close()
ticker := time.NewTicker(200 * time.Millisecond)
defer ticker.Stop()
for {
for _, char := range "你好,很高兴认识你!" {
<-ticker.C
if writer.Send([]byte(string(char)), nil) {
return
}
}
}
}()
return input
}