store

package
v0.0.0-...-1912285 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LLMCacheDir

func LLMCacheDir() (string, error)

LLMCacheDir returns the path to the LLM cache directory. On macOS this is ~/Library/Caches/scroll4me/llm/

func LatestStepFile

func LatestStepFile(step StepName) (string, error)

LatestStepFile returns the path to the most recent file in a step's cache directory.

func LoadLatestStepOutput

func LoadLatestStepOutput[T any](step StepName) (T, string, error)

LoadLatestStepOutput loads the most recent output from a step's cache directory. Returns the data, the filepath it was loaded from, and any error.

func LoadStepOutput

func LoadStepOutput[T any](filepath string) (T, error)

LoadStepOutput loads JSON data from a specific file path.

func SaveLLMExchange

func SaveLLMExchange(exchange LLMExchange) (string, error)

SaveLLMExchange serializes an LLM exchange to JSON and writes it to a timestamped file. Returns the path to the saved file.

func SaveStepOutput

func SaveStepOutput[T any](step StepName, data T) (string, error)

SaveStepOutput saves JSON-serializable data to the step's cache directory. Returns the path to the saved file.

func SaveTextOutput

func SaveTextOutput(step StepName, content string, ext string) (string, error)

SaveTextOutput saves text content (e.g., markdown) to the step's cache directory. Returns the path to the saved file.

Types

type LLMExchange

type LLMExchange struct {
	Timestamp time.Time `json:"timestamp"`
	Provider  string    `json:"provider"` // e.g. "claude"
	Model     string    `json:"model"`
	Prompt    string    `json:"prompt"`
	Response  string    `json:"response"`
	Error     string    `json:"error,omitempty"`
}

LLMExchange represents a prompt/response pair for caching

type StepName

type StepName string

StepName identifies a pipeline step for caching purposes.

const (
	Step1Posts    StepName = "step1_posts"
	Step2Analyses StepName = "step2_analyses"
	Step3Filtered StepName = "step3_filtered"
	Step4Digests  StepName = "step4_digests"
)

Jump to

Keyboard shortcuts

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