@bedrockio/ai 0.7.1 → 0.7.2

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/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.7.2
2
+
3
+ - Handling long filenames.
4
+
1
5
  ## 0.7.1
2
6
 
3
7
  - Better model listing.
@@ -193,19 +193,13 @@ class BaseClient {
193
193
  };
194
194
  }
195
195
  normalizeInput(options) {
196
- let { input = '' } = options;
197
- if (!input) {
198
- input = [];
199
- }
200
- else if (typeof input === 'string') {
201
- input = [
202
- {
203
- role: 'user',
204
- content: input,
205
- },
206
- ];
207
- }
208
- return input;
196
+ const { input = '' } = options;
197
+ return [
198
+ {
199
+ role: 'user',
200
+ content: input,
201
+ },
202
+ ];
209
203
  }
210
204
  normalizeSchema(options) {
211
205
  let { schema } = options;
@@ -191,19 +191,13 @@ export default class BaseClient {
191
191
  };
192
192
  }
193
193
  normalizeInput(options) {
194
- let { input = '' } = options;
195
- if (!input) {
196
- input = [];
197
- }
198
- else if (typeof input === 'string') {
199
- input = [
200
- {
201
- role: 'user',
202
- content: input,
203
- },
204
- ];
205
- }
206
- return input;
194
+ const { input = '' } = options;
195
+ return [
196
+ {
197
+ role: 'user',
198
+ content: input,
199
+ },
200
+ ];
207
201
  }
208
202
  normalizeSchema(options) {
209
203
  let { schema } = options;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bedrockio/ai",
3
- "version": "0.7.1",
3
+ "version": "0.7.2",
4
4
  "description": "Bedrock wrapper for common AI chatbots.",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -36,7 +36,7 @@
36
36
  },
37
37
  "dependencies": {
38
38
  "@anthropic-ai/sdk": "^0.66.0",
39
- "@bedrockio/templates": "^0.3.0",
39
+ "@bedrockio/templates": "^0.3.1",
40
40
  "@google/generative-ai": "^0.21.0",
41
41
  "openai": "^6.3.0",
42
42
  "partial-json": "^0.1.7"
@@ -45,7 +45,10 @@ export default class BaseClient {
45
45
  system: string;
46
46
  messages: any[];
47
47
  };
48
- normalizeInput(options: any): any;
48
+ normalizeInput(options: any): {
49
+ role: string;
50
+ content: any;
51
+ }[];
49
52
  normalizeSchema(options: any): {
50
53
  schema: any;
51
54
  hasWrappedSchema: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"BaseClient.d.ts","sourceRoot":"","sources":["../src/BaseClient.js"],"names":[],"mappings":"AAKA;IACE,0BASC;IARC,aAIC;IACD,2BAEE;IAKJ;;;;;OAKG;IACH,gBAFW,aAAa,gBAuCvB;IAED;;;;;OAKG;IACH,gBAHW,aAAa,GAAG,aAAa,gCAsDvC;IAED;;;;OAIG;IACH,wBAFW,MAAM,OAIhB;IAID,8BAGC;IAED,8BAGC;IAED,qCAGC;IAED;;OAEG;IACH,0CAGC;IAED;;OAEG;IACH,oDAGC;IAED;;OAEG;IACH,sCAGC;IAID;;OAEG;IACH,oCAOC;IAED;;;MAsCC;IAED,kCAeC;IAED;;;MA4BC;IAED,uDAWC;IAED,oCAMC;CACF;;;;;WAIa,MAAM,GAAC,aAAa,EAAE;;;;YACtB,MAAM;;;;YACN,OAAO;;;;;;;;aAEP,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,UAAU;;;;;;;;;;;sBAOpC,MAAM;;;UAKN,QAAQ,GAAG,MAAM,GAAG,WAAW;aAC/B,MAAM;;iCA3Ta,sBAAsB"}
1
+ {"version":3,"file":"BaseClient.d.ts","sourceRoot":"","sources":["../src/BaseClient.js"],"names":[],"mappings":"AAKA;IACE,0BASC;IARC,aAIC;IACD,2BAEE;IAKJ;;;;;OAKG;IACH,gBAFW,aAAa,gBAuCvB;IAED;;;;;OAKG;IACH,gBAHW,aAAa,GAAG,aAAa,gCAsDvC;IAED;;;;OAIG;IACH,wBAFW,MAAM,OAIhB;IAID,8BAGC;IAED,8BAGC;IAED,qCAGC;IAED;;OAEG;IACH,0CAGC;IAED;;OAEG;IACH,oDAGC;IAED;;OAEG;IACH,sCAGC;IAID;;OAEG;IACH,oCAOC;IAED;;;MAuCC;IAED;;;QAQC;IAED;;;MA4BC;IAED,uDAWC;IAED,oCAMC;CACF;;;;;WAIa,MAAM,GAAC,aAAa,EAAE;;;;YACtB,MAAM;;;;YACN,OAAO;;;;;;;;aAEP,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,UAAU;;;;;;;;;;;sBAOpC,MAAM;;;UAKN,QAAQ,GAAG,MAAM,GAAG,WAAW;aAC/B,MAAM;;iCArTa,sBAAsB"}