Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrClosedSession = errors.New("stream session is closed") ErrUnknownSession = errors.New("unknown stream session") )
Functions ¶
func Unregister ¶
func Unregister(sessionID string)
Types ¶
type Handler ¶
type Handler func(ctx context.Context, event *llm.StreamEvent) error
Handler is invoked for every event in the session. Returning an error can be used to signal processing problems.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
func NewProvider ¶
func NewProvider() *Registry
func (*Registry) Finish ¶
Finish marks the session as closed and unregisters it. Idempotent: calling multiple times is safe.
func (*Registry) New ¶
New returns a safe event handler for the given sessionID. After Finish(sid) is called, the returned handler will reject further events with ErrClosedSession.
func (*Registry) Unregister ¶
Click to show internal directories.
Click to hide internal directories.