Skip to content

feat(vertexai): Add support for AbortSignal #8890

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

Conversation

dlarocque
Copy link
Contributor

@dlarocque dlarocque commented Apr 2, 2025

Add an AbortSignal to a new SingleRequestOptions that can be passed to all methods that make requests to the backend, allowing them to be aborted.

Fixes #8859

API Proposal: go/vinf-abort-request-api (internal)

Copy link

changeset-bot bot commented Apr 2, 2025

🦋 Changeset detected

Latest commit: 821e580

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
firebase Minor
@firebase/ai Minor

Not sure what this means? Click here to learn what changesets are.

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

Copy link
Contributor

github-actions bot commented Apr 2, 2025

Changeset File Check ⚠️

  • Warning: This PR modifies files in the following packages but they have not been included in the changeset file:%0A - @firebase/auth%0A - @firebase/database%0A - @firebase/firestore%0A - @firebase/functions%0A - @firebase/storage%0A%0A Make sure this was intentional.

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Apr 2, 2025

Size Report 1

Affected Products

  • @firebase/ai

    TypeBase (2fe7547)Merge (519cb51)Diff
    browser42.5 kB43.9 kB+1.40 kB (+3.3%)
    main43.7 kB45.1 kB+1.40 kB (+3.2%)
    module42.5 kB43.9 kB+1.40 kB (+3.3%)
  • @firebase/auth

    TypeBase (2fe7547)Merge (519cb51)Diff
    browser193 kB193 kB-40 B (-0.0%)
    module193 kB193 kB-40 B (-0.0%)
  • @firebase/auth/internal

    TypeBase (2fe7547)Merge (519cb51)Diff
    browser204 kB204 kB-40 B (-0.0%)
    module204 kB204 kB-40 B (-0.0%)
  • @firebase/data-connect

    TypeBase (2fe7547)Merge (519cb51)Diff
    browser21.7 kB21.7 kB+63 B (+0.3%)
    main23.9 kB24.0 kB+47 B (+0.2%)
    module21.7 kB21.7 kB+63 B (+0.3%)
  • @firebase/database

    TypeBase (2fe7547)Merge (519cb51)Diff
    browser250 kB250 kB-77 B (-0.0%)
    main255 kB254 kB-82 B (-0.0%)
    module250 kB250 kB-77 B (-0.0%)
  • @firebase/database-compat

    TypeBase (2fe7547)Merge (519cb51)Diff
    browser18.3 kB18.3 kB+1 B (+0.0%)
    main18.9 kB18.9 kB+1 B (+0.0%)
    module18.3 kB18.3 kB+1 B (+0.0%)
  • @firebase/database-compat/standalone

    TypeBase (2fe7547)Merge (519cb51)Diff
    main367 kB366 kB-82 B (-0.0%)
  • @firebase/firestore

    TypeBase (2fe7547)Merge (519cb51)Diff
    browser385 kB385 kB-65 B (-0.0%)
    main596 kB596 kB-70 B (-0.0%)
    module385 kB385 kB-65 B (-0.0%)
    react-native385 kB385 kB-65 B (-0.0%)
  • @firebase/firestore-lite

    TypeBase (2fe7547)Merge (519cb51)Diff
    browser114 kB114 kB-65 B (-0.1%)
    main157 kB157 kB-70 B (-0.0%)
    module114 kB114 kB-65 B (-0.1%)
    react-native114 kB114 kB-65 B (-0.1%)
  • @firebase/functions

    TypeBase (2fe7547)Merge (519cb51)Diff
    browser14.2 kB14.2 kB-40 B (-0.3%)
    main14.8 kB14.7 kB-45 B (-0.3%)
    module14.2 kB14.2 kB-40 B (-0.3%)
  • @firebase/storage

    TypeBase (2fe7547)Merge (519cb51)Diff
    browser58.5 kB58.5 kB-38 B (-0.1%)
    main60.1 kB60.0 kB-43 B (-0.1%)
    module58.5 kB58.5 kB-38 B (-0.1%)
  • bundle

    34 size changes

    TypeBase (2fe7547)Merge (519cb51)Diff
    auth (GoogleFBTwitterGitHubPopup)109 kB109 kB-21 B (-0.0%)
    database (Append to a list of data)154 kB154 kB-58 B (-0.0%)
    database (Filtering data)153 kB153 kB-58 B (-0.0%)
    database (Listen for child events)170 kB170 kB-58 B (-0.0%)
    database (Listen for value events + Detach listeners)170 kB170 kB-58 B (-0.0%)
    database (Listen for value events)170 kB170 kB-58 B (-0.0%)
    database (Read data once)169 kB169 kB-58 B (-0.0%)
    database (Save data as transactions)172 kB172 kB-58 B (-0.0%)
    database (Sort data)155 kB155 kB-58 B (-0.0%)
    database (Write data)154 kB154 kB-58 B (-0.0%)
    firestore (CSI Auto Indexing Disable and Delete)280 kB279 kB-46 B (-0.0%)
    firestore (CSI Auto Indexing Enable)280 kB279 kB-46 B (-0.0%)
    firestore (Persistence)311 kB311 kB-46 B (-0.0%)
    firestore (Query Cursors)256 kB256 kB-46 B (-0.0%)
    firestore (Query)254 kB254 kB-46 B (-0.0%)
    firestore (Read data once)242 kB242 kB-46 B (-0.0%)
    firestore (Read Write w Persistence)335 kB335 kB-46 B (-0.0%)
    firestore (Realtime updates)244 kB244 kB-46 B (-0.0%)
    firestore (Transaction)221 kB221 kB-46 B (-0.0%)
    firestore (Write data)220 kB220 kB-46 B (-0.0%)
    firestore-lite (Query Cursors)109 kB109 kB-46 B (-0.0%)
    firestore-lite (Query)105 kB105 kB-46 B (-0.0%)
    firestore-lite (Read data once)80.7 kB80.6 kB-46 B (-0.1%)
    firestore-lite (Transaction)106 kB106 kB-46 B (-0.0%)
    firestore-lite (Write data)90.3 kB90.2 kB-46 B (-0.1%)
    functions (call)39.4 kB39.4 kB-21 B (-0.1%)
    storage (getBytes)47.2 kB47.2 kB-19 B (-0.0%)
    storage (getDownloadURL)49.3 kB49.2 kB-19 B (-0.0%)
    storage (getMetadata)48.7 kB48.7 kB-19 B (-0.0%)
    storage (list + listAll)48.1 kB48.1 kB-19 B (-0.0%)
    storage (updateMetadata)49.0 kB49.0 kB-19 B (-0.0%)
    storage (uploadBytes)53.8 kB53.8 kB-19 B (-0.0%)
    storage (uploadBytesResumable)63.8 kB63.8 kB-19 B (-0.0%)
    storage (uploadString)54.0 kB54.0 kB-19 B (-0.0%)

  • firebase

    14 size changes

    TypeBase (2fe7547)Merge (519cb51)Diff
    firebase-ai.js33.8 kB34.5 kB+717 B (+2.1%)
    firebase-auth-cordova.js142 kB142 kB+1 B (+0.0%)
    firebase-auth-web-extension.js125 kB125 kB+1 B (+0.0%)
    firebase-auth.js163 kB163 kB-30 B (-0.0%)
    firebase-compat.js802 kB802 kB-105 B (-0.0%)
    firebase-data-connect.js18.2 kB22.7 kB+4.46 kB (+24.5%)
    firebase-database-compat.js168 kB168 kB-57 B (-0.0%)
    firebase-database.js192 kB192 kB-77 B (-0.0%)
    firebase-firestore-compat.js347 kB347 kB-46 B (-0.0%)
    firebase-firestore-lite.js137 kB137 kB-65 B (-0.0%)
    firebase-firestore.js449 kB449 kB-65 B (-0.0%)
    firebase-functions.js19.5 kB19.5 kB-37 B (-0.2%)
    firebase-storage.js51.2 kB51.1 kB-35 B (-0.1%)
    firebase-vertexai.js33.8 kB34.5 kB+717 B (+2.1%)

