firebase-js-sdk icon indicating copy to clipboard operation
firebase-js-sdk copied to clipboard

AI Hybrid Inference: guard against unstable browser versions

Open erikeldridge opened this issue 6 months ago • 4 comments

Problem Statement

The implementation of the AI APIs can change while the API is stabilizing. This is impossible to guard against using normal feature detection because the feature exists, it just changes behavior.

Solution

Detect known stable versions of the API using the userAgentData API. This API has limited support, but it's simple to use and supported by Chrome and Edge, the two browsers implementing the Chromium AI API, so it's sufficient for now.

erikeldridge avatar Jun 07 '25 00:06 erikeldridge

⚠️ No Changeset found

Latest commit: 90434ab686b7b92247bef3f8c02dc136ae7d0a14

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

changeset-bot[bot] avatar Jun 07 '25 00:06 changeset-bot[bot]

Vertex AI Mock Responses Check :warning:

A newer major version of the mock responses for Vertex AI unit tests is available. update_vertexai_responses.sh should be updated to clone the latest version of the responses: v13.1

github-actions[bot] avatar Jun 07 '25 00:06 github-actions[bot]

Size Report 1

Affected Products

  • @firebase/ai

    TypeBase (dae5fee)Merge (cde0bbb)Diff
    browser49.0 kB49.6 kB+547 B (+1.1%)
    main50.4 kB51.0 kB+547 B (+1.1%)
    module49.0 kB49.6 kB+547 B (+1.1%)
  • firebase

    TypeBase (dae5fee)Merge (cde0bbb)Diff
    firebase-ai.js40.5 kB40.9 kB+420 B (+1.0%)
    firebase-vertexai.js40.5 kB40.9 kB+420 B (+1.0%)

Test Logs

google-oss-bot avatar Jun 07 '25 01:06 google-oss-bot

Size Analysis Report 1

Affected Products

  • @firebase/ai

    • getGenerativeModel

      Size

      TypeBase (dae5fee)Merge (cde0bbb)Diff
      size28.4 kB28.9 kB+434 B (+1.5%)
      size-with-ext-deps49.1 kB49.6 kB+435 B (+0.9%)

Test Logs

google-oss-bot avatar Jun 07 '25 01:06 google-oss-bot