firebase/agent-skills

firebase-ai-logic-basics

先开通AI Logic,再接平台SDK与App Check

  • SKILL.md 已保存
  • 中文用法已整理
  • 安装与运行未实测
先判断是否解决你的问题

firebase-ai-logic-basics 是什么?

firebase-ai-logic-basics 将Gemini能力接入移动或Web客户端,覆盖文本、多模态、流式返回、结构化输出及App Check。服务开通、平台SDK初始化和模型选择是三个不同环节,不能只下载应用配置就期待模型可用。

中文说明由本站依据来源整理;英文原文保留在页面下方。

适合用在

  • 应用需要通过Firebase AI Logic调用Gemini,例如图片说明、对话或流式文本。

这些情况不适合

  • 把模型名称、计费要求和平台能力视为永久不变,或直接复制源文模型例子不核对官方列表。
按客户端选择安装入口

怎么接入你的 Agent?

  1. 定位完整 Skill 目录

    打开本项目来源,核对 SKILL.md 及其引用的脚本和资料。

  2. 交给你正在用的 Agent

    在下面选择客户端,展开并复制安装指令,让 Agent 读取来源后选择安装方式。

  3. 确认识别,再做具体任务

    让 Agent 回报安装目录和识别到的名称 firebase-ai-logic-basics,然后按本页使用示例提供材料。

展开并复制给 Codex 的安装指令
发送给 Codex

安装并检查 firebase-ai-logic-basics

请在 Codex 的当前工作环境中安装并检查 firebase-ai-logic-basics 这个 Skill。

项目身份:firebase/agent-skills / firebase-ai-logic-basics
来源:https://github.com/firebase/agent-skills/blob/99954a30898bb5ddc8152ee10e124dc3b4106bf7/skills/firebase-ai-logic-basics/SKILL.md
已定位的源文件:skills/firebase-ai-logic-basics/SKILL.md

1. 先阅读真实 SKILL.md 和它引用的必要文件,确认触发条件、安装方式、依赖与权限;尊重源文件要求的审批步骤。
2. 按当前客户端支持的方式安装完整 Skill 目录,保留已有配置,不只复制一段提示词。涉及缺失凭证、目标目录或权限时先列出缺项并向我确认。
3. 安装后回读实际目录、Skill 名称和识别结果,说明哪些步骤已完成,哪些只是文档检查,不得把安装成功当作任务已经实测。
4. 如来源提供了可安全验证的示例,在我提供所需输入后做一个最小任务;创建、修改、删除、部署或发送内容前,按源文件和我的授权执行。
准备输入,再按步骤执行

装好以后,具体怎么用?

准备哪些材料

  • 确认Android、iOS、Web或Flutter平台及项目应用;来源CLI要求Node.js20+和npm,需要Firebase身份与对应平台完整参考。

会得到什么

  • 平台SDK与服务配置、App Check接入、目标AI功能,以及实际请求与返回的检查结果。

实际使用顺序

  1. 核对当前Firebase项目与已注册应用;按源文运行init ailogic开通服务,不能用plist或json配置替代开通。
  2. 读取目标平台初始化参考,核对官方当前模型和API提供商支持,再实现最小文本或多模态请求。
  3. 按平台设置App Check;本地与CI的debug token通过私有环境或secret注入,不写进客户端源码。
  4. 分别验证请求、流式或结构化结果,并按需求用Remote Config管理模型选择;模型可用性和计费条件以实际官方资料为准。
使用示例

从一个具体任务开始

本站根据源文件编写的使用示例,未在本站实际运行。示例中的文件由你提供。

安装并识别 Skill 后发送

复制一个具体任务

用 firebase-ai-logic-basics 为我的Web应用加“上传图片后生成一句说明”。先核对项目、已注册应用和AI Logic是否开通,再查官方当前支持的模型,使用平台参考实现最小调用与App Check。debug token不进Git,先用开发环境验证;未实际请求时请明确说明。
预期结果

预期服务、SDK和访问保护都对应真实项目;生成内容与请求成功需实际执行,本站未执行本例。

使用前先看这些限制

