From 9aeddd37b1bb48acb5afd02adefd4ce38efff26a Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 22 Apr 2026 11:13:48 +0000 Subject: [PATCH] README: showcase real capabilities, use new screenshot, drop stale refs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - New '🎯 What you can actually do with it' section leading with concrete user-facing scenarios (project editing, shell execution, image gen, multimodal input, long sessions). - Feature list updated with tool count (9 tools), background shell, generate_image, top-bar quick pickers, Gemma caveat on function calling. - Screenshot: switch from missing docs/screenshots/chat.png to the newly uploaded docs/screenshot.jpg, centred 360 px wide. - Drop roadmap section (docs/ROADMAP.md was deleted). - Advanced config gains 'Image generation' + 'Background shell' blocks. - EN/FR kept in parity. --- README.md | 280 ++++++++++++++++++++++------------------------ fr/README.md | 305 +++++++++++++++++++++++++-------------------------- 2 files changed, 277 insertions(+), 308 deletions(-) diff --git a/README.md b/README.md index a37deb2..23674a9 100644 --- a/README.md +++ b/README.md @@ -11,129 +11,118 @@ > 🇬🇧 English · [🇫🇷 Version française](fr/README.md) -A **native Gemini client for Android** — streaming chat with *function -calling*, built-in file tools (SAF), Termux bridge for shell commands, and -encrypted local persistence. Written in Kotlin + Jetpack Compose, with no -dependency on any official Google app. The goal: reproduce the -[Gemini CLI](https://github.com/google-gemini/gemini-cli) experience in a -standalone APK that fits in your pocket. - -![Chat preview](docs/screenshots/chat.png) - -## 📋 Table of contents - -- [Features](#-features) -- [Prerequisites](#-prerequisites) -- [Installation](#-installation) -- [Usage](#-usage) -- [Architecture](#-architecture) -- [Advanced configuration](#-advanced-configuration) -- [Gemini compatibility](#-gemini-compatibility) -- [Roadmap](#-roadmap) -- [Contributing](#-contributing) -- [License](#-license) -- [Credits](#-credits) - -## ✨ Features - -- **Streaming Gemini chat** over `generativelanguage.googleapis.com`, with - the API key stored in `EncryptedSharedPreferences`. -- **Native file tools** via SAF (`read_file`, `write_file`, `edit_file`, - `delete_file`, `list_directory`, `glob_files`, `grep`) — the model - decides on its own when to call them. -- **Termux bridge** for shell commands (`run_shell_command`) with a - consistent workspace path: `python foo.py` finds the file `write_file` - just wrote. -- **Approval for destructive tools** — you confirm every write / delete / - shell command, or flip "Auto-approve" once. -- **Autosave** of the current conversation, restored on next launch. -- **Auto-compression** at X % of the context window (configurable - threshold) — the session is summarised automatically before it saturates. -- **Dynamic model discovery** via `/v1beta/models` (no hard-coded list). -- **Markdown rendering** in chat: headings, lists, code (inline + - fenced), links, bold/italic, GFM tables, blockquotes, task lists, - horizontal rules, image attachments. -- **Diff viewer** for `edit_file` results. -- **Markdown export** of the conversation to any app (system share - sheet). +A **native Gemini coding client for Android** — not a wrapper around the +official Google app, not a thin webview. A real client that turns your +phone into a pocket coding workstation: the model reads and writes files, +runs shell commands (compiles, tests, starts servers), generates images, +and holds context across hours of conversation. Written in Kotlin + +Jetpack Compose. + +

+ Chat in action: function calling + tool approval +

+ +## 🎯 What you can actually do with it + +- **Ask the model to modify a project, not just describe one.** It opens + files in your workspace (SAF or local folder), edits them literally, + and shows you a diff. You approve once — or flip auto-approve and let + it iterate on its own. +- **Run shell commands from the conversation.** The Termux bridge drops + the model into your workspace directory: `python foo.py`, `npm test`, + `cargo build`, `pip install …`, `curl`, `git status`. Backgrounded + processes (servers, watchers) keep running when the model's turn ends. +- **Generate images inline.** Both **Imagen** (dedicated picker in + Settings → Model) and **Gemini 2.5 Flash Image** ("Nano Banana", + auto-enabled when you pick it in the top-bar dropdown) save their + outputs to the chat bubble as thumbnails. +- **Send images for the model to analyse.** Tap the image icon, pick any + photo from the gallery — it's sent as `inlineData` base64 in the next + turn. The model can OCR, describe, or reason about the image. +- **Survive long sessions.** The app reports live token usage and + auto-compresses the conversation into a fresh summary once the context + window fills up, so you keep talking without 400 errors. +- **Autosave every turn.** Close the app, come back three days later, + the conversation is exactly where you left it. Name and save snapshots + from the drawer for archive. +- **Export anywhere.** Drawer → Export as Markdown opens the Android + share sheet — send the full conversation (text, code blocks, tables, + image references) to any app. + +## ✨ Feature breakdown + +- **Streaming chat** over `generativelanguage.googleapis.com`. API key + encrypted locally in `EncryptedSharedPreferences`. No server in the + middle. +- **Function calling** with 9 built-in tools: + `read_file`, `write_file`, `edit_file`, `delete_file`, + `list_directory`, `glob_files`, `grep`, `run_shell_command` + (foreground or background), `generate_image` (Imagen). The model + decides when to call them. +- **Safety on destructive tools**: every `write_file` / `edit_file` / + `delete_file` / shell command shows an approval dialog with arguments + and a diff (for edits) before it runs. One-tap "Auto-approve" toggle + for trusted sessions. +- **Rich markdown rendering**: headings, numbered / bullet / task lists, + inline + fenced code with a copy button, **bold**, *italic*, GFM + tables, blockquotes, horizontal rules. Bare `https://…` URLs and + `[label](url)` links are clickable and open in your browser. +- **Top-bar quick pickers**: tap the model name to switch models + without opening Settings. Tap the workspace folder to "Open folder" + (system Files app) or "Change folder" (SAF picker). +- **Multimodal input**: attach one or more images per turn; thumbnails + render in the user bubble and persist across reloads. 15 MB cap per + image. +- **Dynamic model list**: fetched live from `/v1beta/models`, no + hardcoded catalog. Custom model IDs accepted in Settings. +- **Diff viewer** in the tool-result bubble for `edit_file`. +- **Two languages**: EN / FR interface, full parity. ## 🛠 Prerequisites -Before you start, make sure you have: - -- **Android 8.0+** (API 26+) on your device. -- A **Gemini API key** (free): . -- **Optional** — [Termux](https://f-droid.org/packages/com.termux/) from - F-Droid or [the GitHub releases](https://github.com/termux/termux-app/releases) - (⚠️ **not** from the Play Store — abandoned since 2020). +- **Android 8.0+** (API 26+). +- A **Gemini API key** (free tier works for chat; image generation + requires billing on the associated Google Cloud project): + . +- **Optional** — [Termux](https://f-droid.org/packages/com.termux/) + from F-Droid or [the GitHub releases](https://github.com/termux/termux-app/releases) + (⚠️ **not** the Play Store version, abandoned since 2020) if you want + shell command execution. To build from source: - -- **Android SDK** (API 34 minimum). -- **JDK 17** on `JAVA_HOME`. +- **Android SDK** (API 34+), **JDK 17** on `JAVA_HOME`. ## 🚀 Installation ### Option 1: pre-built APK -Download the latest debug APK from the -[Releases page](https://github.com/aciderix/gemini-android-app/releases) -and install it. It's debug-signed — replace with a release keystore -before public distribution. +Download the latest APK from the +[Releases page](https://github.com/aciderix/gemini-android-app/releases). +Both debug-signed and release-signed APKs are published on each tag. ### Option 2: build from source -1. Clone the repo: - ```bash - git clone https://github.com/aciderix/gemini-android-app - cd gemini-android-app - ``` - -2. Run the Gradle build: - ```bash - ./gradlew :app:assembleDebug - ``` - -3. The APK lands in: - ``` - app/build/outputs/apk/debug/app-debug.apk - ``` - -4. Install it on the device (USB or `adb install`): - ```bash - adb install app/build/outputs/apk/debug/app-debug.apk - ``` - -## 💻 Usage - -On first launch: - -1. **Settings → Account**: paste your Gemini API key. -2. **Settings → Workspace → Pick folder**: choose a folder under - `/storage/emulated/0/` (avoid `/Android/data/…`, unreachable by Termux). -3. **Settings → Termux shell** (optional, 3 steps): enable the shell - bridge if you want `run_shell_command` to work. - -Then start chatting — the model will use the file and shell tools as -needed. - -### Examples - -**Read a file from the workspace**: -> *"Open `notes.md` and summarise it."* - -**Write + run a Python script**: -> *"Write a `hello.py` script that prints 'Hello', then run it."* - -The app will invoke `write_file` then `run_shell_command` via Termux, -with approval before each destructive action (toggleable). - -**Attach an image**: tap the 🖼️ icon in the composer and pick one from -the system picker. The image is sent as `inlineData` (base64) in the -next multimodal request. +```bash +git clone https://github.com/aciderix/gemini-android-app +cd gemini-android-app +./gradlew :app:assembleDebug +adb install app/build/outputs/apk/debug/app-debug.apk +``` -**Export the conversation**: **burger menu → Export as Markdown** — -opens the system share sheet with the chat in Markdown format. +## 💻 First-run setup + +1. **Settings → Account**: paste your Gemini API key. It's stored + encrypted on device. +2. **Top-bar folder name → Change folder**: pick a workspace under + `/storage/emulated/0/` (avoid `/Android/data/…`, unreachable to + Termux). The file tools operate relative to this folder. +3. **Settings → Termux shell** (optional, one-time): follow the 3-step + guide to allow `run_shell_command`. You need Termux installed and + `termux-setup-storage` run once. +4. **Top-bar model name**: tap it to pick a model. Use + `gemini-2.5-flash` for everyday coding, `gemini-2.5-pro` for harder + reasoning, `gemini-2.5-flash-image-preview` if you want inline image + generation (requires billing). ## 🧱 Architecture @@ -154,68 +143,57 @@ All network traffic flows through `RestGeminiCore`, which emits ### Auto-compression -The model reports `usageMetadata.totalTokenCount` on every response. As -soon as `total / inputTokenLimit` crosses the threshold (default **70 %**), +The model reports `usageMetadata.totalTokenCount` on every response. +Once `total / inputTokenLimit` crosses the threshold (default **70 %**), the conversation is summarised into a fresh session in the background — -a non-blocking banner shows during the operation. +a non-blocking banner signals the operation. -Tune the threshold in **Settings → Auto-compression** (50 % → 95 %). +Tune the threshold in **Settings → Auto-compression** (50 % → 95 %) or +disable it entirely. -### Autosave +### Image generation -On by default. The live session is persisted to -`filesDir/chat-current.json` after every turn, and restored on launch -(as long as no other chat is loaded). Independent of named chats, which -are saved manually from the list. +- **Imagen** (`imagen-3.0-generate-002` by default, picker in + Settings → Model) — called via the `generate_image` function tool + when the model decides one is needed. +- **Gemini 2.5 Flash Image / Nano Banana** — pick it as the chat + model, the app automatically enables `responseModalities: [TEXT, IMAGE]` + on every request so the model returns images inline. +- Images are saved to `/attachments/` and render as + thumbnails in the bubble; chat exports and reloads preserve them. -Toggle in **Settings → Autosave**. +Both image paths require billing on the Google Cloud project linked to +your API key — the Gemini free tier has a quota of **0** for these +models. -### Image attachments +### Background shell commands -Via the 🖼️ icon in the composer — the image is encoded to base64 and -sent as `inlineData` on the next user turn. MIME detected via -`ContentResolver`. 15 MB cap per image. +`run_shell_command` accepts a `background: true` flag so the model can +start long-running processes (web servers, file watchers, training +loops) without Termux's 12-second IPC timeout killing them. Output +lands in `$HOME/.gemini-bg/run-.log`, tailable on demand. ## 🧪 Gemini compatibility Tested with: -- `gemini-2.5-pro` / `gemini-2.5-flash` +- `gemini-2.5-pro` / `gemini-2.5-flash` / `gemini-2.5-flash-image-preview` - `gemini-2.0-flash` - `gemini-1.5-pro` / `gemini-1.5-flash` -The **Settings → Model** picker lists every model on your account that -supports `generateContent`. - -## 🗺 Roadmap - -See [`docs/ROADMAP.md`](docs/ROADMAP.md) for details (in French). - -Main open items: - -- [ ] Release keystore + signed CI. -- [ ] Unit tests on the tool parser and `Workspace`. -- [ ] R8 / minification in release. -- [ ] Fast multi-chat switcher. +**Gemma** models (`gemma-2-*`, `gemma-3-*`) appear in the picker but +don't support function calling — they'll work for pure chat but the +tool stack won't be available. ## 🤝 Contributing -Contributions are welcome: +Contributions welcome: 1. **Fork** the project. -2. Create a branch: - ```bash - git checkout -b feature/my-feature - ``` -3. **Commit** with a clear message: - ```bash - git commit -m "Add my feature" - ``` -4. **Push** your branch: - ```bash - git push origin feature/my-feature - ``` -5. Open a **Pull Request**. +2. Create a branch: `git checkout -b feature/my-feature`. +3. Commit with a clear message: `git commit -m "Add my feature"`. +4. Push: `git push origin feature/my-feature`. +5. Open a Pull Request. ### Dev setup diff --git a/fr/README.md b/fr/README.md index e6eb98f..6798a37 100644 --- a/fr/README.md +++ b/fr/README.md @@ -11,130 +11,129 @@ > 🇫🇷 Version française · [🇬🇧 English](../README.md) -Un client **Gemini natif pour Android** — chat streaming avec *function calling*, -outils fichiers intégrés (SAF), pont Termux pour les commandes shell, et -persistance locale chiffrée. Écrit en Kotlin + Jetpack Compose, sans dépendance -à une application officielle Google. L'objectif : reproduire l'expérience du -[Gemini CLI](https://github.com/google-gemini/gemini-cli) dans un APK autonome -qui tient dans la poche. - -![Aperçu du chat](../docs/screenshots/chat.png) - -## 📋 Table des matières - -- [Fonctionnalités](#-fonctionnalités) -- [Prérequis](#-prérequis) -- [Installation](#-installation) -- [Utilisation](#-utilisation) -- [Architecture](#-architecture) -- [Configuration avancée](#-configuration-avancée) -- [Compatibilité Gemini](#-compatibilité-gemini) -- [Roadmap](#-roadmap) -- [Contribuer](#-contribuer) -- [Licence](#-licence) -- [Crédits](#-crédits) - -## ✨ Fonctionnalités - -- **Chat Gemini streaming** sur `generativelanguage.googleapis.com`, avec clé - API stockée en `EncryptedSharedPreferences`. -- **Outils fichiers natifs** via SAF (`read_file`, `write_file`, `edit_file`, - `delete_file`, `list_directory`, `glob_files`, `grep`) — le modèle décide - seul quand les appeler. -- **Pont Termux** pour les commandes shell (`run_shell_command`) avec chemin - workspace cohérent : `python foo.py` retrouve le fichier écrit juste avant - par `write_file`. -- **Approbation des outils destructifs** — l'utilisateur valide chaque écriture - / suppression / commande shell, ou active « Auto-approve » une bonne fois. -- **Autosave** de la conversation courante, restaurée au prochain lancement. -- **Auto-compression** à X % du context window (seuil réglable) — la session - est résumée automatiquement avant de saturer. -- **Découverte dynamique des modèles** via `/v1beta/models` (pas de liste codée - en dur). -- **Rendu Markdown** dans le chat : titres, listes, code (inline + blocs), - liens, gras/italique, tableaux GFM, citations, listes à cocher, règles - horizontales, pièces jointes images. -- **Diff viewer** intégré pour visualiser les résultats de `edit_file`. -- **Export Markdown** de la conversation vers n'importe quelle app (partage - système). +Un **client de coding Gemini natif pour Android** — pas un wrapper +autour de l'app Google, pas un webview déguisé. Un vrai client qui +transforme votre téléphone en poste de travail de poche : le modèle lit +et écrit vos fichiers, exécute des commandes shell (compilation, tests, +serveurs), génère des images, et garde le contexte sur des heures de +conversation. Écrit en Kotlin + Jetpack Compose. + +

+ Chat en action : function calling + approbation d'outil +

+ +## 🎯 Ce que vous pouvez réellement faire avec + +- **Demander au modèle de modifier un projet, pas juste de le + décrire.** Il ouvre les fichiers de votre workspace (SAF ou dossier + local), les édite littéralement, et affiche un diff. Vous approuvez + une fois — ou activez l'auto-approve et le laissez itérer tout seul. +- **Exécuter des commandes shell depuis la conversation.** Le pont + Termux place le modèle dans le dossier de workspace : `python foo.py`, + `npm test`, `cargo build`, `pip install …`, `curl`, `git status`. + Les processus en arrière-plan (serveurs, watchers) continuent de + tourner quand le tour du modèle se termine. +- **Générer des images inline.** À la fois **Imagen** (picker dédié + dans Settings → Model) et **Gemini 2.5 Flash Image** ("Nano Banana", + activé automatiquement quand vous le sélectionnez dans le dropdown + top-bar) sauvegardent leurs sorties en tant que vignettes dans la + bulle de conversation. +- **Envoyer des images au modèle pour analyse.** Tapez sur l'icône + image, choisissez une photo de la galerie — elle est envoyée en + `inlineData` base64 au prochain tour. Le modèle peut faire de l'OCR, + décrire, ou raisonner sur l'image. +- **Tenir sur des sessions longues.** L'app affiche l'usage tokens en + direct et auto-compresse la conversation dans un nouveau résumé dès + que la fenêtre de contexte se remplit, pour continuer à parler sans + erreur 400. +- **Autosave à chaque tour.** Fermez l'app, revenez trois jours plus + tard, la conversation est exactement où vous l'aviez laissée. + Nommez et sauvegardez des snapshots depuis le drawer pour les + archiver. +- **Exporter n'importe où.** Drawer → Export as Markdown ouvre le + sélecteur de partage Android — envoyez la conversation complète + (texte, blocs de code, tableaux, références d'images) vers n'importe + quelle app. + +## ✨ Fonctionnalités en détail + +- **Chat streaming** sur `generativelanguage.googleapis.com`. Clé API + chiffrée localement dans `EncryptedSharedPreferences`. Pas de serveur + intermédiaire. +- **Function calling** avec 9 outils intégrés : + `read_file`, `write_file`, `edit_file`, `delete_file`, + `list_directory`, `glob_files`, `grep`, `run_shell_command` + (premier plan ou arrière-plan), `generate_image` (Imagen). Le modèle + décide quand les appeler. +- **Sécurité sur les outils destructifs** : chaque `write_file` / + `edit_file` / `delete_file` / commande shell affiche un dialog + d'approbation avec les arguments et un diff (pour les édits) avant + de s'exécuter. Toggle « Auto-approve » en un tap pour les sessions + de confiance. +- **Rendu Markdown riche** : titres, listes numérotées / à puces / à + cocher, code inline et blocs avec bouton copier, **gras**, *italique*, + tableaux GFM, citations, règles horizontales. Les URLs `https://…` + nues et les liens `[label](url)` sont cliquables et ouvrent le + navigateur. +- **Pickers rapides en top bar** : tapez sur le nom du modèle pour en + changer sans ouvrir Settings. Tapez sur le nom du dossier workspace + pour « Open folder » (app Fichiers système) ou « Change folder » + (picker SAF). +- **Entrée multimodale** : attachez une ou plusieurs images par tour, + les vignettes apparaissent dans la bulle utilisateur et persistent à + travers les reloads. Limite de 15 MB par image. +- **Liste de modèles dynamique** : récupérée en live depuis + `/v1beta/models`, pas de catalogue figé. IDs de modèles personnalisés + acceptés dans Settings. +- **Diff viewer** dans la bulle de résultat d'outil pour `edit_file`. +- **Bilingue** : interface EN / FR, parité complète. ## 🛠 Prérequis -Avant de commencer, assurez-vous d'avoir : - -- **Android 8.0+** (API 26+) sur votre appareil. -- Une **clé API Gemini** (gratuite) : - . -- **Optionnel** — [Termux](https://f-droid.org/packages/com.termux/) depuis - F-Droid ou [les releases GitHub](https://github.com/termux/termux-app/releases) - (⚠️ **pas** le Play Store, abandonné depuis 2020). +- **Android 8.0+** (API 26+). +- Une **clé API Gemini** (le free tier fonctionne pour le chat ; la + génération d'image nécessite l'activation du billing sur le projet + Google Cloud associé) : . +- **Optionnel** — [Termux](https://f-droid.org/packages/com.termux/) + depuis F-Droid ou [les releases GitHub](https://github.com/termux/termux-app/releases) + (⚠️ **pas** la version Play Store, abandonnée depuis 2020) si vous + voulez l'exécution de commandes shell. Pour compiler depuis les sources : - -- **Android SDK** (API 34 minimum). -- **JDK 17** dans `JAVA_HOME`. +- **Android SDK** (API 34+), **JDK 17** dans `JAVA_HOME`. ## 🚀 Installation ### Option 1 : APK pré-compilé -Télécharger le dernier APK debug depuis la [page Releases](https://github.com/aciderix/gemini-android-app/releases) -et l'installer. La signature est une clé debug — à remplacer par un keystore -de release avant distribution publique. - -### Option 2 : Compiler depuis les sources - -1. Cloner le dépôt : - ```bash - git clone https://github.com/aciderix/gemini-android-app - cd gemini-android-app - ``` - -2. Lancer le build Gradle : - ```bash - ./gradlew :app:assembleDebug - ``` - -3. L'APK est produit dans : - ``` - app/build/outputs/apk/debug/app-debug.apk - ``` - -4. L'installer sur l'appareil (USB ou `adb install`) : - ```bash - adb install app/build/outputs/apk/debug/app-debug.apk - ``` - -## 💻 Utilisation - -Au premier lancement : - -1. **Settings → Account** : coller votre clé API Gemini. -2. **Settings → Workspace → Pick folder** : choisir un dossier sous - `/storage/emulated/0/` (évitez `/Android/data/…`, inaccessible à Termux). -3. **Settings → Termux shell** (facultatif, 3 étapes) : activer le pont shell - si vous voulez les commandes `run_shell_command`. +Télécharger la dernière APK depuis la +[page Releases](https://github.com/aciderix/gemini-android-app/releases). +APKs debug-signé et release-signé publiés à chaque tag. -Puis commencer à discuter — le modèle utilisera les outils fichiers et shell -au besoin. +### Option 2 : compiler depuis les sources -### Exemples - -**Lire un fichier du workspace** : -> *"Ouvre `notes.md` et résume-le."* - -**Écrire + exécuter un script Python** : -> *"Écris un script `hello.py` qui affiche 'Hello', puis exécute-le."* - -L'app lancera `write_file` puis `run_shell_command` via Termux, avec -approbation avant chaque action destructive (désactivable). - -**Attacher une image** : taper sur l'icône 🖼️ dans la barre de saisie et -choisir une image depuis le picker système. L'image est envoyée en `inlineData` -base64 dans la prochaine requête multimodale. +```bash +git clone https://github.com/aciderix/gemini-android-app +cd gemini-android-app +./gradlew :app:assembleDebug +adb install app/build/outputs/apk/debug/app-debug.apk +``` -**Exporter la conversation** : **Menu burger → Export as Markdown** — ouvre -le sélecteur de partage système avec la conversation au format Markdown. +## 💻 Configuration initiale + +1. **Settings → Account** : coller votre clé API Gemini. Stockée + chiffrée sur l'appareil. +2. **Nom du dossier en top-bar → Change folder** : choisir un + workspace sous `/storage/emulated/0/` (évitez `/Android/data/…`, + inaccessible à Termux). Les outils fichiers opèrent relativement à + ce dossier. +3. **Settings → Termux shell** (optionnel, une fois) : suivre le guide + en 3 étapes pour autoriser `run_shell_command`. Il faut Termux + installé et `termux-setup-storage` lancé une fois. +4. **Nom du modèle en top-bar** : tapez pour en choisir un. + `gemini-2.5-flash` pour le coding quotidien, `gemini-2.5-pro` pour + le raisonnement plus lourd, `gemini-2.5-flash-image-preview` pour la + génération d'image inline (nécessite billing). ## 🧱 Architecture @@ -147,75 +146,67 @@ Projet Gradle multi-modules : | `:domain` | Types purs (`GeminiMessage`, `ToolSpec`, `GeminiEvent`…) — sans Android | | `:ui-components` | Tokens de design (theme, couleurs) partagés | -Tout le réseau passe par `RestGeminiCore` qui émet des `GeminiEvent` consommés -par `ChatViewModel`. Pas de framework DI, pas de Room : `SharedPreferences` + -fichiers JSON sous `filesDir`. +Tout le réseau passe par `RestGeminiCore` qui émet des `GeminiEvent` +consommés par `ChatViewModel`. Pas de framework DI, pas de Room : +`SharedPreferences` + fichiers JSON sous `filesDir`. ## ⚙️ Configuration avancée ### Auto-compression -Le modèle renvoie `usageMetadata.totalTokenCount` à chaque réponse. Dès que -`total / inputTokenLimit` dépasse le seuil (défaut **70 %**), la conversation -est résumée dans une nouvelle session en arrière-plan — un bandeau -non-bloquant s'affiche pendant l'opération. +Le modèle renvoie `usageMetadata.totalTokenCount` à chaque réponse. Dès +que `total / inputTokenLimit` dépasse le seuil (défaut **70 %**), la +conversation est résumée dans une nouvelle session en arrière-plan — +un bandeau non-bloquant signale l'opération. -Régler le seuil dans **Settings → Auto-compression** (50 % → 95 %). +Réglage du seuil dans **Settings → Auto-compression** (50 % → 95 %) ou +désactivation totale. -### Autosave +### Génération d'image -Activée par défaut. La session courante est persistée dans -`filesDir/chat-current.json` après chaque tour, et restaurée à l'ouverture -(tant qu'aucune autre conversation n'est chargée). Indépendant des chats -nommés, qu'on sauvegarde manuellement dans la liste. +- **Imagen** (`imagen-3.0-generate-002` par défaut, picker dans + Settings → Model) — appelée via l'outil function `generate_image` + quand le modèle décide qu'il en faut une. +- **Gemini 2.5 Flash Image / Nano Banana** — choisissez-le comme + modèle de chat, l'app active automatiquement + `responseModalities: [TEXT, IMAGE]` sur chaque requête pour que le + modèle renvoie des images inline. +- Les images sont sauvegardées dans `/attachments/` et + apparaissent en vignettes dans la bulle ; les exports de chat et + reloads les préservent. -Toggle dans **Settings → Autosave**. +Les deux chemins image nécessitent le billing activé sur le projet +Google Cloud lié à votre clé API — le free tier Gemini a un quota de +**0** pour ces modèles. -### Pièces jointes images +### Commandes shell en arrière-plan -Icône 🖼️ dans le composer — ouvre le picker photo système, puis l'image est -encodée en base64 et envoyée en `inlineData` dans le prochain tour utilisateur. -MIME détecté via `ContentResolver`. Limite de 15 MB par image. +`run_shell_command` accepte un flag `background: true` pour que le +modèle puisse lancer des processus de longue durée (serveurs web, file +watchers, boucles d'entraînement) sans que le timeout IPC Termux de +12 secondes ne les tue. La sortie atterrit dans +`$HOME/.gemini-bg/run-.log`, consultable à la demande. ## 🧪 Compatibilité Gemini Testé avec : -- `gemini-2.5-pro` / `gemini-2.5-flash` +- `gemini-2.5-pro` / `gemini-2.5-flash` / `gemini-2.5-flash-image-preview` - `gemini-2.0-flash` - `gemini-1.5-pro` / `gemini-1.5-flash` -Le sélecteur dans **Settings → Model** liste tous les modèles de votre compte -qui supportent `generateContent`. - -## 🗺 Roadmap - -Voir [`docs/ROADMAP.md`](../docs/ROADMAP.md) pour le détail. - -Principaux chantiers ouverts : - -- [ ] Keystore de release + CI signée. -- [ ] Tests unitaires sur le parser d'outils et sur `Workspace`. -- [ ] R8 / minification en release. -- [ ] Switcher rapide multi-conversation. +Les modèles **Gemma** (`gemma-2-*`, `gemma-3-*`) apparaissent dans le +picker mais ne supportent pas le function calling — ils fonctionnent +pour du chat pur mais la stack d'outils sera indisponible. ## 🤝 Contribuer Les contributions sont les bienvenues : 1. **Forkez** le projet. -2. Créez une branche : - ```bash - git checkout -b feature/ma-feature - ``` -3. **Commitez** avec un message clair : - ```bash - git commit -m "Ajout de ma feature" - ``` -4. **Poussez** votre branche : - ```bash - git push origin feature/ma-feature - ``` +2. Créez une branche : `git checkout -b feature/ma-feature`. +3. Commitez avec un message clair : `git commit -m "Ajout de ma feature"`. +4. Poussez : `git push origin feature/ma-feature`. 5. Ouvrez une **Pull Request**. ### Setup dev @@ -233,8 +224,8 @@ Commandes utiles : ## 📄 Licence -Distribué sous la licence **Apache 2.0**. Voir [`LICENSE`](../LICENSE) pour les -détails. +Distribué sous la licence **Apache 2.0**. Voir [`LICENSE`](../LICENSE) +pour les détails. ## 🙏 Crédits