-
Notifications
You must be signed in to change notification settings - Fork 4k
feat: create new Vertex AI for Firebase plugin. #12728
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
Conversation
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.
Thank you for the PR, @cynthiajoan
A few things to note:
I am aware that the timeline is quite short so I've made some suggestions. I think that this being a dev release gives us more flexibility with future changes, and it might be worth pointing out that the API could change in the future.
For instance, I'm not sure we should have a dependency on App Check as it forces the user to have it + app check plugin initialisation, particularly as we're only interested in the token. There are ways around this issue that would require some internal changes and we can think about that before making it general release.
There are a number of private methods that don't appear to be used but I'm guessing they're for future releases. In any event, they can also be removed in a future release.
I don't think the plugin needs to extend the FirebasePluginPlatform but this will cause issue with the mock tests so it can be left and removed at a later time if we wish.
packages/firebase_vertexai/firebase_vertexai/lib/firebase_vertexai.dart
Outdated
Show resolved
Hide resolved
packages/firebase_vertexai/firebase_vertexai/lib/src/firebase_vertexai.dart
Show resolved
Hide resolved
packages/firebase_vertexai/firebase_vertexai/lib/src/vertex_chat.dart
Outdated
Show resolved
Hide resolved
packages/firebase_vertexai/firebase_vertexai/lib/src/vertex_chat.dart
Outdated
Show resolved
Hide resolved
packages/firebase_vertexai/firebase_vertexai/lib/src/vertex_model.dart
Outdated
Show resolved
Hide resolved
packages/firebase_vertexai/firebase_vertexai/test/vertex_mock.dart
Outdated
Show resolved
Hide resolved
packages/firebase_vertexai/firebase_vertexai/test/vertex_mock.dart
Outdated
Show resolved
Hide resolved
packages/firebase_vertexai/firebase_vertexai/lib/src/vertex_content.dart
Show resolved
Hide resolved
Thanks Russell. I agree with the app check part, I will point out the sdk is in preview status and apis might be changing. |
packages/firebase_vertexai/firebase_vertexai/example/analysis_options.yaml
Outdated
Show resolved
Hide resolved
More on the app_check part, we can probably remove the changes made to the example App Check app, so we don't get a weird changelog for app check on the next release. |
removed! Thanks for the review |
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 think tests are failing because of the name
packages/firebase_vertexai/firebase_vertexai/example/pubspec.yaml
Outdated
Show resolved
Hide resolved
Co-authored-by: Russell Wheatley <[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.
CI failures are unrelated 👍
@@ -0,0 +1,16 @@ | |||
# firebase_vertexai_example | |||
|
|||
A new Flutter project. |
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.
[nit] Update the file with specifics, or consider removing it if it's not useful.
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
library firebase_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.
[nit] If we don't have a library level doc comment or annotation, we can omit the library
line.
We can use URIs for the part of
lines.
At some point it would be worth considering a refactor to stop using part
and part of
, but that can happen out of band.
show FirebasePluginPlatform; | ||
import 'package:google_generative_ai/google_generative_ai.dart' as google_ai; | ||
// ignore: implementation_imports, tightly coupled packages | ||
import 'package:google_generative_ai/src/model.dart' as google_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.
Consider updating this import to src/vertex_hooks.dart
. We export the model creating method there now so you can import all of the vertex customizations from one place.
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
part of firebase_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.
part of '../firebase_vertexai.dart';
const _defaultLocation = 'us-central1'; | ||
|
||
/// Default timeout duration, 30 minutes in millisecond | ||
const int defaultTimeout = 1800000; |
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.
Is this intentionally public?
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.
It is not. However it's referenced in the test file, and I'm still learning how to access private attributes in test folder
Description
Add firebase_vertexai plugin. This plugin will provide flutter developer to have access to Vertex AI service. More details in README.md of the package.
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.///
).melos run analyze
) does not report any problems on my PR.Breaking Change
Does your PR require plugin users to manually update their apps to accommodate your change?