pulsebrief

package
v0.25.0 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package pulsebrief generates a short, structured status summary of a session from its conversation using a cheap same-vendor LLM call. It mirrors the pkg/autotitle pattern (cheap model on the session's own provider, transcript framed as data, timeout, robust parsing) so a voice/mobile client can tell the owner WHAT a session is attempting and HOW it's going without reading the whole transcript.

The summary is prose that can age; the actionable "does it need me / current state" is derived from live session state by the caller, never generated here.

Index

Constants

View Source
const DefaultModelSpec = "haiku"

DefaultModelSpec is the cheap, fast Anthropic model used for brief generation for Anthropic sessions.

View Source
const MaxFieldLen = 140

MaxFieldLen caps each generated field length (in runes).

Variables

View Source
var ErrNoCheapSameVendorModel = errors.New("no cheap same-vendor model")

ErrNoCheapSameVendorModel means the session provider has no configured cheap model for briefs. It is deliberately non-fatal: callers should skip brief generation rather than send the transcript to another vendor.

Functions

This section is empty.

Types

type Brief

type Brief struct {
	Attempting string
	Progress   string
}

Brief is the structured, LLM-generated status prose for a session. Both fields are empty when there is no concrete task yet (see IsEmpty).

func Generate

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

Generate makes a one-shot LLM call to produce a status brief from the conversation messages, using a cheap same-vendor model. It returns an empty Brief (no error) when the conversation has no concrete task yet. It returns an error only when the model can't be resolved, the provider can't be built, or the call produces no usable text.

func (Brief) IsEmpty

func (b Brief) IsEmpty() bool

IsEmpty reports whether the brief carries no usable prose. Callers use it to avoid overwriting a prior brief with nothing.

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