使用条件与边界

  • 捕获源文含易变的品牌与Gemini模型说明,本站不把这些快照外推为当前全部可用模型。
  • 客户端配置正确不代表配额、计费、服务开通或App Check都已满足;PERMISSION_DENIED需按实际错误定位。
针对这个 Skill 的疑问

常见问题

已有Firebase配置文件,为什么仍然PERMISSION_DENIED?

源文指出应用配置不负责启用AI Logic;应检查服务是否已开通,也要结合实际身份与App Check错误核对,不能只凭一个报错断定唯一原因。

本地模拟器被App Check拒绝怎么办?

按平台debug provider路线生成并登记测试token,通过私有配置注入;不要为了方便把token硬编码到公开源码。

需要核对时再展开原文

来源原文与资料状态

源文件
已保存 SKILL.md,抓取于 2026-11-19T19:32:10.677Z
中文使用说明
已针对下方源文件版本整理用途、用法和常见问题
安装与任务测试
本站未执行安装或任务测试
来源复核
本页中文用法已对照保存版本的完整 SKILL.md 阅读整理
展开 SKILL.md 原文、章节与历史收录资料

skills/firebase-ai-logic-basics/SKILL.md · 抓取时间 2026-11-19T19:32:10.677Z

以下保留源文件的 description、章节及摘录,供核对中文说明;完整文件通过上方链接打开。

抓取成功不代表已完成安装或任务测试。

来源 description(原文)

Integrates Firebase AI Logic (formerly Vertex AI for Firebase) into mobile and web apps (Android, iOS, Web, and Flutter) to call Gemini models from client code. Use when provisioning or initializing Firebase AI Logic, or adding Gemini features to an app: text generation, multimodal input, chat, streaming, structured output, hybrid on-device inference, App Check protection, or switching models with Remote Config.

查看源文件章节 / Source sections
  • 原文:Firebase AI Logic Basics
  • 原文:Overview
  • 原文:Setup & initialization
  • 前置条件 / Prerequisites
  • 原文:1. Provision Firebase AI Logic (ALL platforms)
  • 原文:2. Add the SDK and initialize the service in the app
  • 原文:Core Capabilities
  • 原文:Text-Only Generation
  • 原文:Multimodal (Text + Images/Audio/Video/PDF input)
  • 原文:Chat Session (Multi-turn)
  • 原文:Streaming Responses
  • 原文:Text-to-Speech (TTS) Generation
  • 原文:Generate Images with Nano Banana
  • 原文:Search Grounding with the built in googleSearch tool
  • 原文:Supported Platforms and Frameworks
  • 原文:Advanced Features
  • 原文:Structured Output (JSON)
  • 原文:On-Device AI (Hybrid)
  • 原文:Security & Production
  • 原文:Firebase App Check
  • 原文:App Check Debug Tokens for Local Development & CI/CD
  • 原文:Local Development (Auto-Generated)
  • 原文:CI/CD Pipelines (Pre-Provisioned)
  • 原文:Firebase Remote Config
  • 原文:Initialization Code References
  • 原文:References
原文:Overview

Firebase AI Logic is a product of Firebase that allows developers to add gen AI to their mobile and web apps using client-side SDKs. The app can directly call Gemini models via Firebase AI Logic without the developer needing to manage a dedicated backend. Firebase AI Logic was previously known as "Vertex AI for Firebase". It supports the two Gemini API providers: - **Gemini Developer API**: It has a free tier ideal for prototyping, and pay-as-you-go for production - **Agent Platform Gemini API** (formerly branded Vertex AI): Ideal for scale with enterprise-grade production readiness, requires Blaze pricing plan Use the Gemini Developer API as a default, and only Agent Platform Gemini API (formerly branded Vertex AI) if the application requires it. ______________________________________________________________________

前置条件 / Prerequisites

