diff --git a/js/ai/tests/model/middleware_test.ts b/js/ai/tests/model/middleware_test.ts index ab1c9664da..cebb68eb59 100644 --- a/js/ai/tests/model/middleware_test.ts +++ b/js/ai/tests/model/middleware_test.ts @@ -18,16 +18,16 @@ import assert from 'node:assert'; import { beforeEach, describe, it } from 'node:test'; import { DocumentData } from '../../src/document.js'; import { - defineModel, GenerateRequest, GenerateResponseData, MessageData, Part, + defineModel, } from '../../src/model.js'; import { - augmentWithContext, AugmentWithContextOptions, CONTEXT_PREFACE, + augmentWithContext, simulateSystemPrompt, validateSupport, } from '../../src/model/middleware.js'; diff --git a/js/plugins/vertexai/src/index.ts b/js/plugins/vertexai/src/index.ts index 48964bdb5d..1cf3889d55 100644 --- a/js/plugins/vertexai/src/index.ts +++ b/js/plugins/vertexai/src/index.ts @@ -90,13 +90,18 @@ export interface PluginOptions { modelGardenModels?: ModelReference[]; } +const CLOUD_PLATFROM_OAUTH_SCOPE = + 'https://www.googleapis.com/auth/cloud-platform'; + /** * Add Google Cloud Vertex AI to Genkit. Includes Gemini and Imagen models and text embedder. */ export const vertexAI: Plugin<[PluginOptions] | []> = genkitPlugin( 'vertexai', async (options?: PluginOptions) => { - const authClient = new GoogleAuth(options?.googleAuth); + const authClient = new GoogleAuth( + options?.googleAuth ?? { scopes: [CLOUD_PLATFROM_OAUTH_SCOPE] } + ); const projectId = options?.projectId || (await authClient.getProjectId()); const location = options?.location || 'us-central1';