@seekdb/amazon-bedrock 1.1.0 → 1.2.0

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/dist/index.cjs CHANGED
@@ -97,25 +97,23 @@ var AmazonBedrockEmbeddingFunction = class _AmazonBedrockEmbeddingFunction {
97
97
  }
98
98
  getConfig() {
99
99
  return {
100
- api_key: this.apiKey,
101
100
  region: this.region,
101
+ api_key_env: this.apiKeyEnv,
102
102
  model_name: this.modelName
103
103
  };
104
104
  }
105
105
  static buildFromConfig(config) {
106
- if (!config.api_key || !config.region) {
107
- throw new Error(
108
- "api_key and region are required in config. Generate API key at: https://docs.aws.amazon.com/bedrock/latest/userguide/api-keys-generate.html"
109
- );
110
- }
111
106
  return new _AmazonBedrockEmbeddingFunction({
112
- apiKey: config.api_key,
107
+ apiKeyEnv: config.api_key_env,
113
108
  region: config.region,
114
109
  modelName: config.model_name
115
110
  });
116
111
  }
117
112
  };
118
- (0, import_seekdb.registerEmbeddingFunction)(embeddingFunctionName, AmazonBedrockEmbeddingFunction);
113
+ (0, import_seekdb.registerEmbeddingFunction)(
114
+ embeddingFunctionName,
115
+ AmazonBedrockEmbeddingFunction
116
+ );
119
117
  // Annotate the CommonJS export names for ESM import in node:
120
118
  0 && (module.exports = {
121
119
  AmazonBedrockEmbeddingFunction
package/dist/index.mjs CHANGED
@@ -75,25 +75,23 @@ var AmazonBedrockEmbeddingFunction = class _AmazonBedrockEmbeddingFunction {
75
75
  }
76
76
  getConfig() {
77
77
  return {
78
- api_key: this.apiKey,
79
78
  region: this.region,
79
+ api_key_env: this.apiKeyEnv,
80
80
  model_name: this.modelName
81
81
  };
82
82
  }
83
83
  static buildFromConfig(config) {
84
- if (!config.api_key || !config.region) {
85
- throw new Error(
86
- "api_key and region are required in config. Generate API key at: https://docs.aws.amazon.com/bedrock/latest/userguide/api-keys-generate.html"
87
- );
88
- }
89
84
  return new _AmazonBedrockEmbeddingFunction({
90
- apiKey: config.api_key,
85
+ apiKeyEnv: config.api_key_env,
91
86
  region: config.region,
92
87
  modelName: config.model_name
93
88
  });
94
89
  }
95
90
  };
96
- registerEmbeddingFunction(embeddingFunctionName, AmazonBedrockEmbeddingFunction);
91
+ registerEmbeddingFunction(
92
+ embeddingFunctionName,
93
+ AmazonBedrockEmbeddingFunction
94
+ );
97
95
  export {
98
96
  AmazonBedrockEmbeddingFunction
99
97
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seekdb/amazon-bedrock",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "type": "module",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",
@@ -16,12 +16,12 @@
16
16
  "dist"
17
17
  ],
18
18
  "peerDependencies": {
19
- "seekdb": "1.1.0",
20
- "@seekdb/common": "1.1.0"
19
+ "seekdb": "1.2.0",
20
+ "@seekdb/common": "1.2.0"
21
21
  },
22
22
  "devDependencies": {
23
- "@seekdb/common": "1.1.0",
24
- "seekdb": "1.1.0"
23
+ "seekdb": "1.2.0",
24
+ "@seekdb/common": "1.2.0"
25
25
  },
26
26
  "dependencies": {
27
27
  "@aws-sdk/client-bedrock-runtime": "^3.713.0"