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: 0

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