Documentation
¶
Index ¶
- Variables
- func SetLLMTimeout(d time.Duration)
- func StartNarration(ctx context.Context, cfg *asynccfg.Config, rec *asynccfg.OperationRecord) (string, error)
- func UpdateNarration(ctx context.Context, cfg *asynccfg.Config, ev asynccfg.ChangeEvent) (string, error)
- func WithLLMRunner(ctx context.Context, runner LLMRunner) context.Context
- func WithLLMTimeout(ctx context.Context, d time.Duration) context.Context
- type Debouncer
- type LLMInput
- type LLMRunner
- type Session
- type Sink
Constants ¶
This section is empty.
Variables ¶
var ErrNarratorTimeout = errors.New("narrator llm runner timed out")
ErrNarratorTimeout indicates the LLM runner exceeded the per-call budget. Callers typically treat it as a silent skip.
Functions ¶
func SetLLMTimeout ¶
SetLLMTimeout replaces the package-level LLM timeout used by runLLMRunner when no ctx-scoped override is present. Typically called once at application bootstrap from the workspace-config applier. Passing a non-positive value means "no timeout" (runner ctx used as-is).
func StartNarration ¶
func UpdateNarration ¶
func WithLLMTimeout ¶
WithLLMTimeout attaches a per-call timeout override to ctx. Used by request-scoped code paths that need a different bound than the package-level SetLLMTimeout value (e.g. admin flows, tests). A non-positive duration is ignored.
Types ¶
type Debouncer ¶
type Debouncer struct {
// contains filtered or unexported fields
}
Debouncer collapses a stream of text updates into one emission per window. Safe for concurrent use by multiple goroutines — all state mutations are guarded by mu so callers do not need external synchronization.
Typical use from a single goroutine (e.g. the barrier's select loop) is still the common case, but the internal mutex means `go test -race` cannot report a false positive if the caller accidentally invokes Push / Flush / Channel from more than one goroutine.
func NewDebouncer ¶
func (*Debouncer) Channel ¶
Channel returns the debounce timer's channel, or nil when no window is currently active. Safe to call concurrently with Push / Flush.
The returned channel is the *timer's* channel; receiving on it is safe even if Flush races in parallel and stops the timer. A stopped timer's channel simply never fires again. Callers typically re-read Channel() on each select iteration so they pick up the current state.
func (*Debouncer) Flush ¶
Flush returns the pending value (if any) and clears debouncer state. Stops and drains the internal timer. Safe to call at any time; a Flush with no pending value returns "".
func (*Debouncer) Push ¶
Push records a new pending value. When the debounce window is zero, the input is passed through immediately (synchronous emission). Otherwise the first Push starts the window and returns ""; subsequent Push calls within the window replace `pending` and also return "". Callers drain via Channel() + Flush() when the timer fires.