Spaces:
Running
Running
File size: 1,629 Bytes
f481211 f6292c0 f481211 85fe5ba f481211 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
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
|