Test Logs

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/ALurpkQzbE.html

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Apr 2, 2025

Size Analysis Report 1

This report is too large (226,497 characters) to be displayed here in a GitHub comment. Please use the below link to see the full report on Google Cloud Storage.

Test Logs

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/8loqORhE2L.html

Copy link
Contributor

github-actions bot commented Apr 2, 2025

Vertex AI Mock Responses Check ⚠️

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: v8.0

@dlarocque dlarocque marked this pull request as ready for review May 12, 2025 17:05
@dlarocque dlarocque requested review from a team as code owners May 12, 2025 17:05
Copy link
Contributor

@DellaBitta DellaBitta 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, but won't approve until council review.


If provided, calling `abort()` on the corresponding `AbortController` will attempt to cancel the underlying HTTP request. An `AbortError` will be thrown if cancellation is successful.

Note that this will not cancel the request in the backend, so billing will still be applied despite cancellation.
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

Copy link
Contributor

@hsubox76 hsubox76 left a comment

Choose a reason for hiding this comment

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

Approved, pending merge of #9011 where you'll have to update the changeset and regenerate docs and the api.md.

* Revert "Fixed scroll behavior (#9043)"

This reverts commit 9bcd1ea.

* Revert "Add Emulator Overlay (#8977) (#9031)"

This reverts commit 8593fa0.

* Undid revert of util

* Create dirty-crews-cross.md

* Removed unnecessary markdown file
@dlarocque dlarocque requested a review from rachelsaunders May 22, 2025 15:11
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.

FR: Support AbortSignal in generateContent() for firebase/vertexai
5 participants