The Gemini Live Todo sample demonstrates real-time, voice-based interactions using the Gemini Live API. It allows users to manage a to-do list (add, remove, update tasks) through hands-free, conversational commands. The implementation relies on the Firebase AI SDK for Android to interact with the gemini-2.5-flash-native-audio-preview-12-2025 model.
val generativeModel = Firebase.ai(backend = GenerativeBackend.vertexAI()).liveModel(
"gemini-2.5-flash-native-audio-preview-12-2025",
generationConfig = liveGenerationConfig,
systemInstruction = systemInstruction,
tools = listOf(
Tool.functionDeclarations(
listOf(getTodoList, addTodo, removeTodo, toggleTodoStatus),
),
),
)
try {
session = generativeModel.connect()
} catch (e: Exception) {
Log.e(TAG, "Error connecting to the model", e)
liveSessionState.value = LiveSessionState.Error
}