diagnose-gemma4-asr-mismatch
Diagnose reports that Gemma 4 cannot call ASR by separating Android SpeechRecognizer flow from Gemma audio-input task flow.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Diagnose reports that Gemma 4 cannot call ASR by separating Android SpeechRecognizer flow from Gemma audio-input task flow.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Generates beautiful, consistent Preline Theme CSS files. Agent interprets user request, runs build script, delivers complete CSS.
Extract clinical trial data from pharmaceutical conference websites or PDF documents. Use when user provides a URL or PDF file containing innovative drug clinical trial data and needs structured extraction of: drug name, manufacturer, indication, clinical phase, trial name, conference, efficacy and safety data (presented as tables), and markdown output to "药品名称@适应症.md" file.
Use this skill when a clinician, practice manager, or healthcare developer needs to draft, structure, or retrieve clinical documentation — including SOAP notes, referral letters, prior authorization forms, discharge summaries, and care plan narratives. Connects to FHIR R4-compliant APIs (Epic, Cerner, Azure Health Data Services, HAPI FHIR) to pull structured patient data and generate documentation drafts. Also supports manual input when no EHR connection is available. DO NOT use for direct diagnosis, prescribing decisions, or any task requiring a licensed clinical judgment — this skill assists with documentation only.
Search clinical trial databases similar to ClinicalTrials.gov. Use this skill whenever the user asks about clinical trials, drug trials, indications, targets, drug names, trial phases, NCT IDs, enrollment, or recruitment. Automatically parses natural language questions into structured query parameters and calls the backend API to return matching trial records. Trigger words include: clinical trial, NCT, drug development, indication, target, phase, enrollment, recruitment, sponsor, cohort, arm, endpoint, efficacy, safety data.
Analyze ECG signals via heartvoice (心之声) API — single-lead and 12-lead. Automatically selects endpoint based on user intent and responds in the user's language. Use when user mentions ECG, 心电图, 心电分析, 单导联, 十二导联, 1-lead, 12-lead, heart rhythm, arrhythmia, QRS, QT interval, signal quality, or asks to analyze an ECG JSON file.
醫療文檔處理技能 - 病歷摘要、報告分析、醫學文獻整理。適用於醫生、醫療專業人員。觸發詞:病歷、醫療報告、醫學文獻、clinical notes、medical document、病歷摘要、出院小結、門診記錄。
| name | diagnose-gemma4-asr-mismatch |
| description | Diagnose reports that Gemma 4 cannot call ASR by separating Android SpeechRecognizer flow from Gemma audio-input task flow. |
| source | auto-skill |
| extracted_at | 2026-06-07T16:45:05.252Z |
当反馈里把 Gemma 4、ASR、语音按钮、Ask Audio 混在一起时,不要先假设是单点 bug。先确认项目里到底是:
这两条链路常被误认为同一功能。
优先搜索这些词:
SpeechRecognizerRecognizerIntentLLM_ASK_AUDIOsupportAudioContent.AudioBytesgenByteArrayForWavGemma-4llmSupportAudio目标是快速确认:
检查类似 ElvaVoiceViewModel 的类:
SpeechRecognizeronResults() 里是否取 RESULTS_RECOGNITIONprocessWithGemma4(text) 一类文本推理方法如果是这条链路,那么实际架构是:
麦克风 -> Android SpeechRecognizer -> 文本 -> Gemma4
这说明 Gemma4 没有直接承担 ASR,只是消费 ASR 结果。
检查类似这些位置:
LlmAskAudioTaskLlmChatViewModelLlmChatModelHelperChatMessageAudioClip重点确认:
LLM_ASK_AUDIOsupportAudio = trueaudioClipsContent.AudioBytes(audioClip)如果存在,则说明项目另有一条链路:
录音字节 -> LLM 音频输入 -> Gemma4
这条链路才更接近“Gemma4 做音频转写/理解”。
读取 model_allowlist.json 或等价配置,确认目标模型:
llmSupportAudio: truetaskTypes 包含 llm_ask_audio特别注意:
查看导航或入口初始化代码,确认:
Gemma-4-E4B-it / Gemma-4-E2B-it常见问题是:
当首页走 SpeechRecognizer -> text -> Gemma4,而 ask-audio 另有独立实现时,应明确说明:
如果 ask-audio 链路完整存在,则继续排查:
llm_ask_audio如果 README 或产品文案写成“Gemma4 调用 ASR”,但代码里实际是系统 ASR + Gemma4 文本处理,应优先修正文档,避免误导测试或评审。
如果用户已经明确说明:
那么排查重点要从“ASR 是否成功”切换到“ASR 成功后的 Gemma4 触发条件”。
RECORD_AUDIO即使用户表述为“转文字后调不到 Gemma4”,也要先核对首页入口有没有自己处理运行时权限。
检查点:
Manifest.permission.RECORD_AUDIOrememberLauncherForActivityResult(ActivityResultContracts.RequestPermission()) 或等价方式请求权限SpeechRecognizer.startListening()经验上,项目里经常:
RECORD_AUDIO这样会导致首页表现为“语音识别不稳定”或直接失败。
onResults() 后的真实后续分支重点看类似 ElvaVoiceViewModel.onResults():
SpeechRecognizer.RESULTS_RECOGNITIONprocessWithGemma4(text)processWithGemma4() 内部是否又按路由分流不要只看到 processWithGemma4(text) 就认为一定调用了 Gemma4;很多项目会在里面先经过:
这是最容易造成误判的点。
查找类似逻辑:
if (!bridge.state.value.isModelReady) { ... }if (model == null || model.instance == null) { ... }localFallbackResponse(userText)generateFallbackAction(userText)常见问题模式:
processWithGemma4(text)这种情况不是 ASR bug,而是 Gemma4 readiness gating 问题。
查看导航/入口层是否只有“被动自动初始化”,例如:
LaunchedEffect(modelDownloadStatus) 时尝试初始化isModelReady 不成立就依赖某个异步初始化流程这种设计的问题是:
ensureReady() 或等价懒初始化如果确认问题是“文字拿到了,但 Gemma4 未 ready 就直接 fallback”,优先采用下面的修法:
在推理桥接层增加一个 ensureReady() 风格的方法
在 processWithGemma4() 里不要一看到 !isModelReady 就直接 localFallbackResponse()
ensureReady()CloudPlanner.plan() / infer()如果首页麦克风没有权限申请,也一起补上
如果排查结果是这个问题,应明确说:
这类项目里,麦克风权限 和 模型 readiness 是两层独立门槛:
因此排查语音链路时要分两段看:
点击麦克风 -> 录音/识别成功 -> 文本进入 ViewModel -> Gemma4 ready 检查 -> 真正推理
不要把“用户最后没得到 Gemma4 回复”统称成单一的“语音转文字失败”。