这是indexloc提供的服务,不要输入任何密码
Skip to content

fix(firebase_vertexai): add missing HarmBlockThreshold to exported APIs #17249

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

Merged
merged 3 commits into from
Apr 4, 2025
Merged

fix(firebase_vertexai): add missing HarmBlockThreshold to exported APIs #17249

merged 3 commits into from
Apr 4, 2025

Conversation

rusudinu
Copy link
Contributor

@rusudinu rusudinu commented Apr 1, 2025

Description

The HarmBlockThreshold added in version 1.5.0 of firebase_vertexai is missing from the exported APIs. This PR adds it to the list.

This PR fixes the following scenario in which, I want to use HarmBlockMethod.probability like this:
SafetySetting(HarmCategory.hateSpeech, HarmBlockThreshold.high, HarmBlockMethod.probability),
and being unable to only with the following import:
import 'package:firebase_vertexai/firebase_vertexai.dart'; and I would need to also add
import 'package:firebase_vertexai/src/api.dart'; which would be an anti-pattern.

TLDR: HarmCategory and HarmBlockThreshold were already present, HarmBlockMethod was missing and this PR adds it to the exports list.

Related Issues

Fixes #17253

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.

@rusudinu rusudinu changed the title fix(firebase_vertexai) Add missing HarmBlockThreshold to exported apis fix(firebase_vertexai): add missing HarmBlockThreshold to exported APIs Apr 1, 2025
@rusudinu
Copy link
Contributor Author

rusudinu commented Apr 3, 2025

pushed another commit to remove the api.dart import for the chat_test and model_test

@MichaelVerdon MichaelVerdon self-requested a review April 3, 2025 16:39
Copy link
Contributor

@MichaelVerdon MichaelVerdon left a comment

Choose a reason for hiding this comment

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

Looks good to me. Tried it out locally.

@cynthiajoan cynthiajoan merged commit 59d902c into firebase:main Apr 4, 2025
28 of 36 checks passed
@firebase firebase locked and limited conversation to collaborators Jul 18, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[vertexai]: Missing HarmBlockMethod class
3 participants