assist

package
v0.38.13 Latest Latest
Warning

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

Go to latest
Published: May 25, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

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
	DefaultLocale 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