-
Notifications
You must be signed in to change notification settings - Fork 4k
feat(vertexai): Add a new package firebase_ai #17332
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: vertexai/developer_api
Are you sure you want to change the base?
feat(vertexai): Add a new package firebase_ai #17332
Conversation
Copy all the code from firebase_vertexai and rename with "Vertex" removed or replaced with "Firebase". Make firebase_vertexai an export package, retaining only the FirebaseVertexAI implementation and adding `typedef` aliases for 2 renamed exception types. Replace the rest with exports from `package:firebase_ai`. Revert the examples changes to use googleAI - the example in the `firebase_ai` package will show both while the old example shows only the usage of vertex.. Import from src across the packages to keep existing tests as close to identical as possible despite doubling up test cases with the upstream package.
If you'd prefer to review and land any parts of this as separate commits I'm happy to split it up. Most of the LOC here are copy/paste (and lots of boilerplate for the flutter stuff) but there is no way to indicate a file rename in git so the review will show everything as new. For the most part this reflects a global rename from |
We may need some CI config changes. |
String? location, | ||
}) { | ||
app ??= Firebase.app(); | ||
|
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.
would need to apply the fix of var instanceKey = '${app.name}::googleai';
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.
the example app in firebase_vertexai seems a few versions behind. Any reason they cannot be same as the example app in firebase_ai?
@@ -59,7 +59,7 @@ class _BidiPageState extends State<BidiPage> { | |||
super.initState(); | |||
|
|||
final config = LiveGenerationConfig( | |||
speechConfig: SpeechConfig(voiceName: 'Fenrir'), | |||
speechConfig: SpeechConfig(voice: Voice.fenrir), |
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.
This needs to keep as the left one. The api has changed for bidi feature.
export 'src/chat.dart' show ChatSession, StartChatExtension; | ||
export 'src/content.dart' | ||
show | ||
UsageMetadata, |
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 was planning to remove this field, since there's no use case for developer to instantiate the UsageMetadata. Do you think it's a good time for this change?
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 still need to keep this test package?
Yeah would need to add the new package to melos config. |
Copy all the code from firebase_vertexai and rename with "Vertex"
removed or replaced with "Firebase".
Make firebase_vertexai an export package, retaining only the
FirebaseVertexAI implementation and adding
typedef
aliases for 2renamed exception types. Replace the rest with exports from
package:firebase_ai
.Revert the examples changes to use googleAI - the example in the
firebase_ai
package will show both while the old example shows onlythe usage of vertex..
Import from src across the packages to keep existing tests as close to
identical as possible despite doubling up test cases with the upstream
package.