prompthistory

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2026 License: MIT Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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