@sweetoburrito/backstage-plugin-ai-assistant-backend-module-model-provider-google-vertex-ai 0.0.0-snapshot-20251029150521

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,54 @@
1
+ # @sweetoburrito/backstage-plugin-ai-assistant-backend-module-model-provider-google-vertex-ai
2
+
3
+ The model-provider-google-vertex-ai backend module for the Backstage AI Assistant plugin.
4
+
5
+ This module lets the AI Assistant backend call Google-hosted (GCP) Vertex AI models through a configuration-driven provider so the rest of the plugin remains model-agnostic.
6
+
7
+ ## Features
8
+
9
+ - Connects Backstage AI Assistant to GCP-hosted Vertex AI LLM models (Vertex AI Studio).
10
+ - Configuration via Backstage `app-config.yaml` and environment variables.
11
+
12
+ ## When to use
13
+
14
+ Use this module when you want the AI Assistant backend to use models hosted in GCP Vertex AI (for example: Gemini-family models
15
+ deployed in Google Vertex AI Studio) in the Backstage AI assistant.
16
+
17
+ ## Configuration
18
+
19
+ Add the provider configuration in your `app-config.local`.
20
+
21
+ ```yaml
22
+ aiAssistant:
23
+ models:
24
+ googleVertexAi:
25
+ apiKey: ${VERTEX-AI-API-KEY}
26
+ models:
27
+ - 'gemini-2.5-flash-lite'
28
+ ```
29
+
30
+ ## Install
31
+
32
+ Install the plugin into your backstage backend with the following command
33
+
34
+ ```sh
35
+ yarn workspace backend add @sweetoburrito/backstage-plugin-ai-assistant-backend-module-model-provider-google-vertex-ai
36
+ ```
37
+
38
+ Add it to your backend
39
+
40
+ ```diff
41
+ // packages/backend/src/index.ts
42
+
43
+ backend.add(import('@backstage/plugin-events-backend'));
44
+ backend.add(import('@backstage/plugin-signals-backend'));
45
+
46
+ backend.add(import('@sweetoburrito/backstage-plugin-ai-assistant-backend'));
47
+
48
+ ++backend.add(
49
+ ++ import(
50
+ ++ '@sweetoburrito/backstage-plugin-ai-assistant-backend-module-model-provider-google-vertex-ai'
51
+ ++ ),
52
+ ++);
53
+
54
+ ```
package/config.d.ts ADDED
@@ -0,0 +1,13 @@
1
+ export interface Config {
2
+ aiAssistant: {
3
+ models: {
4
+ googleVertexAi: {
5
+ /**
6
+ * @visibility secret
7
+ */
8
+ apiKey: string;
9
+ models: string[];
10
+ };
11
+ };
12
+ };
13
+ }
@@ -0,0 +1,10 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var module$1 = require('./module.cjs.js');
6
+
7
+
8
+
9
+ exports.default = module$1.aiAssistantModuleModelProviderGoogleVertexAi;
10
+ //# sourceMappingURL=index.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
@@ -0,0 +1,5 @@
1
+ import * as _backstage_backend_plugin_api from '@backstage/backend-plugin-api';
2
+
3
+ declare const aiAssistantModuleModelProviderGoogleVertexAi: _backstage_backend_plugin_api.BackendFeature;
4
+
5
+ export { aiAssistantModuleModelProviderGoogleVertexAi as default };
@@ -0,0 +1,40 @@
1
+ 'use strict';
2
+
3
+ var backendPluginApi = require('@backstage/backend-plugin-api');
4
+ var backstagePluginAiAssistantNode = require('@sweetoburrito/backstage-plugin-ai-assistant-node');
5
+ var googleVertexai = require('@langchain/google-vertexai');
6
+
7
+ const aiAssistantModuleModelProviderGoogleVertexAi = backendPluginApi.createBackendModule(
8
+ {
9
+ pluginId: "ai-assistant",
10
+ moduleId: "model-provider-google-vertex-ai",
11
+ register(reg) {
12
+ reg.registerInit({
13
+ deps: {
14
+ config: backendPluginApi.coreServices.rootConfig,
15
+ modelProvider: backstagePluginAiAssistantNode.modelProviderExtensionPoint
16
+ },
17
+ async init({ config, modelProvider }) {
18
+ const vertexAiConfig = config.getConfig(
19
+ "aiAssistant.models.googleVertexAi"
20
+ );
21
+ const apiKey = vertexAiConfig.getString("apiKey");
22
+ const modelIds = vertexAiConfig.getStringArray("models");
23
+ const models = modelIds.map((modelId) => {
24
+ return {
25
+ id: modelId,
26
+ chatModel: new googleVertexai.ChatVertexAI({
27
+ model: modelId,
28
+ apiKey
29
+ })
30
+ };
31
+ });
32
+ models.forEach((model) => modelProvider.register(model));
33
+ }
34
+ });
35
+ }
36
+ }
37
+ );
38
+
39
+ exports.aiAssistantModuleModelProviderGoogleVertexAi = aiAssistantModuleModelProviderGoogleVertexAi;
40
+ //# sourceMappingURL=module.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module.cjs.js","sources":["../src/module.ts"],"sourcesContent":["import {\n coreServices,\n createBackendModule,\n} from '@backstage/backend-plugin-api';\nimport {\n Model,\n modelProviderExtensionPoint,\n} from '@sweetoburrito/backstage-plugin-ai-assistant-node';\nimport { ChatVertexAI } from '@langchain/google-vertexai';\n\nexport const aiAssistantModuleModelProviderGoogleVertexAi = createBackendModule(\n {\n pluginId: 'ai-assistant',\n moduleId: 'model-provider-google-vertex-ai',\n register(reg) {\n reg.registerInit({\n deps: {\n config: coreServices.rootConfig,\n modelProvider: modelProviderExtensionPoint,\n },\n async init({ config, modelProvider }) {\n const vertexAiConfig = config.getConfig(\n 'aiAssistant.models.googleVertexAi',\n );\n\n const apiKey = vertexAiConfig.getString('apiKey');\n const modelIds = vertexAiConfig.getStringArray('models');\n\n const models: Model[] = modelIds.map(modelId => {\n return {\n id: modelId,\n chatModel: new ChatVertexAI({\n model: modelId,\n apiKey: apiKey,\n }),\n };\n });\n\n models.forEach(model => modelProvider.register(model));\n },\n });\n },\n },\n);\n"],"names":["createBackendModule","coreServices","modelProviderExtensionPoint","ChatVertexAI"],"mappings":";;;;;;AAUO,MAAM,4CAAA,GAA+CA,oCAAA;AAAA,EAC1D;AAAA,IACE,QAAA,EAAU,cAAA;AAAA,IACV,QAAA,EAAU,iCAAA;AAAA,IACV,SAAS,GAAA,EAAK;AACZ,MAAA,GAAA,CAAI,YAAA,CAAa;AAAA,QACf,IAAA,EAAM;AAAA,UACJ,QAAQC,6BAAA,CAAa,UAAA;AAAA,UACrB,aAAA,EAAeC;AAAA,SACjB;AAAA,QACA,MAAM,IAAA,CAAK,EAAE,MAAA,EAAQ,eAAc,EAAG;AACpC,UAAA,MAAM,iBAAiB,MAAA,CAAO,SAAA;AAAA,YAC5B;AAAA,WACF;AAEA,UAAA,MAAM,MAAA,GAAS,cAAA,CAAe,SAAA,CAAU,QAAQ,CAAA;AAChD,UAAA,MAAM,QAAA,GAAW,cAAA,CAAe,cAAA,CAAe,QAAQ,CAAA;AAEvD,UAAA,MAAM,MAAA,GAAkB,QAAA,CAAS,GAAA,CAAI,CAAA,OAAA,KAAW;AAC9C,YAAA,OAAO;AAAA,cACL,EAAA,EAAI,OAAA;AAAA,cACJ,SAAA,EAAW,IAAIC,2BAAA,CAAa;AAAA,gBAC1B,KAAA,EAAO,OAAA;AAAA,gBACP;AAAA,eACD;AAAA,aACH;AAAA,UACF,CAAC,CAAA;AAED,UAAA,MAAA,CAAO,OAAA,CAAQ,CAAA,KAAA,KAAS,aAAA,CAAc,QAAA,CAAS,KAAK,CAAC,CAAA;AAAA,QACvD;AAAA,OACD,CAAA;AAAA,IACH;AAAA;AAEJ;;;;"}
package/package.json ADDED
@@ -0,0 +1,51 @@
1
+ {
2
+ "name": "@sweetoburrito/backstage-plugin-ai-assistant-backend-module-model-provider-google-vertex-ai",
3
+ "version": "0.0.0-snapshot-20251029150521",
4
+ "license": "Apache-2.0",
5
+ "description": "The model-provider-google-vertex-ai backend module for the ai-assistant plugin.",
6
+ "main": "dist/index.cjs.js",
7
+ "types": "dist/index.d.ts",
8
+ "publishConfig": {
9
+ "access": "public",
10
+ "main": "dist/index.cjs.js",
11
+ "types": "dist/index.d.ts"
12
+ },
13
+ "backstage": {
14
+ "role": "backend-plugin-module",
15
+ "pluginId": "ai-assistant",
16
+ "pluginPackage": "@sweetoburrito/backstage-plugin-ai-assistant-backend",
17
+ "features": {
18
+ ".": "@backstage/BackendFeature"
19
+ }
20
+ },
21
+ "scripts": {
22
+ "start": "backstage-cli package start",
23
+ "build": "backstage-cli package build",
24
+ "lint": "backstage-cli package lint",
25
+ "test": "backstage-cli package test",
26
+ "clean": "backstage-cli package clean",
27
+ "prepack": "backstage-cli package prepack",
28
+ "postpack": "backstage-cli package postpack"
29
+ },
30
+ "dependencies": {
31
+ "@backstage/backend-plugin-api": "^1.4.3",
32
+ "@langchain/google-vertexai": "^0.2.18",
33
+ "@sweetoburrito/backstage-plugin-ai-assistant-node": "0.0.0-snapshot-20251029150521"
34
+ },
35
+ "devDependencies": {
36
+ "@backstage/backend-test-utils": "^1.9.0",
37
+ "@backstage/cli": "^0.34.3"
38
+ },
39
+ "configSchema": "config.d.ts",
40
+ "files": [
41
+ "dist",
42
+ "config.d.ts"
43
+ ],
44
+ "typesVersions": {
45
+ "*": {
46
+ "package.json": [
47
+ "package.json"
48
+ ]
49
+ }
50
+ }
51
+ }