- Identify the platform the user is interested in building on prior to starting: Android, iOS, Web, or Flutter. - If their platform is unsupported, Direct the user to Firebase Docs to learn how to set up AI Logic for their application (share this link with the user https://firebase.google.com/docs/ai-logic/get-started) - The Firebase CLI commands below run through `npx` on every platform, so they need **Node.js 20+** and npm. Use the `firebase-basics` skill to check for them and to log in to the Firebase CLI. If Node.js is missing or older than version 20, ask the user to install it as that skill describes. Don't install system packages yourself, for example with `sudo apt-get`, because that changes the user's machine without their consent.

原文:1. Provision Firebase AI Logic (ALL platforms)

Use the **Firebase CLI** to provision Firebase AI Logic for the Firebase Project: 1. Make sure that you're in a firebase directory (with a `firebase.json`). 1. Verify that you're running Firebase CLI commands against the intended Firebase Project. When you run this command, the active project is marked with "current": ```bash npx -y firebase-tools@latest projects:list ``` 1. Make sure there's at least one Firebase App for the target platform registered with the current Firebase Project: ```bash npx -y firebase-tools@latest apps:list ``` 1. Provision Firebase AI Logic for the Firebase Project: ```bash npx -y firebase-tools@latest init ailogic ``` This command will enable the Gemini Developer API in the Firebase project. > [!WARNING] **CRITICAL: Provisioning Firebase AI Logic is Required** For all > platforms (Android, iOS, Web, or Flutter), even if the app already uses > Firebase, you MUST run `npx -y firebase-tools@latest init ailogic` to > provision the service. The configuration files of `GoogleService-Info.plist`, > `google-services.json`, and `firebase_options.dart` ONLY handle client > configuration and do NOT enable the Firebase AI Logic service, leading to > `PERMISSION_DENIED` errors. If you can't run `init ailogic` yourself (for example because Node.js is missing or the Firebase CLI isn't logged in) do NOT skip it. The app's requests to Gemini models will fail until the Firebase AI Logic service is provisioned. Tell the user to run this command in their project directory, and include it in your final summary: ```bash npx -y firebase-tools@latest init ailogic ```

原文:2. Add the SDK and initialize the service in the app

Adding the SDK dependency and initializing the service are platform-specific. Before writing code, read the reference for the target platform listed under [Initialization Code References](#initialization-code-references). More info in [Firebase AI Logic Getting Started](https://firebase.google.com/docs/ai-logic/get-started.md.txt) ______________________________________________________________________

原文:Core Capabilities

> [!WARNING] **CRITICAL: Use current model names:** Always check the > [Firebase AI Logic Models documentation](https://firebase.google.com/docs/ai-logic/models.md.txt) > for the currently supported model names. Do NOT use any Gemini 1.x or Gemini > 2.x models (such as `gemini-1.5-flash`, `gemini-1.5-pro`, `gemini-2.0-flash`, > `gemini-2.0-pro`, `gemini-2.5-flash`, `gemini-2.5-flash-lite`, or > `gemini-2.5-pro`), as older models are deprecated or shut down. Always use a > currently supported Gemini 3+ model; if URL access is blocked in your > environment, proceed directly without searching local files.

原文:Multimodal (Text + Images/Audio/Video/PDF input)

Firebase AI Logic allows Gemini models to analyze image files directly from your app. This enables features like creating captions, answering questions about images, detecting objects, and categorizing images. Beyond images, Gemini can analyze other media types like audio, video, and PDFs by passing them as inline data with their MIME type. For files larger than 20 megabytes (which can cause HTTP 413 errors as inline data), store them in Cloud Storage for Firebase and pass their URLs to the Gemini Developer API.

文件 SHA256:44680ac433e46a3cc4f679774c4525ae87c735051d397df5483f5ec598401567

仓库许可证记录:Apache-2.0;repository-license-recorded-scope-unverified,查看来源。

Skills.sh收录简介 · 2026-07-28

Official skill for integrating Firebase AI Logic (Gemini API) into web applications. Covers setup, multimodal inference, structured output, and security.

查看历史简介来源

历史收录数据

Skill标识firebase-ai-logic-basics
来源仓库firebase/agent-skills
榜单快照2026-07-28
榜单口径Skills.sh累计安装量
快照名次268
快照累计安装量78600

历史资料说明

  • 安装量用于说明当时的收录次序,不是效果、可信度或当前可用性的证明。

此页用于识别项目与来源。安装入口可在该Skill的Skills.sh页面查看;当前目录是否仍存在、附带脚本和账户依赖尚需按具体版本确认。

返回 Skills 目录,按任务继续筛选 · MCP与Skills教程与资源