compact

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2026 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultPrompt

func DefaultPrompt() string

DefaultPrompt returns the embedded fallback system prompt used when a compact node has no per-node prompt set.

func Run

func Run(ctx context.Context, p Params) (string, error)

func Title

func Title(
	ctx context.Context,
	llm LLM, model, prompt, answer string,
) (string, error)

Title generates a short (max ~6 words) human-readable title for a chat thread given the first user prompt and the assistant's response. The call goes through the billed LLM client, so its tokens are accounted for.

Types

type LLM

type LLM interface {
	Complete(
		ctx context.Context,
		model string,
		messages []llmclient.Message,
		maxTokens int,
	) (string, error)
}

LLM is the subset of billedllm.Recorder that compact needs. Declared locally so this package stays free of a direct billedllm dependency.

type Params

type Params struct {
	LLM             LLM
	Model           string
	SystemPrompt    string
	Query           string
	Content         string
	MaxOutputTokens int
}

Jump to

Keyboard shortcuts

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