autotitle

package
v0.24.1 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package autotitle generates short, human-readable session titles from a conversation using a cheap LLM call. It is shared by all frontends (TUI, serve) so the auto-titling behavior stays identical across them.

Index

Constants

View Source
const DefaultModelSpec = "haiku"

DefaultModelSpec is the cheap, fast model used for title generation when the session's provider has no cheaper same-vendor option (Anthropic).

View Source
const MaxTitleLen = 60

MaxTitleLen caps the generated title length (in runes).

Variables

This section is empty.

Functions

func Generate

func Generate(ctx context.Context, factory ProviderFactory, sessionModel core.Model, msgs []core.AgentMessage) (string, error)

Generate makes a one-shot LLM call to produce a session title from the conversation messages. It uses a cheap model (DefaultModelSpec) and returns the cleaned title. Returns an error if the model can't be resolved, the provider can't be built, or the call produces no usable text.

Types

type ProviderFactory

type ProviderFactory func(core.Model) (core.Provider, error)

ProviderFactory builds a provider for a given model. Callers pass the same factory they use elsewhere (it handles auth/OAuth refresh).

Jump to

Keyboard shortcuts

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