prompthistory

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package prompthistory records recent prompts for reuse and inspection.

Index

Constants

View Source
const DefaultLimit = 20

Variables

This section is empty.

Functions

func Preview

func Preview(text string, limit int) string

func RenderText

func RenderText(w io.Writer, report Report)

Types

type BuildOptions

type BuildOptions struct {
	Limit     int
	Offset    int
	UseOffset bool
}

type Entry

type Entry struct {
	Index     int       `json:"index"`
	Role      string    `json:"role"`
	Time      time.Time `json:"time"`
	Text      string    `json:"text"`
	Preview   string    `json:"preview"`
	SessionID string    `json:"session_id,omitempty"`
}

type Report

type Report struct {
	Kind       string  `json:"kind"`
	Status     string  `json:"status"`
	SessionID  string  `json:"session_id,omitempty"`
	Total      int     `json:"total"`
	Showing    int     `json:"showing"`
	Limit      int     `json:"limit"`
	Offset     int     `json:"offset"`
	HasMore    bool    `json:"has_more"`
	NextOffset *int    `json:"next_offset,omitempty"`
	Entries    []Entry `json:"entries"`
}

func Build

func Build(sessionID string, entries []session.PromptEntry, limit int) Report

func BuildWithOptions

func BuildWithOptions(sessionID string, entries []session.PromptEntry, options BuildOptions) Report

Jump to

Keyboard shortcuts

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