Files
langchaingo/callbacks/log_stream.go
Dmitry Ng 6317685b67 feat: integrate streaming functionality across LLMs and callbacks
- Updated LLMs and callback interfaces to utilize a new streaming package for handling content chunks.
- Changed function signatures to accept streaming.Chunk instead of byte slices for better type safety and clarity.
- Enhanced examples and tests to demonstrate the new streaming capabilities, ensuring compatibility with existing functionality.
- Added reasoning and tool call handling in streaming responses for improved processing of LLM outputs.
2025-06-23 18:52:06 +03:00

21 lines
412 B
Go

//nolint:forbidigo
package callbacks
import (
"context"
"fmt"
"github.com/vxcontrol/langchaingo/llms/streaming"
)
// StreamLogHandler is a callback handler that prints to the standard output streaming.
type StreamLogHandler struct {
SimpleHandler
}
var _ Handler = StreamLogHandler{}
func (StreamLogHandler) HandleStreamingFunc(_ context.Context, chunk streaming.Chunk) {
fmt.Println(chunk.String())
}