Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

No bindings for Firebase AI Logic

Aperta
#801 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
38/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
firebase, react, typescript
Ambito
ai, frontend

Direzione di ricerca

Inizia dalle dichiarazioni di provider, hook e initializer in src/sdk.tsx, quindi confronta la demo della ricetta ReactFire di #798 con il suo utilizzo diretto di Firebase AI Logic. Esamina i riferimenti esistenti a FirebaseAppProvider e la superficie di @firebase/ai descritta nell’issue. Il lavoro è completo quando è disponibile un binding verificato per i casi stabili generateContent, generateContentStream e ChatSession, lasciando LiveSession e startAudioConversation fuori dall’ambito.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
TypeScript
Stelle
3.6k
Fork
403
Merge medio
5g 1h
PR unite (30g)
10

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di FirebaseExtended/reactfire

Tutte le issue di FirebaseExtended/reactfire

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.