title

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package title generates concise display titles for agent sessions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Normalize

func Normalize(value string) string

Normalize enforces the title contract on model output. It deliberately preserves technical names and the user's language.

Types

type Config

type Config struct {
	BaseURL string
	Model   string
	APIKey  string
}

Config contains an OpenAI-compatible chat completions endpoint. The key is intentionally kept inside the Host and is never included in API results.

type Generator

type Generator struct {
	Config Config
	Client *http.Client
}

Generator calls an OpenAI-compatible endpoint and validates its title-only response before returning it.

func (Generator) Generate

func (g Generator) Generate(ctx context.Context, input Input) (string, error)

Generate returns one normalized title or an error. It does not retry: the title is optional and callers can retain the existing session title when an endpoint is unavailable.

type Input

type Input struct {
	User      string
	Assistant string
}

Input is the minimal context used to name a session. The user request is authoritative; the first assistant text only disambiguates it.

Jump to

Keyboard shortcuts

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