triangle-utils 1.4.176 → 1.4.178
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
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,
|
|
@@ -283,6 +283,6 @@ export class UtilsBedrock {
|
|
|
283
283
|
await TriangleUtils.wait(5000 * (i + 1));
|
|
284
284
|
}
|
|
285
285
|
}
|
|
286
|
-
|
|
286
|
+
return undefined;
|
|
287
287
|
}
|
|
288
288
|
}
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
export declare class ApplicationConfig {
|
|
2
2
|
readonly cognito_client_id: string;
|
|
3
3
|
readonly cognito_client_secret: string;
|
|
4
|
-
readonly client_url: string;
|
|
5
|
-
readonly client_dev_url: string;
|
|
6
|
-
readonly api_url: string;
|
|
7
|
-
readonly api_dev_url: string;
|
|
8
4
|
readonly anthropic_api_key?: string;
|
|
9
5
|
readonly [x: string]: any;
|
|
10
6
|
constructor(application_config: ApplicationConfig);
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
export class ApplicationConfig {
|
|
2
2
|
cognito_client_id;
|
|
3
3
|
cognito_client_secret;
|
|
4
|
-
client_url;
|
|
5
|
-
client_dev_url;
|
|
6
|
-
api_url;
|
|
7
|
-
api_dev_url;
|
|
8
4
|
anthropic_api_key;
|
|
9
5
|
constructor(application_config) {
|
|
10
6
|
if (!ApplicationConfig.is(application_config)) {
|
|
@@ -12,20 +8,12 @@ export class ApplicationConfig {
|
|
|
12
8
|
}
|
|
13
9
|
this.cognito_client_id = application_config.cognito_client_id;
|
|
14
10
|
this.cognito_client_secret = application_config.cognito_client_secret;
|
|
15
|
-
this.client_url = application_config.client_url;
|
|
16
|
-
this.client_dev_url = application_config.client_dev_url;
|
|
17
|
-
this.api_url = application_config.api_url;
|
|
18
|
-
this.api_dev_url = application_config.api_dev_url;
|
|
19
11
|
this.anthropic_api_key = application_config.anthropic_api_key;
|
|
20
12
|
}
|
|
21
13
|
static is(application_config) {
|
|
22
14
|
return (application_config !== undefined &&
|
|
23
15
|
typeof application_config.cognito_client_id === "string" &&
|
|
24
16
|
typeof application_config.cognito_client_secret === "string" &&
|
|
25
|
-
typeof application_config.client_url === "string" &&
|
|
26
|
-
typeof application_config.client_dev_url === "string" &&
|
|
27
|
-
typeof application_config.api_url === "string" &&
|
|
28
|
-
typeof application_config.api_dev_url === "string" &&
|
|
29
17
|
(application_config.anthropic_api_key === undefined || typeof application_config.anthropic_api_key === "string"));
|
|
30
18
|
}
|
|
31
19
|
}
|
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,
|
|
@@ -314,7 +314,7 @@ export class UtilsBedrock {
|
|
|
314
314
|
await TriangleUtils.wait(5000 * (i + 1))
|
|
315
315
|
}
|
|
316
316
|
}
|
|
317
|
-
|
|
317
|
+
return undefined
|
|
318
318
|
}
|
|
319
319
|
|
|
320
320
|
}
|
|
@@ -2,10 +2,6 @@
|
|
|
2
2
|
export class ApplicationConfig {
|
|
3
3
|
readonly cognito_client_id : string
|
|
4
4
|
readonly cognito_client_secret : string
|
|
5
|
-
readonly client_url : string
|
|
6
|
-
readonly client_dev_url : string
|
|
7
|
-
readonly api_url : string
|
|
8
|
-
readonly api_dev_url : string
|
|
9
5
|
readonly anthropic_api_key? : string
|
|
10
6
|
readonly [x : string] : any
|
|
11
7
|
|
|
@@ -15,10 +11,6 @@ export class ApplicationConfig {
|
|
|
15
11
|
}
|
|
16
12
|
this.cognito_client_id = application_config.cognito_client_id
|
|
17
13
|
this.cognito_client_secret = application_config.cognito_client_secret
|
|
18
|
-
this.client_url = application_config.client_url
|
|
19
|
-
this.client_dev_url = application_config.client_dev_url
|
|
20
|
-
this.api_url = application_config.api_url
|
|
21
|
-
this.api_dev_url = application_config.api_dev_url
|
|
22
14
|
this.anthropic_api_key = application_config.anthropic_api_key
|
|
23
15
|
}
|
|
24
16
|
|
|
@@ -27,10 +19,6 @@ export class ApplicationConfig {
|
|
|
27
19
|
application_config !== undefined &&
|
|
28
20
|
typeof application_config.cognito_client_id === "string" &&
|
|
29
21
|
typeof application_config.cognito_client_secret === "string" &&
|
|
30
|
-
typeof application_config.client_url === "string" &&
|
|
31
|
-
typeof application_config.client_dev_url === "string" &&
|
|
32
|
-
typeof application_config.api_url === "string" &&
|
|
33
|
-
typeof application_config.api_dev_url === "string" &&
|
|
34
22
|
(application_config.anthropic_api_key === undefined || typeof application_config.anthropic_api_key === "string")
|
|
35
23
|
)
|
|
36
24
|
}
|