api

package
v1.8.2 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2026 License: MIT Imports: 11 Imported by: 1 module, 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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RoleCapabilities added in v1.8.2

type RoleCapabilities interface {
	CanPublish(name string) bool
}

RoleCapabilities is the narrow role-registry seam this handler depends on. Core satisfies it with an adapter over *role.Service (which cannot be imported here); the users module implements it natively when it lands.

type SpeechHandler

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

SpeechHandler handles voice-dictation transcription requests.

func NewSpeechHandler

func NewSpeechHandler(
	transcriber SpeechTranscriber,
	enhancer TranscriptionEnhancer,
	logger kernel.Logger,
	opts ...SpeechHandlerOption,
) *SpeechHandler

NewSpeechHandler creates a new SpeechHandler. A nil logger degrades to a discard sink so the handler is safe to construct in any context.

func (*SpeechHandler) Transcribe

func (h *SpeechHandler) Transcribe(w http.ResponseWriter, r *http.Request)

Transcribe handles the "Dictate with AI" endpoint: it transcribes the uploaded WAV, enhances the transcript into TipTap content, and returns both plus SEO metadata.

type SpeechHandlerOption added in v1.8.2

type SpeechHandlerOption func(*SpeechHandler)

SpeechHandlerOption configures a SpeechHandler. A role service makes the publish capability config-driven; without one every authenticated user may transcribe (the legacy behavior).

func WithRoleService added in v1.8.2

func WithRoleService(rs RoleCapabilities) SpeechHandlerOption

WithRoleService attaches the config-driven role registry so transcribe is gated by the caller's CanPublish capability.

type SpeechTranscriber

type SpeechTranscriber interface {
	Transcribe(
		ctx context.Context,
		audio []byte,
		language string,
	) (speechdomain.Transcription, error)
}

SpeechTranscriber is the speech-to-text port the handler transcribes uploads with. Provider adapters implement it in infrastructure.

type TranscriptionEnhancer

type TranscriptionEnhancer interface {
	EnhanceTranscription(
		ctx context.Context,
		transcript string,
	) (textgendomain.EnhanceResult, error)
}

TranscriptionEnhancer turns a raw transcript into a polished TipTap document. The text generation service satisfies it structurally once the dictation prompt ships.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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