MCPcopy Create free account
hub / github.com/cloudwego/eino / OnStartWithStreamInputFn

Method OnStartWithStreamInputFn

callbacks/handler_builder.go:141–146  ·  view source on GitHub ↗

OnStartWithStreamInputFn sets the callback invoked when a component receives streaming input. The handler receives a [*schema.StreamReader] that is a private copy; it MUST close the reader after consuming it to avoid goroutine and memory leaks.

(
	fn func(ctx context.Context, info *RunInfo, input *schema.StreamReader[CallbackInput]) context.Context)

Source from the content-addressed store, hash-verified

139// private copy; it MUST close the reader after consuming it to avoid goroutine
140// and memory leaks.
141func (hb *HandlerBuilder) OnStartWithStreamInputFn(
142 fn func(ctx context.Context, info *RunInfo, input *schema.StreamReader[CallbackInput]) context.Context) *HandlerBuilder {
143
144 hb.onStartWithStreamInputFn = fn
145 return hb
146}
147
148// OnEndWithStreamOutputFn sets the callback invoked when a component produces
149// streaming output. Like OnStartWithStreamInputFn, the handler receives a

Callers 4

WithMessageFutureFunction · 0.80
TestNewComponentTemplateFunction · 0.80
TestAspectInjectFunction · 0.80
TestNestedGraphFunction · 0.80

Calls

no outgoing calls

Tested by 3

TestNewComponentTemplateFunction · 0.64
TestAspectInjectFunction · 0.64
TestNestedGraphFunction · 0.64