callback

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 14, 2025 License: Apache-2.0 Imports: 4 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler interface {
	HandleSOP(ctx context.Context, sop string)
	HandleLLMStart(ctx context.Context, prompt string)
	HandleLLMEnd(ctx context.Context, output *llm.Generation)
	HandleAgentStart(ctx context.Context, a schema.Agent, messages []schema.Message)
	HandleAgentEnd(ctx context.Context, a schema.Agent, result *schema.Generation)
	HandleAgentActionStart(ctx context.Context, agent string, action *schema.StepAction)
	HandleAgentActionEnd(ctx context.Context, agent string, action *schema.StepAction)
	HandleRetrieverStart(ctx context.Context, query string)
	HandleRetrieverEnd(ctx context.Context, query string, documents []schema.Document)
	HandleMessageInQueue(ctx context.Context, message *schema.Message)
	HandleMessageOutQueue(ctx context.Context, message *schema.Message)
	HandleStreamingFunc(ctx context.Context, chunk []byte) error
	HandleReasoningStreamingFunc(ctx context.Context, chunk []byte) error
}

type LogHandler

type LogHandler struct{}

func (LogHandler) HandleAgentActionEnd

func (LogHandler) HandleAgentActionEnd(ctx context.Context, agent string, action *schema.StepAction)

func (LogHandler) HandleAgentActionStart

func (LogHandler) HandleAgentActionStart(ctx context.Context, agent string, action *schema.StepAction)

func (LogHandler) HandleAgentEnd

func (LogHandler) HandleAgentEnd(ctx context.Context, _ schema.Agent, _ *schema.Generation)

func (LogHandler) HandleAgentStart

func (LogHandler) HandleAgentStart(ctx context.Context, _ schema.Agent, _ []schema.Message)

func (LogHandler) HandleLLMEnd

func (h LogHandler) HandleLLMEnd(ctx context.Context, output *llm.Generation)

func (LogHandler) HandleLLMStart

func (LogHandler) HandleLLMStart(ctx context.Context, prompt string)

func (LogHandler) HandleMessageInQueue

func (LogHandler) HandleMessageInQueue(ctx context.Context, message *schema.Message)

func (LogHandler) HandleMessageOutQueue

func (LogHandler) HandleMessageOutQueue(ctx context.Context, message *schema.Message)

func (LogHandler) HandleReasoningStreamingFunc added in v0.2.0

func (LogHandler) HandleReasoningStreamingFunc(ctx context.Context, chunk []byte) error

func (LogHandler) HandleRetrieverEnd

func (LogHandler) HandleRetrieverEnd(ctx context.Context, query string, documents []schema.Document)

func (LogHandler) HandleRetrieverStart

func (LogHandler) HandleRetrieverStart(ctx context.Context, query string)

func (LogHandler) HandleSOP

func (h LogHandler) HandleSOP(ctx context.Context, sop string)

func (LogHandler) HandleStreamingFunc

func (LogHandler) HandleStreamingFunc(ctx context.Context, chunk []byte) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL