replay

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrEmptySummary = errors.New("compaction response carries no text")

Functions

func OmittedNote

func OmittedNote(size int) string

func RoundItemBudget

func RoundItemBudget(config api.ThreadConfig, model api.Model) int

Types

type Compaction

type Compaction struct {
	Target api.RoundID
	Tail   api.RoundID
	// contains filtered or unexported fields
}

func (Compaction) Half

func (c Compaction) Half() int

type CompactionCause

type CompactionCause int
const (
	CompactionNone CompactionCause = iota
	CompactionTokens
	CompactionBytes
)

type Replay

type Replay = *replay

func NewReplay

func NewReplay(ctx context.Context, thread api.ThreadID, s api.MessageStorage, config api.ThreadConfig, model api.Model) Replay

func (Replay) ApplyCompaction

func (r Replay) ApplyCompaction(c Compaction, content api.Indexed[api.Content], usage api.EventUsage) error

func (Replay) CanCompact

func (r Replay) CanCompact() bool

func (Replay) CompactionFailed

func (r Replay) CompactionFailed()

func (Replay) Create

func (r Replay) Create() (bool, error)

func (Replay) IsLoaded

func (r Replay) IsLoaded() bool

func (Replay) IsPending

func (r Replay) IsPending() bool

func (Replay) IsRetriable

func (r Replay) IsRetriable() bool

func (Replay) Load

func (r Replay) Load() error

func (Replay) Name

func (r Replay) Name() string

func (Replay) NeedCompaction

func (r Replay) NeedCompaction() CompactionCause

func (Replay) PrepareCompaction

func (r Replay) PrepareCompaction(force bool, chunk int) (Compaction, []api.Message, error)

func (Replay) Record

func (r Replay) Record(origin api.RoundID, kind string, attrs map[string]any, data any) error

func (Replay) Rename

func (r Replay) Rename(name string) error

func (Replay) Retry

func (r Replay) Retry() (api.Round, api.RoundID, []api.Message, error)

func (Replay) Rewind

func (r Replay) Rewind(end api.RoundID, input api.Input) (api.Round, []api.Message, []string, error)

func (Replay) RoundAbort

func (r Replay) RoundAbort(usage api.EventUsage, content api.Indexed[api.Content]) error

func (Replay) RoundError

func (r Replay) RoundError(err error, usage api.EventUsage, content api.Indexed[api.Content]) error

func (Replay) RoundInit

func (r Replay) RoundInit(input api.Input) (api.Round, []api.Message, error)

func (Replay) RoundOk

func (r Replay) RoundOk(usage api.EventUsage, content api.Indexed[api.Content]) (api.RoundID, error)

func (Replay) RoundRefuse

func (r Replay) RoundRefuse(usage api.EventUsage, content api.Indexed[api.Content]) error

func (Replay) RoundReject

func (r Replay) RoundReject(code api.ErrCode, usage api.EventUsage, content api.Indexed[api.Content]) error

func (Replay) RoundResult

func (r Replay) RoundResult(results map[string]api.ContentToolResult) error

func (Replay) Tighten

func (r Replay) Tighten() bool

func (Replay) Usage

func (r Replay) Usage() api.EventUsage

Jump to

Keyboard shortcuts

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