스킬 web-ai-prompt-api
🤖

web-ai-prompt-api

안전 🌐 네트워크 접근📁 파일 시스템 액세스⚙️ 외부 명령어

使用 Gemini Nano 實作 Chrome Prompt API

使用 Chrome 內建的 Prompt API 搭配 Gemini Nano 建構裝置端 AI 功能。在瀏覽器中本機處理文字、影像與音訊,適用於重視隱私的應用情境,無需外部伺服器呼叫。

지원: Claude Codex Code(CC)
📊 70 적절함
1

스킬 ZIP 다운로드

2

Claude에서 업로드

설정 → 기능 → 스킬 → 스킬 업로드로 이동

3

토글을 켜고 사용 시작

테스트해 보기

"web-ai-prompt-api" 사용 중입니다. How do I check if Chrome Prompt API is available?

예상 결과:

  • • 使用 await LanguageModel.availability() 來檢查狀態
  • • 回傳 'unavailable'、'downloadable'、'downloading' 或 'available'
  • • 建立 sessions 前務必先檢查可用性
  • • 確認 Chrome 版本為 138+ 且有 22 GB 可用儲存空間
  • • 檢查 chrome://on-device-internals 以查看模型下載狀態

"web-ai-prompt-api" 사용 중입니다. Generate hashtags for my blog post using structured output

예상 결과:

  • • 建立 JSON Schema,type 設為 'object',並包含 'hashtags' 陣列屬性
  • • 設定 pattern '^#[^\s#]+$' 以確保 hashtag 格式有效
  • • 使用 session.prompt() 搭配 responseConstraint 參數
  • • 模型會回傳可安全解析的有效 JSON
  • • 使用 omitResponseConstraintInput 將 schema 排除於配額之外

"web-ai-prompt-api" 사용 중입니다. How can I preserve conversation context across page refreshes?

예상 결과:

  • • 將 initialPrompts 陣列與 session 參數儲存在 localStorage
  • • 頁面載入時取回儲存資料並傳入 LanguageModel.create()
  • • 每次 prompt 後追蹤使用者與助理訊息
  • • 將新訊息附加到 initialPrompts 陣列
  • • 將更新後的對話歷史儲存回 localStorage

보안 감사

안전
v5 • 1/16/2026

This is a pure documentation skill containing reference material for Chrome's Prompt API. All 93 static findings are false positives from pattern matching on documentation text. The skill contains no executable code, makes no network requests, accesses no files, and executes no commands.

2
스캔된 파일
630
분석된 줄 수
3
발견 사항
5
총 감사 수
감사자: claude 감사 이력 보기 →

품질 점수

38
아키텍처
100
유지보수성
87
콘텐츠
21
커뮤니티
100
보안
91
사양 준수

만들 수 있는 것

打造 AI 強化擴充功能

建立具備裝置端 AI 的瀏覽器擴充功能,用於內容分析、分類與智慧搜尋,無需伺服器成本。

本機處理敏感資料

建立可在本機分析醫療紀錄、金融資料或個人資訊的 Web 應用,無需外部 API 呼叫。

在無網路環境啟用 AI

加入離線可用的 AI 功能,適用於外勤人員、旅行者或網路不穩定的使用者。

이 프롬프트를 사용해 보세요

檢查 API 支援
Check if the Chrome Prompt API is available in my browser. Show me the availability status and what model parameters are supported.
建立基本 Session
Create a LanguageModel session with default parameters. Generate a haiku about coding.
擷取結構化資料
Set up a session with JSON Schema constraints to extract product name, price, and rating from this product description. Return valid JSON.
本機分析影像
Configure a multimodal session for image input. Analyze this uploaded screenshot and describe the UI elements you see.

모범 사례

  • 保留一個空的 session 以避免模型卸載與重新載入延遲
  • 使用 AbortController 搭配 signal 參數,讓使用者可取消長時間的生成
  • 需要共享上下文的平行對話時,優先複製 sessions 而非重新建立

피하기

  • 每次請求都建立新 session 而非重用(模型重新載入成本高)
  • 忽略 inputUsage 與 inputQuota 限制直到 session 失敗
  • 未檢查可用性就假設 Prompt API 可用並建立 sessions

자주 묻는 질문

What Chrome version supports the Prompt API?
Chrome 138+ 的穩定版可用於擴充功能。Web 應用需要註冊 origin trial。檢查 chrome://on-device-internals 以查看模型狀態。
How much storage does Gemini Nano require?
模型下載需要 22 GB 可用儲存空間。安裝後若可用空間低於 10 GB,Chrome 會自動移除。
Can I use this API in Chrome extensions?
可以。Prompt API 在 Chrome 138+ 穩定版對擴充功能可用,無需 origin trial 權限。請移除過期的 aiLanguageModelOriginTrial 權限。
Is my data sent to external servers when using Gemini Nano?
不會。Gemini Nano 完全在裝置端執行,所有處理都在瀏覽器本機完成,無任何外部網路請求。
Why is the model unavailable even with Chrome 138 installed?
請檢查:22 GB 可用儲存空間、4+ GB GPU VRAM 或 16 GB RAM、支援的作業系統版本,並啟用 chrome://flags/#prompt-api-for-gemini-nano-multimodal-input。
How does on-device AI compare to cloud APIs like Claude?
裝置端具備隱私與零延遲優勢,但上下文視窗較小且能力較弱。最適合重視隱私或離線情境。

개발자 세부 정보

파일 구조

📄 SKILL.md