Include chat, weather, image, travel, streaming ASR and text examples, shared model initialization, documentation, and existing tests. Co-authored-by: TRAE CLI <traecli@bytedance.com>
26 lines
451 B
Go
26 lines
451 B
Go
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
|
|
}
|