assist

package
v0.72.0 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2026 License: Apache-2.0 Imports: 23 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package assist implements the POST /v1/assist/process handler. It accepts either an audio payload (→ STT → Assist pipeline) or a text transcript directly, runs the Framework's Assist Pipeline, and returns the result plus optional TTS audio as base64 in the JSON response.

Host-side tool execution (clipboard, selection, quick-note) is NOT done server-side — the server returns an `action: "execute"` signal and the calling client performs the action. This keeps the Server-Target safe for multi-tenant deployments where host-level side effects would be nonsensical.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

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

Handler implements the /v1/assist/process HTTP surface.

func New

func New(opts Options) (*Handler, error)

New constructs a Handler. processor must be non-nil. Transcriber is optional — when omitted, the handler rejects requests that carry audio with a 400/missing-transcriber code.

func (*Handler) Mount

func (h *Handler) Mount(mux *http.ServeMux)

Mount registers the handler at /v1/assist/process.

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*Handler) ServeSelfTest added in v0.31.0

func (h *Handler) ServeSelfTest(w http.ResponseWriter, r *http.Request)

type Options

type Options struct {
	Processor              Processor
	Transcriber            Transcriber // optional; nil disables audio input
	MaxUploadMB            int
	MaxDecodedAudioSeconds int
	DefaultLocale          string
	Store                  store.Store
	ActiveTemplateIDs      []string
}

Options configures a single Handler instance.

type Processor

type Processor interface {
	Process(ctx context.Context, transcript string, opts assistpkg.ProcessOpts) (*assistpkg.Result, error)
}

Processor is the Assist-pipeline surface the handler needs. The production implementation is `internal/assist.Pipeline`; tests supply a fake.

type Transcriber

type Transcriber interface {
	Route(ctx context.Context, audio []byte, audioDurationSecs float64, opts stt.TranscribeOpts) (*stt.Result, error)
}

Transcriber is the STT surface the handler needs when the caller sends audio. If nil, only text-only requests are accepted.

Jump to

Keyboard shortcuts

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