Skip to content
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

[Vertex AI] Add apiVersion parameter to RequestOptions #8715

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

andrewheard
Copy link

@andrewheard andrewheard commented Jan 20, 2025

WIP - See go/firebase-vertex-set-api-version (Google-internal only) for more details.

Added the ability to specify an API version (e.g., v1 or v1beta) when initializing RequestOptions. This is the JS equivalent of firebase/firebase-ios-sdk#14356.

TODOs:

  • API review and approval
  • Add changeset details

Copy link

changeset-bot bot commented Jan 20, 2025

⚠️ No Changeset found

Latest commit: 7b3d822

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

@@ -42,8 +42,7 @@ export class RequestUrl {
public requestOptions?: RequestOptions
) {}
toString(): string {
// TODO: allow user-set option if that feature becomes available
const apiVersion = DEFAULT_API_VERSION;
const apiVersion = this.requestOptions?.apiVersion || DEFAULT_API_VERSION;
Copy link
Contributor

Choose a reason for hiding this comment

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

I think if we are going to go with the enum, we had better go into constants.ts and assign the new enum to DEFAULT_API_VERSION so we don't have 2 sources of truth for the "v1beta" string (is v1beta the default still or is v1?). Or maybe just get rid of the DEFAULT_API_VERSION in constants.ts since it's not a constant anymore and do the DEFAULT_API_VERSION assignment here in this file.

Copy link
Author

Choose a reason for hiding this comment

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

I think I prefer the plan of getting rid of the DEFAULT_API_VERSION in constants.ts and setting it here.

In this PR the default is still v1beta but the plan is to move to v1 as the default alongside the release of Imagen (requiring devs to switch to v1beta to use it since it'll be Public Preview, not GA).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants