sqlite

package
v0.1.9 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: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MessageStorage

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

func (*MessageStorage) CompactionCreate

func (m *MessageStorage) CompactionCreate(ctx context.Context, thread api.ThreadID, seq api.Seq, compaction api.Compaction) (api.Seq, error)

func (*MessageStorage) CompactionGet

func (m *MessageStorage) CompactionGet(ctx context.Context, thread api.ThreadID, beforeTail api.RoundID) (api.Compaction, error)

func (*MessageStorage) RecordAdd

func (m *MessageStorage) RecordAdd(ctx context.Context, thread api.ThreadID, seq api.Seq, origin api.RoundID, kind string, attrs map[string]any, data any) (api.RecordID, api.Seq, error)

func (*MessageStorage) RecordList

func (m *MessageStorage) RecordList(ctx context.Context, thread api.ThreadID) ([]api.Record, error)

func (*MessageStorage) RecordPin

func (m *MessageStorage) RecordPin(ctx context.Context, thread api.ThreadID, seq api.Seq, pin api.RoundID, records []api.RecordID) (api.Seq, error)

func (*MessageStorage) RoundAbort

func (m *MessageStorage) RoundAbort(ctx context.Context, thread api.ThreadID, seq api.Seq, round api.RoundID, usage api.EventUsage, content api.Indexed[api.Content]) (api.Seq, error)

func (*MessageStorage) RoundAfter

func (m *MessageStorage) RoundAfter(ctx context.Context, thread api.ThreadID, start api.RoundID, limit int) ([]api.Round, error)

func (*MessageStorage) RoundBefore

func (m *MessageStorage) RoundBefore(ctx context.Context, thread api.ThreadID, start api.RoundID, limit int) ([]api.Round, error)

func (*MessageStorage) RoundError

func (m *MessageStorage) RoundError(ctx context.Context, thread api.ThreadID, seq api.Seq, round api.RoundID, errText string, usage api.EventUsage, content api.Indexed[api.Content]) (api.Seq, error)

func (*MessageStorage) RoundInput

func (m *MessageStorage) RoundInput(ctx context.Context, thread api.ThreadID, seq api.Seq, input api.Input) (api.RoundID, api.Seq, error)

func (*MessageStorage) RoundOk

func (m *MessageStorage) RoundOk(ctx context.Context, thread api.ThreadID, seq api.Seq, round api.RoundID, usage api.EventUsage, content api.Indexed[api.Content]) (api.Seq, error)

func (*MessageStorage) RoundRange

func (m *MessageStorage) RoundRange(ctx context.Context, thread api.ThreadID, start api.RoundID, end api.RoundID) iter.Seq2[api.Round, error]

func (*MessageStorage) RoundRefuse

func (m *MessageStorage) RoundRefuse(ctx context.Context, thread api.ThreadID, seq api.Seq, round api.RoundID, usage api.EventUsage, content api.Indexed[api.Content]) (api.Seq, error)

func (*MessageStorage) RoundResult

func (m *MessageStorage) RoundResult(ctx context.Context, thread api.ThreadID, seq api.Seq, round api.RoundID, result map[string]api.ContentToolResult) (api.Seq, error)

func (*MessageStorage) RoundSearch

func (m *MessageStorage) RoundSearch(ctx context.Context, thread api.ThreadID, exclude bool, query string, from *api.Cursor, inclusive bool, asc bool, limit int) ([]api.Hit, error)

func (*MessageStorage) ThreadBump

func (m *MessageStorage) ThreadBump(ctx context.Context, thread api.ThreadID) (api.Thread, error)

func (*MessageStorage) ThreadClone

func (m *MessageStorage) ThreadClone(ctx context.Context, source api.ThreadID, target api.ThreadID) (api.Thread, error)

func (*MessageStorage) ThreadCreate

func (m *MessageStorage) ThreadCreate(ctx context.Context, id api.ThreadID) (api.Thread, error)

func (*MessageStorage) ThreadCut

func (m *MessageStorage) ThreadCut(ctx context.Context, id api.ThreadID, seq api.Seq, round api.RoundID) (api.Seq, error)

func (*MessageStorage) ThreadDelete

func (m *MessageStorage) ThreadDelete(ctx context.Context, id api.ThreadID) error

func (*MessageStorage) ThreadGet

func (m *MessageStorage) ThreadGet(ctx context.Context, thread api.ThreadID) (api.Thread, error)

func (*MessageStorage) ThreadList

func (m *MessageStorage) ThreadList(ctx context.Context, from, to time.Time, asc bool, limit int, name string) ([]api.Thread, error)

func (*MessageStorage) ThreadRename

func (m *MessageStorage) ThreadRename(ctx context.Context, id api.ThreadID, seq api.Seq, name string) (api.Seq, error)

type Store

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

Store keeps every user's threads in one SQLite database. Give each session its user's part with User. Uploaded files are not stored here; set neui.OptionUploadStorage for them.

func New

func New(db *sql.DB) (*Store, error)

func (*Store) User

func (s *Store) User(id string) api.MessageStorage

User returns the threads of one user, for neui.OptionMessageStorage. Users never see each other's threads; "" is an id like any other, so every session that passes it shares the same threads.

Jump to

Keyboard shortcuts

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