triangle-utils 1.4.53 → 1.4.54

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.
@@ -4,5 +4,6 @@ export declare class UtilsAnthropic {
4
4
  claude_query(model_id: string, prompt: string, attachment_pdf?: string, options?: {
5
5
  max_tokens?: number;
6
6
  print_usage?: boolean;
7
+ json_format?: Record<string, any>;
7
8
  }): Promise<string | undefined>;
8
9
  }
@@ -32,7 +32,13 @@ export class UtilsAnthropic {
32
32
  role: "user",
33
33
  content: message_contents
34
34
  }],
35
- max_tokens: options.max_tokens || 1000
35
+ max_tokens: options.max_tokens || 1000,
36
+ output_config: options.json_format !== undefined ? {
37
+ format: {
38
+ type: "json_schema",
39
+ schema: options.json_format
40
+ }
41
+ } : undefined
36
42
  });
37
43
  const usage = response.usage;
38
44
  if (options.print_usage !== undefined && options.print_usage) {
package/dist/src/f.js CHANGED
@@ -17,7 +17,7 @@ console.log(config);
17
17
  const utils = new TriangleUtils(config);
18
18
  // const foods = await utils.dynamodb.query("triage_docket_documents:register_document_id", { register_document_id : "E6-17065" })
19
19
  // console.log(foods)
20
- const text = await utils.anthropic.claude_query("claude-opus-4-6", "hi", undefined, { print_usage: true });
20
+ const text = await utils.bee.get("https://www.doyourjobs.org", { return_page_text: true });
21
21
  console.log(text);
22
22
  // const text = await utils.bedrock.claude_invoke("global.anthropic.claude-opus-4-6-v1", "hi", undefined, { print_usage : true })
23
23
  // console.log(text)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "triangle-utils",
3
- "version": "1.4.53",
3
+ "version": "1.4.54",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "directories": {
@@ -14,7 +14,8 @@ export class UtilsAnthropic {
14
14
  attachment_pdf? : string,
15
15
  options : {
16
16
  max_tokens? : number,
17
- print_usage? : boolean
17
+ print_usage? : boolean,
18
+ json_format? : Record<string, any>
18
19
  } = {}
19
20
  ) : Promise<string | undefined> {
20
21
  try {
@@ -46,7 +47,13 @@ export class UtilsAnthropic {
46
47
  role : "user",
47
48
  content : message_contents
48
49
  }],
49
- max_tokens : options.max_tokens || 1000
50
+ max_tokens : options.max_tokens || 1000,
51
+ output_config : options.json_format !== undefined ? {
52
+ format : {
53
+ type : "json_schema",
54
+ schema : options.json_format
55
+ }
56
+ } : undefined
50
57
  })
51
58
 
52
59
  const usage = response.usage
package/src/f.ts CHANGED
@@ -28,7 +28,7 @@ const utils = new TriangleUtils(config)
28
28
 
29
29
  // console.log(foods)
30
30
 
31
- const text = await utils.anthropic.claude_query("claude-opus-4-6", "hi", undefined, { print_usage : true })
31
+ const text = await utils.bee.get("https://www.doyourjobs.org", { return_page_text : true })
32
32
 
33
33
  console.log(text)
34
34