triangle-utils 1.4.83 → 1.4.84
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 +4 -4
- package/dist/src/f.js +11 -4
- package/package.json +1 -1
- package/src/UtilsBedrock.ts +4 -5
- package/src/f.ts +16 -5
package/dist/src/UtilsBedrock.js
CHANGED
|
@@ -31,10 +31,10 @@ export class UtilsBedrock {
|
|
|
31
31
|
schema: options.json_format
|
|
32
32
|
}
|
|
33
33
|
} : undefined,
|
|
34
|
-
cache_control: {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
34
|
+
// cache_control : {
|
|
35
|
+
// type : "ephemeral",
|
|
36
|
+
// ttl : options.cache_period
|
|
37
|
+
// }
|
|
38
38
|
});
|
|
39
39
|
const usage = response.usage;
|
|
40
40
|
if (options.print_usage !== undefined && options.print_usage) {
|
package/dist/src/f.js
CHANGED
|
@@ -3,10 +3,10 @@ import { TriangleUtils } from "./index.js";
|
|
|
3
3
|
console.log("Starting triangle-utils!");
|
|
4
4
|
const secret_name = "elections_config";
|
|
5
5
|
const secrets_manager = new SecretsManager({ region: "us-east-1" });
|
|
6
|
-
const
|
|
6
|
+
const secret = await secrets_manager.getSecretValue({
|
|
7
7
|
SecretId: secret_name
|
|
8
8
|
});
|
|
9
|
-
const api_keys = JSON.parse(
|
|
9
|
+
const api_keys = JSON.parse(secret?.SecretString || "");
|
|
10
10
|
const config = {
|
|
11
11
|
google_email: "louishou@triangleanalytics.com",
|
|
12
12
|
alerts_email: "alerts@triangleanalytics.com",
|
|
@@ -216,5 +216,12 @@ const utils = new TriangleUtils(config);
|
|
|
216
216
|
// min_twitter_tweet_id : "2061610563679985813"
|
|
217
217
|
// })
|
|
218
218
|
// console.log(results)
|
|
219
|
-
const f = await utils.dynamodb.query_range("federal_election_donations:donor_address_state_id.federal_election_committee_id-receipt_date-federal_election_donation_id", { donor_address_state_id: "NH", federal_election_committee_id: "C00694323" }, { receipt_date: ["2021", "2023"] }, { compile: false })
|
|
220
|
-
console.log(f)
|
|
219
|
+
// const f = await utils.dynamodb.query_range("federal_election_donations:donor_address_state_id.federal_election_committee_id-receipt_date-federal_election_donation_id", { donor_address_state_id : "NH", federal_election_committee_id : "C00694323" }, { receipt_date : ["2021", "2023"] }, { compile : false })
|
|
220
|
+
// console.log(f)
|
|
221
|
+
console.log("YERP");
|
|
222
|
+
const response = await utils.bedrock.claude_converse("anthropic.claude-opus-4-8", [
|
|
223
|
+
{ role: "user", text: "Hi" }
|
|
224
|
+
], {
|
|
225
|
+
print_usage: true
|
|
226
|
+
});
|
|
227
|
+
console.log(response);
|
package/package.json
CHANGED
package/src/UtilsBedrock.ts
CHANGED
|
@@ -27,7 +27,6 @@ export class UtilsBedrock {
|
|
|
27
27
|
} = {}
|
|
28
28
|
) {
|
|
29
29
|
try {
|
|
30
|
-
|
|
31
30
|
const response = await this.anthropic_bedrock_mantle.messages.create({
|
|
32
31
|
model : model_id,
|
|
33
32
|
messages : messages.map(message => ({
|
|
@@ -48,10 +47,10 @@ export class UtilsBedrock {
|
|
|
48
47
|
schema : options.json_format
|
|
49
48
|
}
|
|
50
49
|
} : undefined,
|
|
51
|
-
cache_control : {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
50
|
+
// cache_control : {
|
|
51
|
+
// type : "ephemeral",
|
|
52
|
+
// ttl : options.cache_period
|
|
53
|
+
// }
|
|
55
54
|
})
|
|
56
55
|
|
|
57
56
|
const usage = response.usage
|
package/src/f.ts
CHANGED
|
@@ -7,11 +7,11 @@ const secret_name = "elections_config"
|
|
|
7
7
|
|
|
8
8
|
const secrets_manager = new SecretsManager({ region: "us-east-1" })
|
|
9
9
|
|
|
10
|
-
const
|
|
10
|
+
const secret = await secrets_manager.getSecretValue({
|
|
11
11
|
SecretId: secret_name
|
|
12
12
|
})
|
|
13
13
|
|
|
14
|
-
const api_keys = JSON.parse(
|
|
14
|
+
const api_keys = JSON.parse(secret?.SecretString || "")
|
|
15
15
|
|
|
16
16
|
const config = {
|
|
17
17
|
google_email : "louishou@triangleanalytics.com",
|
|
@@ -250,6 +250,17 @@ const utils = new TriangleUtils(config)
|
|
|
250
250
|
|
|
251
251
|
// console.log(results)
|
|
252
252
|
|
|
253
|
-
const f = await utils.dynamodb.query_range("federal_election_donations:donor_address_state_id.federal_election_committee_id-receipt_date-federal_election_donation_id", { donor_address_state_id : "NH", federal_election_committee_id : "C00694323" }, { receipt_date : ["2021", "2023"] }, { compile : false })
|
|
254
|
-
|
|
255
|
-
console.log(f)
|
|
253
|
+
// const f = await utils.dynamodb.query_range("federal_election_donations:donor_address_state_id.federal_election_committee_id-receipt_date-federal_election_donation_id", { donor_address_state_id : "NH", federal_election_committee_id : "C00694323" }, { receipt_date : ["2021", "2023"] }, { compile : false })
|
|
254
|
+
|
|
255
|
+
// console.log(f)
|
|
256
|
+
console.log("YERP")
|
|
257
|
+
const response = await utils.bedrock.claude_converse(
|
|
258
|
+
"anthropic.claude-opus-4-8",
|
|
259
|
+
[
|
|
260
|
+
{ role : "user", text : "Hi" }
|
|
261
|
+
],
|
|
262
|
+
{
|
|
263
|
+
print_usage : true
|
|
264
|
+
}
|
|
265
|
+
)
|
|
266
|
+
console.log(response)
|