transcripts

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 16, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Fetcher

type Fetcher interface {
	GetMessages(ctx context.Context, sessionID string) ([]Message, error)
}

Fetcher retrieves transcript messages for a session.

type Message

type Message struct {
	SessionID string
	Role      string
	Text      string
	At        time.Time
	Seq       int64
}

Message is a single transcript message returned by Fetcher.

type SQLStore

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

SQLStore is a database/sql-backed transcript store.

func NewSQLStore

func NewSQLStore(driver, dsn, table string) (*SQLStore, error)

NewSQLStore creates a new SQL-backed Store for the given driver and DSN. driver should be "postgres" or "mysql"; table is the table name for inserts.

func (*SQLStore) Close

func (s *SQLStore) Close() error

Close closes the underlying *sql.DB.

func (*SQLStore) GetMessages

func (s *SQLStore) GetMessages(ctx context.Context, sessionID string) ([]Message, error)

GetMessages returns all transcript messages for the session, ordered by seq. Implements Fetcher.

func (*SQLStore) SaveMessage

func (s *SQLStore) SaveMessage(ctx context.Context, sessionID, role, text string, at time.Time, seq int64) error

type Store

type Store interface {
	SaveMessage(ctx context.Context, sessionID, role, text string, at time.Time, seq int64) error
	Close() error
}

Store persists per-message transcripts for a session.

Jump to

Keyboard shortcuts

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