router

package
v0.68.21 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package router is a compatibility alias shim: the STT routing layer now lives in the public framework package pkg/speechkit/stt (Router, Strategy, BuildRouter), so both the Device-Target and the Server-Target assemble it through one path. Existing internal call sites keep compiling unchanged via the aliases below. New code should import pkg/speechkit/stt directly.

The shim also owns the host-side audit wiring: the public router exposes a per-instance provider-selected observer instead of importing internal/auditlog, and both targets install AuditObserver on the routers they build.

Index

Constants

View Source
const (
	StrategyDynamic   = pkgstt.StrategyDynamic
	StrategyLocalOnly = pkgstt.StrategyLocalOnly
	StrategyCloudOnly = pkgstt.StrategyCloudOnly
)

Variables

This section is empty.

Functions

func AuditObserver added in v0.67.14

func AuditObserver(ctx context.Context, providerName string, strategy Strategy)

AuditObserver records a provider.selected audit event for every successful routed transcription, exactly as the pre-promotion internal router did. Hosts set it as stt.Router.OnProviderSelected (or allproviders.RouterConfig.OnProviderSelected). Errors from AppendEvent are intentionally discarded — audit failures must never abort a user-facing transcription.

Types

type Router

type Router = pkgstt.Router

Router selects the best STT provider; see pkg/speechkit/stt.Router.

type Strategy

type Strategy = pkgstt.Strategy

Strategy defines the routing strategy; see pkg/speechkit/stt.Strategy.

Jump to

Keyboard shortcuts

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