-
Notifications
You must be signed in to change notification settings - Fork 2.3k
feat(firebase-ai): create ai
package, vertexai
wraps around it
#8555
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
ai
package, vertexai
to wrap around itai
package, vertexai
wraps around it
Looking into this one now for review - noticed Other tests were failing because TextEncoder implementation seems to be missing and is needed ? Unexpected as it seems that should have been failing for a while if so, but...okay rebased to main and put an in situ implementation of the string -> uint8array conversion in the storage library and it passes locally, hopefully this goes green in CI - will finish the review later |
Co-authored-by: Darren Ackers <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ Looks like all old comments are resolved
✅ LGTM and runs locally okay except windows and one comment nit
The windows thing has bothered me for a while - I made sure the repo was windows-capable for development a long time back and we have received some PRs from folks that only have access to windows machines - more common than you might think!
❓ Rather than moan about it and keep wishing, I ported the AI mock responses script to typescript and verified it works on windows and macOS now ✅ - added a commit there as well as a couple unit test plugin fixups for windows compliance
❓ I left one teeny tiny note on the param comment to a function - initializeApp - now that it has a new signature I think the comment needs an update
That - the update to the comment - is the only thing I can think of
If that's updated (could just commit the suggestion if it works?) and you like the AI test data git clone port, this is good to go for me
Co-authored-by: Mike Hardy <[email protected]>
The new Firebase AI Logic SDK provides **preview** support for the Gemini Developer API, including its free tier offering. | ||
Using the Firebase AI Logic SDK with the Vertex AI Gemini API is still generally available (GA). | ||
|
||
To start using the new SDK, import the `@react-native-firebase/ai` package and use the modular method `getAI()` to initialize. See details in the [migration guide](https://firebase.google.com/docs/vertex-ai/migrate-to-latest-sdk). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the in general changelog. The only thing I think we would like to add, since RN is not listed in the official migration guide doc, we probably want to actually have the code change example here.
@@ -0,0 +1,112 @@ | |||
/** | |||
* @license | |||
* Copyright 2024 Google LLC |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Copyright 2024 Google LLC | |
* Copyright 2025 Google LLC |
@@ -0,0 +1,55 @@ | |||
/** | |||
* @license | |||
* Copyright 2024 Google LLC |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Copyright 2024 Google LLC | |
* Copyright 2025 Google LLC |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we also want to add GoogleAI backend test cases as well?
@@ -0,0 +1,167 @@ | |||
/** | |||
* @license | |||
* Copyright 2024 Google LLC |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Copyright 2024 Google LLC | |
* Copyright 2025 Google LLC |
|
||
it('total tokens with modality details', async () => { | ||
const mockResponse = getMockResponse( | ||
BackendName.VertexAI, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for my education, we are having the fakeAPI backend set to googleAI, but in the getMockResponse we pass the backend as VertexAI, is that going to have any issue?
@@ -0,0 +1,365 @@ | |||
/** | |||
* @license | |||
* Copyright 2024 Google LLC |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Copyright 2024 Google LLC | |
* Copyright 2025 Google LLC |
@@ -0,0 +1,92 @@ | |||
/** | |||
* @license | |||
* Copyright 2024 Google LLC |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Copyright 2024 Google LLC | |
* Copyright 2025 Google LLC |
@@ -0,0 +1,125 @@ | |||
import { ApiSettings } from '../types/internal'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
License header?
@@ -0,0 +1,2 @@ | |||
export * from './ai-model'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just wondering, do we need license header for index.ts?
@@ -0,0 +1,137 @@ | |||
/** | |||
* @license | |||
* Copyright 2024 Google LLC |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Copyright 2024 Google LLC | |
* Copyright 2025 Google LLC |
Description
ai
package. Kept relevant types invertexai
package and deprecated them.firebase-js-sdk
.vertexai
andgoogleai
.dist/
so opted to makeai
package a dependency which I think is a better way of doing it.ai
example app for illustration and tested latestvertexai
andai
implementations which surfaced a couple of subtle bugs that have been resolved.Important
vertexai
for this pull request.Related issues
Release Summary
Checklist
Android
iOS
Other
(macOS, web)e2e
tests added or updated inpackages/\*\*/e2e
jest
tests added or updated inpackages/\*\*/__tests__
Test Plan
Think
react-native-firebase
is great? Please consider supporting the project with any of the below:React Native Firebase
andInvertase
on Twitter