history

package
v0.28.0 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entry

type Entry struct {
	Meta    EntryMeta    `json:"m"`
	Content EntryContent `json:"c"`
}

func NewEntry

func NewEntry(content EntryContent) Entry

type EntryContent

type EntryContent struct {
	Messages []Message `json:"m"`
}

type EntryMeta

type EntryMeta struct {
	Version   int   `json:"v"`
	Timestamp int64 `json:"t"`
}

type Message

type Message struct {
	Id           string               `json:"i,omitempty"`
	Role         string               `json:"r,omitempty"`
	ContentParts []MessageContentPart `json:"p,omitempty"`
	CreatedAt    int64                `json:"t,omitempty"`
}

type MessageCall

type MessageCall struct {
	Id        string             `json:"i,omitempty"`
	Function  string             `json:"f,omitempty"`
	Arguments string             `json:"a,omitempty"`
	Result    *MessageCallResult `json:"r,omitempty"`
}

type MessageCallResult

type MessageCallResult struct {
	Content    string `json:"c"`
	Error      string `json:"e"`
	DurationMs int64  `json:"d"`
}

type MessageContentPart

type MessageContentPart struct {
	Type    string       `json:"t,omitempty"`
	Content string       `json:"c,omitempty"`
	Call    *MessageCall `json:"ca,omitempty"`
}

type Reader

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

func NewReader

func NewReader(historyPath string) *Reader

func (*Reader) GetCount

func (r *Reader) GetCount() (int, error)

func (*Reader) GetLast

func (r *Reader) GetLast(skip, limit int) ([]Entry, error)

func (*Reader) Search

func (r *Reader) Search(matcher func(entry Entry) (bool, bool)) ([]Entry, error)

type Writer

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

func NewWriter

func NewWriter(historyPath string) *Writer

func (*Writer) Write

func (w *Writer) Write(entry Entry) error

Jump to

Keyboard shortcuts

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