from __future__ import annotations import gradio as gr from layout import cell def render_setup_cell() -> gr.Textbox: """ Render a small setup cell that collects a Gemini API key. The returned textbox component is used by other cells to pass GEMINI_API_KEY into the MCP server environment. This Space runs your key locally in the container to call Gemini. You can revoke it any time. """ with cell("🔑 Setup: Gemini API key"): gr.Markdown( """ ### 🔐 Why a Gemini key? The Aileen MCP server uses Google Gemini for slide-aware analysis and transcription. To keep the demo lightweight and avoid hard-coding credentials, this Space expects you to provide a **Gemini API key** that is scoped to your own Google account or test project. - The key is only used from within this Space to call Gemini via the Aileen MCP server. - You can revoke or rotate it at any time in your Google Cloud / AI Studio settings. - This respects the time of our esteemed competition reviewers in that they receive a ready-to-run environment. Cautious users may configure credentials in config files for the sub components by using the provided Dockerfile. Enter a key with access to the `gemini-*` family of models. The health check and the demos below will both use this value. Note that charges may be incurred, subject to your Gemini access tier. """ ) gemini_key_box = gr.Textbox( label="Gemini API key", type="password", placeholder="Paste your Gemini API key here", lines=1, ) return gemini_key_box