22 lines
331 B
Go
Executable File
22 lines
331 B
Go
Executable File
package modelprovider
|
|
|
|
type StreamEventKind int
|
|
|
|
const (
|
|
StreamStart StreamEventKind = iota
|
|
StreamDelta
|
|
StreamTool
|
|
StreamError
|
|
StreamEnd
|
|
)
|
|
|
|
type StreamEvent struct {
|
|
Kind StreamEventKind
|
|
Text string
|
|
Err error
|
|
Raw any
|
|
OutputTokens int64
|
|
}
|
|
|
|
type StreamChatCallback func(StreamEvent) error
|