triangle-utils 1.4.174 → 1.4.175

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.
@@ -1,5 +1,6 @@
1
1
  import { BedrockRuntime } from "@aws-sdk/client-bedrock-runtime";
2
2
  import { AnthropicBedrockMantle } from "@anthropic-ai/bedrock-sdk";
3
+ import { TriangleUtils } from "./index.js";
3
4
  const message_roles = ["user", "assistant", "system"];
4
5
  export function is_message_role(message_role) {
5
6
  return message_roles.includes(message_role);
@@ -278,10 +279,10 @@ export class UtilsBedrock {
278
279
  }
279
280
  }
280
281
  catch (error) {
281
- console.log(error.stack);
282
- console.log("Failed to get from Bedrock.");
282
+ console.log(error.message);
283
+ await TriangleUtils.wait(5000);
283
284
  }
284
285
  }
285
- throw new Error();
286
+ throw new Error("Failed to Cohere");
286
287
  }
287
288
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "triangle-utils",
3
- "version": "1.4.174",
3
+ "version": "1.4.175",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "directories": {
@@ -1,6 +1,7 @@
1
1
  import { BedrockRuntime, InvokeModelCommandInput } from "@aws-sdk/client-bedrock-runtime"
2
2
  import { AnthropicBedrockMantle } from "@anthropic-ai/bedrock-sdk"
3
3
  import { ContentBlockParam, MessageCreateParams, MessageParam, OutputConfig } from "@anthropic-ai/sdk/resources"
4
+ import { TriangleUtils } from "."
4
5
 
5
6
  const message_roles = ["user", "assistant", "system"] as const
6
7
 
@@ -309,11 +310,11 @@ export class UtilsBedrock {
309
310
  return coordinates
310
311
  }
311
312
  } catch (error : any) {
312
- console.log(error.stack)
313
- console.log("Failed to get from Bedrock.")
313
+ console.log(error.message)
314
+ await TriangleUtils.wait(5000)
314
315
  }
315
316
  }
316
- throw new Error()
317
+ throw new Error("Failed to Cohere")
317
318
  }
318
319
 
319
320
  }