Help us shape the future of Go! Take the 2026 Go Developer Survey

sessiontitle

package
v1.115.0 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

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 Generator

type Generator struct {
	// contains filtered or unexported fields
}

Generator generates session titles using a one-shot LLM completion.

func New

func New(model provider.Provider, fallbackModels ...provider.Provider) *Generator

New creates a new title Generator. The first model is the primary; any additional ones are fallbacks tried in order if earlier attempts fail. Nil providers are silently ignored.

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 model on failure. Returns an empty string if no models or messages are configured.

Jump to

Keyboard shortcuts

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