pulsebrief

package
v0.29.0 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2026 License: MIT Imports: 7 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 MaxFieldLen = 140

MaxFieldLen caps each generated field length (in runes).

Variables

This section is empty.

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, model core.Model, msgs []core.AgentMessage) (Brief, error)

Generate makes a one-shot LLM call to produce a status brief from the conversation messages using 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