STTOptions

org.llm4s.speech.stt.STTOptions
See theSTTOptions companion class
object STTOptions

Attributes

Companion
class
Graph
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
STTOptions.type

Members list

Type members

Inherited and Abstract types

type MirroredElemLabels <: Tuple

The names of the product elements

The names of the product elements

Attributes

Inherited from:
Mirror
type MirroredLabel <: String

The name of the type

The name of the type

Attributes

Inherited from:
Mirror

Value members

Concrete methods

def validate(language: Option[String], prompt: Option[String], enableTimestamps: Boolean, diarization: Boolean, confidenceThreshold: Double): Result[STTOptions]

Create STTOptions with typed validation (Result-based). Validates language tag format (BCP 47) and confidence threshold [0.0, 1.0].

Create STTOptions with typed validation (Result-based). Validates language tag format (BCP 47) and confidence threshold [0.0, 1.0].

Value parameters

confidenceThreshold

Minimum confidence [0.0, 1.0]

diarization

Whether to detect/separate speakers

enableTimestamps

Whether to request word-level timestamps

language

Optional BCP 47 language tag

prompt

Optional context for transcription

Attributes

Returns

Right(STTOptions) if all validations pass, Left(STTError.InvalidInput) otherwise

def validateBatch(options: Seq[STTOptions]): Result[Seq[STTOptions]]

Batch-pass already-constructed STTOptions through. Each element has already cleared the case-class require checks at construction time, so this is a passthrough kept for symmetry with validate.

Batch-pass already-constructed STTOptions through. Each element has already cleared the case-class require checks at construction time, so this is a passthrough kept for symmetry with validate.

Attributes

def validateBcp47(tag: String): Result[String]

Validate BCP 47 language tag format. Accepts standard tags like "en", "en-US", "zh", etc. Rejects full English words like "english" or invalid formats.

Validate BCP 47 language tag format. Accepts standard tags like "en", "en-US", "zh", etc. Rejects full English words like "english" or invalid formats.

BCP 47 format:

  • Language (2 letters, lowercase): en, fr, de
  • Region (2 letters, uppercase): US, GB, FR
  • Script (4 letters, title case): Hans (for zh-Hans)

Value parameters

tag

Language tag to validate

Attributes

Returns

Right(tag) if valid, Left(error) if invalid