hook

package
v1.5.3 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2026 License: Apache-2.0 Imports: 13 Imported by: 1 module, 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 GenModelInputResult

type GenModelInputResult struct {
	Messages []*schema.Message `json:"messages"`
}

GenModelInputResult represents the result returned by genmodelinput hook

type HookManager

type HookManager struct {
	// contains filtered or unexported fields
}

HookManager manages session hooks

func NewHookManager

func NewHookManager(hooksConfig *config.SessionHooks) *HookManager

func (*HookManager) OnGenModelInput

func (hm *HookManager) OnGenModelInput(ctx context.Context, sessionID string, sessionName string, messages []*schema.Message) ([]*schema.Message, error)

OnGenModelInput executes the genmodelinput hook if enabled It passes session data via stdin and expects JSON output with []message

func (*HookManager) OnSessionKeep

func (hm *HookManager) OnSessionKeep(ctx context.Context, sessionID string, sessionName string, messages []*schema.Message) error

OnSessionClear executes the session clear hook if enabled

type SessionHookData

type SessionHookData struct {
	SessionID   string            `json:"session_id"`
	SessionName string            `json:"session_name"`
	Messages    []*schema.Message `json:"messages"`
	Timestamp   string            `json:"timestamp"`
}

SessionHookData represents the data passed to session hooks via stdin

Jump to

Keyboard shortcuts

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