@sweetoburrito/backstage-plugin-ai-assistant-backend-module-embeddings-provider-azure-open-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,80 @@
1
+ # @sweetoburrito/backstage-plugin-ai-assistant-backend-module-embeddings-provider-azure-open-ai
2
+
3
+ An embeddings provider module that lets the Backstage AI Assistant backend create vector embeddings
4
+ using Azure-hosted embedding models (Azure OpenAI / Azure AI Foundry).
5
+
6
+ This README explains how the provider works, when to use it, configuration options, and how to wire
7
+ it into your Backstage backend.
8
+
9
+ ## Features
10
+
11
+ - Convert text or documents to numeric vector embeddings using Azure OpenAI / Azure AI Foundry
12
+ embedding deployments.
13
+ - Exposes a provider implementation compatible with the AI Assistant backend so different
14
+ embeddings services can be swapped without changing the rest of the app.
15
+ - Handles basic batching and optional configuration for deployment name / endpoint selection.
16
+
17
+ ## When to use
18
+
19
+ Use this module if you run Azure-hosted embedding models and want the AI Assistant to build
20
+ semantic search indices, vector stores, or provide retrieval-augmented generation (RAG)
21
+ capabilities in Backstage.
22
+
23
+ ## Configuration
24
+
25
+ Add the provider configuration to your Backstage `app-config.yaml` or `app-config.local.yaml` under
26
+ `aiAssistant.embeddings.azureOpenAI`.
27
+
28
+ Minimum configuration keys (example):
29
+
30
+ ```yaml
31
+ aiAssistant:
32
+ embeddings:
33
+ azureOpenAI:
34
+ endpoint: 'https://eastus.api.cognitive.microsoft.com/openai/deployments/text-embedding-3-large/embeddings?api-version=2023-05-15'
35
+ openAIApiVersion: 2024-12-01-preview
36
+ deploymentName: 'text-embedding-3-large'
37
+ instanceName: 'eastus'
38
+ apiKey: ${AZURE_OPENAI_API_KEY}
39
+ ```
40
+
41
+ Field descriptions:
42
+
43
+ - `endpoint` - The full Azure endpoint URL for the embeddings deployment. This may include
44
+ the deployment path and api-version query parameter depending on your Azure setup.
45
+ - `deploymentName` - The name of the deployment that provides the embeddings model.
46
+ - `instanceName` - The Azure instance / region name (used for telemetry or constructing alternate
47
+ endpoint forms in some setups).
48
+ - `apiKey` - Your Azure OpenAI or Azure AI API key. Marked as secret in configuration.
49
+ - `openAIApiVersion` -
50
+
51
+ The exact keys available and required depend on your Azure configuration. Check the provider's
52
+ `config.d.ts` in the package for the canonical types used by the module.
53
+
54
+ ## Install
55
+
56
+ Install the module into your Backstage backend workspace:
57
+
58
+ ```sh
59
+ yarn workspace backend add @sweetoburrito/backstage-plugin-ai-assistant-backend-module-embeddings-provider-azure-open-ai
60
+ ```
61
+
62
+ ## Wire the provider into your backend
63
+
64
+ Add the provider module import to your backend entrypoint (usually `packages/backend/src/index.ts`):
65
+
66
+ ```diff
67
+ // packages/backend/src/index.ts
68
+
69
+ // other backend modules...
70
+ backend.add(import('@sweetoburrito/backstage-plugin-ai-assistant-backend'));
71
+
72
+ // Add the Azure OpenAI embeddings provider
73
+ ++backend.add(
74
+ ++ import(
75
+ ++ '@sweetoburrito/backstage-plugin-ai-assistant-backend-module-embeddings-provider-azure-open-ai'
76
+ ++ ),
77
+ ++);
78
+ ```
79
+
80
+ Restart your backend after adding the provider so it registers with the AI Assistant plugin.
package/config.d.ts ADDED
@@ -0,0 +1,16 @@
1
+ export interface Config {
2
+ aiAssistant: {
3
+ embeddings: {
4
+ azureOpenAi: {
5
+ endpoint: string;
6
+ deploymentName: string;
7
+ instanceName: string;
8
+ openAIApiVersion: string;
9
+ /**
10
+ * @visibility secret
11
+ */
12
+ apiKey: string;
13
+ };
14
+ };
15
+ };
16
+ }
@@ -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.aiAssistantModuleEmbeddingsProviderAzureOpenAi;
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 aiAssistantModuleEmbeddingsProviderAzureOpenAi: _backstage_backend_plugin_api.BackendFeature;
4
+
5
+ export { aiAssistantModuleEmbeddingsProviderAzureOpenAi as default };
@@ -0,0 +1,49 @@
1
+ 'use strict';
2
+
3
+ var backendPluginApi = require('@backstage/backend-plugin-api');
4
+ var backstagePluginAiAssistantNode = require('@sweetoburrito/backstage-plugin-ai-assistant-node');
5
+ var openai = require('@langchain/openai');
6
+
7
+ const aiAssistantModuleEmbeddingsProviderAzureOpenAi = backendPluginApi.createBackendModule({
8
+ pluginId: "ai-assistant",
9
+ moduleId: "embeddings-provider-azure-openai",
10
+ register(reg) {
11
+ reg.registerInit({
12
+ deps: {
13
+ logger: backendPluginApi.coreServices.logger,
14
+ config: backendPluginApi.coreServices.rootConfig,
15
+ embeddingsProvider: backstagePluginAiAssistantNode.embeddingsProviderExtensionPoint
16
+ },
17
+ async init({ embeddingsProvider, config }) {
18
+ const deploymentName = config.getString(
19
+ "aiAssistant.embeddings.azureOpenAi.deploymentName"
20
+ );
21
+ const instanceName = config.getString(
22
+ "aiAssistant.embeddings.azureOpenAi.instanceName"
23
+ );
24
+ const apiKey = config.getString(
25
+ "aiAssistant.embeddings.azureOpenAi.apiKey"
26
+ );
27
+ const endpoint = config.getString(
28
+ "aiAssistant.embeddings.azureOpenAi.endpoint"
29
+ );
30
+ const openAIApiVersion = config.getString(
31
+ "aiAssistant.embeddings.azureOpenAi.openAIApiVersion"
32
+ );
33
+ const embeddings = new openai.AzureOpenAIEmbeddings({
34
+ azureOpenAIApiEmbeddingsDeploymentName: deploymentName,
35
+ azureOpenAIApiInstanceName: instanceName,
36
+ azureOpenAIEndpoint: endpoint,
37
+ azureOpenAIApiKey: apiKey,
38
+ openAIApiVersion
39
+ });
40
+ return embeddingsProvider.register({
41
+ getEmbeddings: async () => embeddings
42
+ });
43
+ }
44
+ });
45
+ }
46
+ });
47
+
48
+ exports.aiAssistantModuleEmbeddingsProviderAzureOpenAi = aiAssistantModuleEmbeddingsProviderAzureOpenAi;
49
+ //# 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 { embeddingsProviderExtensionPoint } from '@sweetoburrito/backstage-plugin-ai-assistant-node';\nimport { AzureOpenAIEmbeddings } from '@langchain/openai';\n\nexport const aiAssistantModuleEmbeddingsProviderAzureOpenAi =\n createBackendModule({\n pluginId: 'ai-assistant',\n moduleId: 'embeddings-provider-azure-openai',\n register(reg) {\n reg.registerInit({\n deps: {\n logger: coreServices.logger,\n config: coreServices.rootConfig,\n embeddingsProvider: embeddingsProviderExtensionPoint,\n },\n async init({ embeddingsProvider, config }) {\n const deploymentName = config.getString(\n 'aiAssistant.embeddings.azureOpenAi.deploymentName',\n );\n\n const instanceName = config.getString(\n 'aiAssistant.embeddings.azureOpenAi.instanceName',\n );\n const apiKey = config.getString(\n 'aiAssistant.embeddings.azureOpenAi.apiKey',\n );\n const endpoint = config.getString(\n 'aiAssistant.embeddings.azureOpenAi.endpoint',\n );\n\n const openAIApiVersion = config.getString(\n 'aiAssistant.embeddings.azureOpenAi.openAIApiVersion',\n );\n\n const embeddings = new AzureOpenAIEmbeddings({\n azureOpenAIApiEmbeddingsDeploymentName: deploymentName,\n azureOpenAIApiInstanceName: instanceName,\n azureOpenAIEndpoint: endpoint,\n azureOpenAIApiKey: apiKey,\n openAIApiVersion: openAIApiVersion,\n });\n\n return embeddingsProvider.register({\n getEmbeddings: async () => embeddings,\n });\n },\n });\n },\n });\n"],"names":["createBackendModule","coreServices","embeddingsProviderExtensionPoint","AzureOpenAIEmbeddings"],"mappings":";;;;;;AAOO,MAAM,iDACXA,oCAAA,CAAoB;AAAA,EAClB,QAAA,EAAU,cAAA;AAAA,EACV,QAAA,EAAU,kCAAA;AAAA,EACV,SAAS,GAAA,EAAK;AACZ,IAAA,GAAA,CAAI,YAAA,CAAa;AAAA,MACf,IAAA,EAAM;AAAA,QACJ,QAAQC,6BAAA,CAAa,MAAA;AAAA,QACrB,QAAQA,6BAAA,CAAa,UAAA;AAAA,QACrB,kBAAA,EAAoBC;AAAA,OACtB;AAAA,MACA,MAAM,IAAA,CAAK,EAAE,kBAAA,EAAoB,QAAO,EAAG;AACzC,QAAA,MAAM,iBAAiB,MAAA,CAAO,SAAA;AAAA,UAC5B;AAAA,SACF;AAEA,QAAA,MAAM,eAAe,MAAA,CAAO,SAAA;AAAA,UAC1B;AAAA,SACF;AACA,QAAA,MAAM,SAAS,MAAA,CAAO,SAAA;AAAA,UACpB;AAAA,SACF;AACA,QAAA,MAAM,WAAW,MAAA,CAAO,SAAA;AAAA,UACtB;AAAA,SACF;AAEA,QAAA,MAAM,mBAAmB,MAAA,CAAO,SAAA;AAAA,UAC9B;AAAA,SACF;AAEA,QAAA,MAAM,UAAA,GAAa,IAAIC,4BAAA,CAAsB;AAAA,UAC3C,sCAAA,EAAwC,cAAA;AAAA,UACxC,0BAAA,EAA4B,YAAA;AAAA,UAC5B,mBAAA,EAAqB,QAAA;AAAA,UACrB,iBAAA,EAAmB,MAAA;AAAA,UACnB;AAAA,SACD,CAAA;AAED,QAAA,OAAO,mBAAmB,QAAA,CAAS;AAAA,UACjC,eAAe,YAAY;AAAA,SAC5B,CAAA;AAAA,MACH;AAAA,KACD,CAAA;AAAA,EACH;AACF,CAAC;;;;"}
package/package.json ADDED
@@ -0,0 +1,51 @@
1
+ {
2
+ "name": "@sweetoburrito/backstage-plugin-ai-assistant-backend-module-embeddings-provider-azure-open-ai",
3
+ "version": "0.0.0-snapshot-20251029150521",
4
+ "license": "Apache-2.0",
5
+ "description": "The embeddings-provider-azure-open-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": "backstage:^",
32
+ "@langchain/openai": "^0.6.11",
33
+ "@sweetoburrito/backstage-plugin-ai-assistant-node": "0.0.0-snapshot-20251029150521"
34
+ },
35
+ "devDependencies": {
36
+ "@backstage/backend-test-utils": "backstage:^",
37
+ "@backstage/cli": "backstage:^"
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
+ }