Documentation
¶
Index ¶
- func LLMCacheDir() (string, error)
- func LatestStepFile(step StepName) (string, error)
- func LoadLatestStepOutput[T any](step StepName) (T, string, error)
- func LoadStepOutput[T any](filepath string) (T, error)
- func SaveLLMExchange(exchange LLMExchange) (string, error)
- func SaveStepOutput[T any](step StepName, data T) (string, error)
- func SaveTextOutput(step StepName, content string, ext string) (string, error)
- type LLMExchange
- type StepName
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LLMCacheDir ¶
LLMCacheDir returns the path to the LLM cache directory. On macOS this is ~/Library/Caches/scroll4me/llm/
func LatestStepFile ¶
LatestStepFile returns the path to the most recent file in a step's cache directory.
func LoadLatestStepOutput ¶
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 ¶
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 ¶
SaveStepOutput saves JSON-serializable data 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