Documentation
¶
Overview ¶
Package sessiontitle provides session title generation using a one-shot LLM call. It is designed to be independent of pkg/runtime to avoid circular dependencies and the overhead of spinning up a nested runtime.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Completer ¶ added in v1.153.0
type Completer interface {
Name() string
Complete(ctx context.Context, systemPrompt, prompt string) (string, error)
}
Completer answers a one-shot prompt outside docker-agent's model providers, such as an external coding harness CLI.
type Generator ¶
type Generator struct {
// contains filtered or unexported fields
}
Generator generates session titles using a one-shot LLM completion.
func New ¶
New creates a title Generator from the ordered candidate models. Nil providers are skipped. Image-output-capable providers remain eligible because title-generation calls are explicitly text-only.
func NewFromCompleters ¶ added in v1.153.0
NewFromCompleters creates a title Generator from the ordered candidate completers. Nil completers are skipped.
func (*Generator) Generate ¶
func (g *Generator) Generate(ctx context.Context, sessionID string, userMessages []string) (title string, err error)
Generate produces a title for a session based on the provided user messages. It performs one-shot LLM calls directly via the provider's CreateChatCompletionStream, avoiding the overhead of spinning up a nested runtime, and falls back to the next candidate on failure; completers come after models. Returns an empty string if no candidates or messages are configured.