From bc3779fb69dc1946ee19b6a375253bde23c80db9 Mon Sep 17 00:00:00 2001 From: Google Team Member Date: Thu, 29 Oct 2026 14:31:35 -0700 Subject: [PATCH] feat(cli): use gemini-3.5-transcribe as default model for transcribe command - Switch the `transcribe` default model to `gemini-3.5-transcribe` and add `gemini-3.5-transcribe` to the `Model` enum (catalog group `Speech`). - For dedicated `*-transcribe` models, send only the audio block with `generation_config.transcription_config` (verbatim mode with `diarization_mode: "speaker"` and `timestamp_granularities: ["word"]` per `--no-speakers`/`--no-timestamps`), and render `md`, `text`, `json`, and `srt` from the returned `word_info` annotations. Segment text is cut from the response text by the annotations' byte indices, so the model's punctuation and spacing are kept (including languages written without spaces); speakers are numbered `Speaker 1`, `Speaker 2`, ... by first appearance (the API's raw labels, e.g. `spk:0`, are opaque); SRT cues split at sentence ends and are capped at 7 s / 84 bytes including the speaker prefix; a sentence's last word may overrun by a bounded amount rather than be stranded alone. md/text warn when the response has no word-level annotations. - `gemini-3.5-transcribe` accepts audio only: video inputs fall back to `gemini-3.8-flash` when `--model` is not set, and an explicit `--model gemini-3.5-transcribe` with a video input is a usage error; for audio-only WebM (`.webm` maps to `video/webm`), both point at `--mime-type audio/webm`. A request rejected (HTTP 400) while speaker labels or timestamps are on points at the documented 30-minute limit for those features and suggests splitting the recording, `--no-speakers --no-timestamps`, or `--model gemini-3.8-flash`. Under `--dry-run`, a `files/` input (whose type is only known after `files.get`) notes that a video would use `gemini-3.8-flash`. Each JSON result now reports the model that served it. - General multimodal models (for example `-m gemini-3.8-flash`) keep the prompt plus `response_format` JSON schema path. - `transcribe --help` shows the video fallback model and links to https://ai.google.dev/gemini-api/docs/transcribe. Fixes https://github.com/google-gemini/gemini-api-cli/issues/144 PiperOrigin-RevId: 1009969008 --- .../java/com/google/genai/gaos/models/interactions/Model.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/com/google/genai/gaos/models/interactions/Model.java b/src/main/java/com/google/genai/gaos/models/interactions/Model.java index 801b98c49f2..c40f53ce3ea 100644 --- a/src/main/java/com/google/genai/gaos/models/interactions/Model.java +++ b/src/main/java/com/google/genai/gaos/models/interactions/Model.java @@ -69,6 +69,7 @@ public class Model { public static final Model GEMINI4_ARGON = new Model("gemini-4-argon"); public static final Model GEMINI38_FLASH_TTS = new Model("gemini-3.8-flash-tts"); public static final Model GEMINI38_FLASH_LITE_TTS = new Model("gemini-3.8-flash-lite-tts"); + public static final Model GEMINI35_TRANSCRIBE = new Model("gemini-3.5-transcribe"); public static final Model LYRIA3_CLIP_PREVIEW = new Model("lyria-3-clip-preview"); public static final Model LYRIA3_PRO_PREVIEW = new Model("lyria-3-pro-preview"); public static final Model GEMINI_ROBOTICS_ER16_PREVIEW = new Model("gemini-robotics-er-1.6-preview"); @@ -176,6 +177,7 @@ private static final Map createValuesMap() { map.put("gemini-4-argon", GEMINI4_ARGON); map.put("gemini-3.8-flash-tts", GEMINI38_FLASH_TTS); map.put("gemini-3.8-flash-lite-tts", GEMINI38_FLASH_LITE_TTS); + map.put("gemini-3.5-transcribe", GEMINI35_TRANSCRIBE); map.put("lyria-3-clip-preview", LYRIA3_CLIP_PREVIEW); map.put("lyria-3-pro-preview", LYRIA3_PRO_PREVIEW); map.put("gemini-robotics-er-1.6-preview", GEMINI_ROBOTICS_ER16_PREVIEW); @@ -215,6 +217,7 @@ private static final Map createEnumsMap() { map.put("gemini-4-argon", ModelEnum.GEMINI4_ARGON); map.put("gemini-3.8-flash-tts", ModelEnum.GEMINI38_FLASH_TTS); map.put("gemini-3.8-flash-lite-tts", ModelEnum.GEMINI38_FLASH_LITE_TTS); + map.put("gemini-3.5-transcribe", ModelEnum.GEMINI35_TRANSCRIBE); map.put("lyria-3-clip-preview", ModelEnum.LYRIA3_CLIP_PREVIEW); map.put("lyria-3-pro-preview", ModelEnum.LYRIA3_PRO_PREVIEW); map.put("gemini-robotics-er-1.6-preview", ModelEnum.GEMINI_ROBOTICS_ER16_PREVIEW); @@ -255,6 +258,7 @@ public enum ModelEnum { GEMINI4_ARGON("gemini-4-argon"), GEMINI38_FLASH_TTS("gemini-3.8-flash-tts"), GEMINI38_FLASH_LITE_TTS("gemini-3.8-flash-lite-tts"), + GEMINI35_TRANSCRIBE("gemini-3.5-transcribe"), LYRIA3_CLIP_PREVIEW("lyria-3-clip-preview"), LYRIA3_PRO_PREVIEW("lyria-3-pro-preview"), GEMINI_ROBOTICS_ER16_PREVIEW("gemini-robotics-er-1.6-preview"),