Skip to content

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

Open
wants to merge 2 commits into
base: vertexai/developer_api
Choose a base branch
from

Conversation

natebosch
Copy link
Contributor

@natebosch natebosch commented May 5, 2025

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.

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.
@natebosch natebosch requested a review from cynthiajoan May 5, 2025 20:35
@natebosch natebosch changed the base branch from main to vertexai/developer_api May 5, 2025 20:35
@natebosch natebosch changed the title vertexai/package rename Add a new package firebase_ai May 5, 2025
@natebosch natebosch changed the title Add a new package firebase_ai [feat] Add a new package firebase_ai May 5, 2025
@natebosch natebosch changed the title [feat] Add a new package firebase_ai feat(vertexai): Add a new package firebase_ai May 5, 2025
@natebosch
Copy link
Contributor Author

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 FirebaseVertexAI* or VertexAI* to FirebaseAI*. Some URLs to help docs are not changed here and may need to be updated in coordination with the doc hosting.

@natebosch
Copy link
Contributor Author

We may need some CI config changes.

String? location,
}) {
app ??= Firebase.app();

Copy link
Collaborator

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';

See here: https://github.com/firebase/flutterfire/pull/17319/files#diff-edacf0f74d51415959b1f96ed817e5a7cc222da1b27d3fd5904776f21a62815b

Copy link
Collaborator

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),
Copy link
Collaborator

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,
Copy link
Collaborator

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?

Copy link
Collaborator

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?

@cynthiajoan
Copy link
Collaborator

We may need some CI config changes.

Yeah would need to add the new package to melos config.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants