Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

No bindings for Firebase AI Logic

未关闭
#801 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
38/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
firebase, react, typescript
领域
ai, frontend

调研方向

先从 src/sdk.tsx 中的 provider、hook 和 initializer 声明开始,然后将 #798 中的 ReactFire recipe demo 与其直接使用 Firebase AI Logic 的方式进行比较。检查现有的 FirebaseAppProvider 引用,以及 issue 中描述的 @firebase/ai API surface。完成标准是:为稳定的 generateContent、generateContentStream 和 ChatSession 用例提供经过审查的 binding,同时将 LiveSession 和 startAudioConversation 排除在范围之外。

由索引模型根据 Issue 内容生成。

描述

ReactFire ships a provider and hook set for nine Firebase products and none for Firebase AI Logic (@firebase/ai). An app that uses it initializes it by hand, outside the FirebaseAppProvider tree the rest of the app runs through.

src/sdk.tsx declares AppCheckProvider, AuthProvider, AnalyticsProvider, DatabaseProvider, FirestoreProvider, FunctionsProvider, PerformanceProvider, StorageProvider and RemoteConfigProvider, each with a matching useX and useInitX. A search of src/ for getAI, firebase/ai or @firebase/ai returns nothing (control: FirebaseAppProvider appears in two files, so the search can return hits).

Why this surface wants hooks more than most

AI Logic is stream and session shaped, which is exactly the async state a hook is good at and the raw SDK leaves to the caller:

  • generateContentStream returns an async iterable plus an aggregated response promise. Consuming it in React means accumulating tokens into state, and cancelling the in-flight request when the component unmounts. Neither has an obvious idiom today.
  • ChatSession.sendMessage / sendMessageStream hold conversation history that is naturally component state, currently kept by hand alongside the session object.
  • One-shot generateContent is the trivial case and falls out of the same binding.
What it looks like in practice

Both demo apps in this repository hit it. In the ReactFire recipe demo (#798) the AI page is byte-identical to the plain SDK version, because there is no binding to differ: the page calls the SDK directly, taking the FirebaseApp from useFirebaseApp(). That is a fair outcome rather than a bug, but it is the only page in the comparison where ReactFire has nothing to offer, and a reader notices that the app reaches around the provider tree for one product and through it for the others.

Scope

Out of scope for now: LiveSession and startAudioConversation, which are Public Preview. The connect and teardown lifecycle there is a strong hook candidate and worth revisiting once the API is stable, but filing against a preview surface is premature.

Notes

No existing issue covers this: searches for "AI Logic", "gemini", "vertex" and "genai" in issue titles return nothing across open and closed, with a control search returning results.

Filed at @jhuleatt's request from the 2026-08-24 sync: file AI Logic features that ReactFire does not support as issues so they can be reviewed and prioritized.

主要语言
TypeScript
星标
3.6k
派生
403
平均合并
5 天 1 小时
30 天内合并 PR
10

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

FirebaseExtended/reactfire 的其他 Issue

查看 FirebaseExtended/reactfire 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。