triangle-utils 1.4.175 → 1.4.177

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.
@@ -253,7 +253,7 @@ export class UtilsBedrock {
253
253
  return undefined;
254
254
  }
255
255
  async cohere_invoke(model_id, text, options = {}) {
256
- for (let i = 0; i < 3; i++) {
256
+ for (let i = 0; i < 20; i++) {
257
257
  try {
258
258
  const output = await this.bedrock_runtime.invokeModel({
259
259
  modelId: model_id,
@@ -280,9 +280,9 @@ export class UtilsBedrock {
280
280
  }
281
281
  catch (error) {
282
282
  console.log(error.message);
283
- await TriangleUtils.wait(5000);
283
+ await TriangleUtils.wait(5000 * (i + 1));
284
284
  }
285
285
  }
286
- throw new Error("Failed to Cohere");
286
+ return undefined;
287
287
  }
288
288
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "triangle-utils",
3
- "version": "1.4.175",
3
+ "version": "1.4.177",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "directories": {
@@ -285,7 +285,7 @@ export class UtilsBedrock {
285
285
  }
286
286
 
287
287
  async cohere_invoke(model_id : string, text : string, options : { input_type_id? : string } = {}) : Promise<number[] | undefined> {
288
- for (let i = 0; i < 3; i++) {
288
+ for (let i = 0; i < 20; i++) {
289
289
  try {
290
290
  const output = await this.bedrock_runtime.invokeModel({
291
291
  modelId : model_id,
@@ -311,10 +311,10 @@ export class UtilsBedrock {
311
311
  }
312
312
  } catch (error : any) {
313
313
  console.log(error.message)
314
- await TriangleUtils.wait(5000)
314
+ await TriangleUtils.wait(5000 * (i + 1))
315
315
  }
316
316
  }
317
- throw new Error("Failed to Cohere")
317
+ return undefined
318
318
  }
319
319
 
320
320
  }