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.
- package/dist/src/UtilsBedrock.js +3 -3
- package/package.json +1 -1
- package/src/UtilsBedrock.ts +3 -3
package/dist/src/UtilsBedrock.js
CHANGED
|
@@ -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 <
|
|
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
|
-
|
|
286
|
+
return undefined;
|
|
287
287
|
}
|
|
288
288
|
}
|
package/package.json
CHANGED
package/src/UtilsBedrock.ts
CHANGED
|
@@ -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 <
|
|
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
|
-
|
|
317
|
+
return undefined
|
|
318
318
|
}
|
|
319
319
|
|
|
320
320
|
}
|