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

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