router

package
v0.72.1 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2026 License: Apache-2.0 Imports: 3 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 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