package top.yeij.cyrene.voice.stt

import kotlinx.coroutines.flow.SharedFlow
import kotlinx.coroutines.flow.StateFlow

enum class SttProviderType { DASHSCOPE, BACKEND, SYSTEM }

data class SttResult(
    val text: String,
    val isFinal: Boolean,
    val isError: Boolean = false,
)

interface SttProvider {
    val partialResult: StateFlow<String>
    val finalResult: SharedFlow<SttResult>
    val onError: SharedFlow<String>
    val isListening: StateFlow<Boolean>

    fun start()
    fun stop()
    fun cancel()
}
