Skip to content

feat(firebaseai): Developer API #17342

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 13 commits into
base: main
Choose a base branch
from
Open

Conversation

cynthiajoan
Copy link
Collaborator

Description

Replace this paragraph with a description of what this PR is doing. If you're modifying existing behavior, describe the existing behavior, how this PR is changing it, and what motivated the change.

Related Issues

Replace this paragraph with a list of issues related to this PR from the issue database. Indicate, which of these issues are resolved or fixed by this PR. Note that you'll have to prefix the issue numbers with flutter/flutter#.

Checklist

Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]).
This will ensure a smooth and quick review process. Updating the pubspec.yaml and changelogs is not required.

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • My PR includes unit or integration tests for all changed/updated/fixed behaviors (See Contributor Guide).
  • All existing and new tests are passing.
  • I updated/added relevant documentation (doc comments with ///).
  • The analyzer (melos run analyze) does not report any problems on my PR.
  • I read and followed the Flutter Style Guide.
  • I signed the CLA.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Does your PR require plugin users to manually update their apps to accommodate your change?

  • Yes, this is a breaking change.
  • No, this is not a breaking change.

natebosch and others added 8 commits April 28, 2025 16:26
Move parsing from top level methods, and serialization from a method on
the model,into instance methods on a new `SerializationStrategy` class.
Use the existing parsing code for the vertex strategy and copy over code
form the developer SDK for the Google AI strategy.

Add a `_ModelUri` class to allow a vertex and developer specialization
for the different backends.

Copy the serialization and parsing tests from the developer SDK, skip a
few tests that rely on arguments or methods that are unsupported in the
vertex model. Tests skipped for content embedding and extra arguments
passed to countTokens.
* Add a new package firebase_ai

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.

* Move to new directory

* Add ::vertexai and ::googlai instance key suffixes

* Use ovrride and new SpeaechConfig API

* Remove export of TaskType

* Remove duplicate testing of the base model

* Use 2.0.0 as initial version

* Reformat

* Add a failing test - check if CI is already running

* Remove failing test

CI is confirmed running for this package.

* Add a copy of the analysis options in the new parent directory

* Revert to latest version of example app

Minor code changes for the interface change.

* Restore the same example app in both packages

Minor code changes in the _vertexai example app for the interface
differences

---------

Co-authored-by: Cynthia J <cynthiajoan@users.noreply.github.com>
* chore(ci): bump macos-14 to macos-15 (#17311)

* feat(cloud_functions): add support for cloud functions stream (#17214)

* chore: add platform interface and method channel implementation for Cloud Functions stream

* chore: add `httpsCallableStreamFromUrl` and `httpsStreamCallableWithUri`

* chore: resolve comments

* chore: add Android implementation for Cloud Functions stream

* chore: resolve formatting issues

* chore: correct variable name

* chore: add support for Cloud Functions Stream(Android)

* chore: create dedicated StreamHandler class

* chore: add streamhandler implementation for ios

* chore: add iOS implementation for Cloud Functions stream

* chore: add license header to stream handler files

* chore: web Cloud Functions stream wip

* chore: push all

* chore: update functions based on API Doc modification

* chore: clean up code

* chore: add web package

* chore: add streaming example

* chore: fix ci issues

* chore: fix ci

* chore: fix cloud function test

* chore: add missing doc

* chore: fixes and  clean up

* chore: add e2e for Cloud Functions Stream

* chore: fix formatting issue

* chore: add more tests and fix timeout for Android

* chore: add test for map and list

* chore: fix test

* chore: update year to 2025 in files

* chore(web): add support for abort signal

* chore: resolve comments and add test for Abort

* chore: fix test

* chore: fix test

* chore: update copyright year

* chore: print error to console

* chore(release): publish packages (#17314)

* chore(release): publish packages

 - cloud_firestore@5.6.7
 - cloud_firestore_platform_interface@6.6.7
 - cloud_functions@5.5.0
 - cloud_functions_platform_interface@5.7.0
 - cloud_functions_web@4.11.0
 - firebase_auth@5.5.3
 - firebase_vertexai@1.6.0
 - cloud_firestore_web@4.4.7
 - firebase_data_connect@0.1.4+1

* chore: BoM Version 3.10.0

* constants

* fix(auth,apple): prevent EXC_BAD_ACCESS crash in Apple Sign-In completion handler (#17273)

- Locally captures completion handler to prevent deallocation
- Fixes crash during async Apple Sign-In operations

* chore(docs): Update Extension Helper Docs (#17327)

* feat(vertexai): Add HarmBlockThreshold.OFF (#17325)

* Add HarmBlockThreshold.OFF. Add unit test for api. Fix the schema output json.

* fix a nit

* feat(fdc): Included platform detection changes (#17308)

* feat(vertexai): Add responseModality (#17326)

* Add responseModality

* review comments

* handle omit tokenCount nicely (#17336)

* Add new attributes for schema (#17340)

* tweak after merge main

* fix analyzer for vertexai/api_test.dart

* remove dependency_overrides in pubspec.yaml

---------

Co-authored-by: MichaelV00 <106483404+MichaelVerdon@users.noreply.github.com>
Co-authored-by: Jude Selase Kwashie <64037520+SelaseKay@users.noreply.github.com>
Co-authored-by: Guillaume Bernos <guillaume@bernos.dev>
Co-authored-by: Luke Memet <1598289+lukemmtt@users.noreply.github.com>
Co-authored-by: Maneesh Tewani <maneesht@users.noreply.github.com>
@cynthiajoan cynthiajoan marked this pull request as ready for review May 8, 2025 19:18
Comment on lines +5 to +10
include: ../../../../analysis_options.yaml
linter:
rules:
avoid_print: false
depend_on_referenced_packages: false
library_private_types_in_public_api: false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we have this, we can remove the firebase_ai/analysis_options.yaml

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you be more specific? I'm trying to following the pattern in other plugins and might missed something.

<key>CFBundleExecutable</key>
<string>App</string>
<key>CFBundleIdentifier</key>
<string>io.flutter.flutter.app</string>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can customize bundle identifier

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't find other package iOS example customized this field, is this a recent change?

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.

3 participants