Package-level declarations
Types
Link copied to clipboard
Link copied to clipboard
interface AiProvider
A cloud (or on-device) chat-completion backend — one turn in, one text reply out.
Link copied to clipboard
data class AiProviderConfig(val selectedProvider: ProviderId = ProviderId.OFFLINE_FALLBACK, val anthropicKey: String? = null, val openAiKey: String? = null, val geminiKey: String? = null, val useOnDevice: Boolean = false)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Which provider a consumer has selected + the keys needed to build the fallback chain (buildProviderChain). ON_DEVICE and OFFLINE_FALLBACK are the two slots every consumer plugs their own AiProvider into (buildProviderChain's onDevice/fallback params) — this module doesn't ship either implementation.
Functions
Link copied to clipboard
fun buildProviderChain(config: AiProviderConfig, fallback: AiProvider, onDevice: AiProvider? = null): List<AiProvider>
Builds the provider fallback chain from config: on-device first (if enabled and onDevice is supplied) → configured cloud providers (Anthropic/OpenAI/Gemini, in that priority order) → fallback last. onDevice and fallback are caller-supplied rather than hardcoded — this module ships no on-device LLM or app-specific offline fallback of its own.
Link copied to clipboard