-
Notifications
You must be signed in to change notification settings - Fork 969
Add X-Firebase-AppId
header to VertexAI requests
#8809
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
Changes from 5 commits
1df52ad
7c62bc1
7f14785
767cd77
76f635a
96596b6
e8c97ad
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@firebase/vertexai': patch | ||
--- | ||
|
||
Throw an error when initializing models if `appId` is not defined in the given `VertexAI` instance. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -68,10 +68,18 @@ export abstract class VertexAIModel { | |
VertexAIErrorCode.NO_PROJECT_ID, | ||
`The "projectId" field is empty in the local Firebase config. Firebase VertexAI requires this field to contain a valid project ID.` | ||
); | ||
} else if (!vertexAI.app?.options?.appId) { | ||
throw new VertexAIError( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In light of Paul's comment about There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||
VertexAIErrorCode.NO_APP_ID, | ||
`The "appId" field is empty in the local Firebase config. Firebase VertexAI requires this field to contain a valid app ID.` | ||
); | ||
} else { | ||
this._apiSettings = { | ||
apiKey: vertexAI.app.options.apiKey, | ||
project: vertexAI.app.options.projectId, | ||
appId: vertexAI.app.options.appId, | ||
automaticDataCollectionEnabled: | ||
dlarocque marked this conversation as resolved.
Show resolved
Hide resolved
|
||
vertexAI.app.automaticDataCollectionEnabled, | ||
location: vertexAI.location | ||
}; | ||
|
||
|
Uh oh!
There was an error while loading. Please reload this page.