@stacksjs/ai 0.59.11 → 0.61.1

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/index.js CHANGED
@@ -1,5 +1,10 @@
1
1
  // src/utils/client-bedrock.ts
2
- import {BedrockClient, CreateModelCustomizationJobCommand, GetModelCustomizationJobCommand, ListFoundationModelsCommand} from "@aws-sdk/client-bedrock";
2
+ import {
3
+ BedrockClient,
4
+ CreateModelCustomizationJobCommand,
5
+ GetModelCustomizationJobCommand,
6
+ ListFoundationModelsCommand
7
+ } from "@aws-sdk/client-bedrock";
3
8
  async function createModelCustomizationJob(param) {
4
9
  logger.debug(param);
5
10
  const command = new CreateModelCustomizationJobCommand(param);
@@ -27,7 +32,11 @@ async function listFoundationModels(params) {
27
32
  var client = new BedrockClient({ region: process.env.REGION || "us-east-1" });
28
33
  var logger = console;
29
34
  // src/utils/client-bedrock-runtime.ts
30
- import {BedrockRuntimeClient, InvokeModelCommand, InvokeModelWithResponseStreamCommand} from "@aws-sdk/client-bedrock-runtime";
35
+ import {
36
+ BedrockRuntimeClient,
37
+ InvokeModelCommand,
38
+ InvokeModelWithResponseStreamCommand
39
+ } from "@aws-sdk/client-bedrock-runtime";
31
40
  async function invokeModel(params) {
32
41
  logger2.debug(params);
33
42
  const command = new InvokeModelCommand(params);
@@ -44,7 +53,9 @@ async function invokeModelWithResponseStream(params) {
44
53
  logger2.debug(res);
45
54
  return res;
46
55
  }
47
- var client2 = new BedrockRuntimeClient({ region: process.env.REGION || "us-east-1" });
56
+ var client2 = new BedrockRuntimeClient({
57
+ region: process.env.REGION || "us-east-1"
58
+ });
48
59
  var logger2 = console;
49
60
  export {
50
61
  listFoundationModels,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/ai",
3
3
  "type": "module",
4
- "version": "0.59.11",
4
+ "version": "0.61.1",
5
5
  "description": "Stacks Artificial Intelligence.",
6
6
  "author": "Chris Breuer",
7
7
  "license": "MIT",
@@ -49,10 +49,10 @@
49
49
  "prepublishOnly": "bun run build"
50
50
  },
51
51
  "peerDependencies": {
52
- "@aws-sdk/client-bedrock-runtime": "^3.525.0"
52
+ "@aws-sdk/client-bedrock-runtime": "^3.577.0"
53
53
  },
54
54
  "dependencies": {
55
- "@aws-sdk/client-bedrock-runtime": "^3.525.0"
55
+ "@aws-sdk/client-bedrock-runtime": "^3.577.0"
56
56
  },
57
57
  "devDependencies": {
58
58
  "@stacksjs/development": "latest"
@@ -1,16 +1,26 @@
1
- import type { InvokeModelCommandInput, InvokeModelCommandOutput, InvokeModelWithResponseStreamCommandInput, InvokeModelWithResponseStreamCommandOutput } from '@aws-sdk/client-bedrock-runtime'
2
- import { BedrockRuntimeClient, InvokeModelCommand, InvokeModelWithResponseStreamCommand } from '@aws-sdk/client-bedrock-runtime'
1
+ import type {
2
+ InvokeModelCommandInput,
3
+ InvokeModelCommandOutput,
4
+ InvokeModelWithResponseStreamCommandInput,
5
+ InvokeModelWithResponseStreamCommandOutput,
6
+ } from '@aws-sdk/client-bedrock-runtime'
7
+ import {
8
+ BedrockRuntimeClient,
9
+ InvokeModelCommand,
10
+ InvokeModelWithResponseStreamCommand,
11
+ } from '@aws-sdk/client-bedrock-runtime'
3
12
 
4
- // eslint-disable-next-line node/prefer-global/process
5
- const client = new BedrockRuntimeClient({ region: process.env.REGION || 'us-east-1' })
13
+ const client = new BedrockRuntimeClient({
14
+ region: process.env.REGION || 'us-east-1',
15
+ })
6
16
  const logger = console // import your own logger
7
17
 
8
18
  /*
9
- * Invoke Model
10
- * @param {InvokeModelCommandInput} params
11
- * @returns {Promise<InvokeModelCommandOutput>}
12
- * @see https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/BedrockRuntime.html#invokeModel-property
13
- */
19
+ * Invoke Model
20
+ * @param {InvokeModelCommandInput} params
21
+ * @returns {Promise<InvokeModelCommandOutput>}
22
+ * @see https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/BedrockRuntime.html#invokeModel-property
23
+ */
14
24
  export async function invokeModel(params: InvokeModelCommandInput): Promise<InvokeModelCommandOutput> {
15
25
  logger.debug(params)
16
26
  const command = new InvokeModelCommand(params)
@@ -21,12 +31,14 @@ export async function invokeModel(params: InvokeModelCommandInput): Promise<Invo
21
31
  }
22
32
 
23
33
  /*
24
- * Invoke Model With Response Stream
25
- * @param {InvokeModelWithResponseStreamCommandInput} params
26
- * @returns {Promise<InvokeModelWithResponseStreamCommandOutput>}
27
- * @see https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/BedrockRuntime.html#invokeModelWithResponseStream-property
28
- */
29
- export async function invokeModelWithResponseStream(params: InvokeModelWithResponseStreamCommandInput): Promise<InvokeModelWithResponseStreamCommandOutput> {
34
+ * Invoke Model With Response Stream
35
+ * @param {InvokeModelWithResponseStreamCommandInput} params
36
+ * @returns {Promise<InvokeModelWithResponseStreamCommandOutput>}
37
+ * @see https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/BedrockRuntime.html#invokeModelWithResponseStream-property
38
+ */
39
+ export async function invokeModelWithResponseStream(
40
+ params: InvokeModelWithResponseStreamCommandInput,
41
+ ): Promise<InvokeModelWithResponseStreamCommandOutput> {
30
42
  logger.debug(params)
31
43
  const command = new InvokeModelWithResponseStreamCommand(params)
32
44
  const res = await client.send(command)
@@ -1,17 +1,30 @@
1
- import type { CreateModelCustomizationJobCommandInput, CreateModelCustomizationJobCommandOutput, GetModelCustomizationJobCommandInput, GetModelCustomizationJobCommandOutput, ListFoundationModelsCommandInput, ListFoundationModelsCommandOutput } from '@aws-sdk/client-bedrock'
2
- import { BedrockClient, CreateModelCustomizationJobCommand, GetModelCustomizationJobCommand, ListFoundationModelsCommand } from '@aws-sdk/client-bedrock'
1
+ import type {
2
+ CreateModelCustomizationJobCommandInput,
3
+ CreateModelCustomizationJobCommandOutput,
4
+ GetModelCustomizationJobCommandInput,
5
+ GetModelCustomizationJobCommandOutput,
6
+ ListFoundationModelsCommandInput,
7
+ ListFoundationModelsCommandOutput,
8
+ } from '@aws-sdk/client-bedrock'
9
+ import {
10
+ BedrockClient,
11
+ CreateModelCustomizationJobCommand,
12
+ GetModelCustomizationJobCommand,
13
+ ListFoundationModelsCommand,
14
+ } from '@aws-sdk/client-bedrock'
3
15
 
4
- // eslint-disable-next-line node/prefer-global/process
5
16
  const client = new BedrockClient({ region: process.env.REGION || 'us-east-1' })
6
17
  const logger = console // import your own logger
7
18
 
8
19
  /*
9
- * Create Model Customization Job
10
- * @param {CreateModelCustomizationJobCommandInput} params
11
- * @returns {Promise<CreateModelCustomizationJobCommandOutput>}
12
- * @see https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Bedrock.html#CreateModelCustomizationJob-property
13
- */
14
- export async function createModelCustomizationJob(param: CreateModelCustomizationJobCommandInput): Promise<CreateModelCustomizationJobCommandOutput> {
20
+ * Create Model Customization Job
21
+ * @param {CreateModelCustomizationJobCommandInput} params
22
+ * @returns {Promise<CreateModelCustomizationJobCommandOutput>}
23
+ * @see https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Bedrock.html#CreateModelCustomizationJob-property
24
+ */
25
+ export async function createModelCustomizationJob(
26
+ param: CreateModelCustomizationJobCommandInput,
27
+ ): Promise<CreateModelCustomizationJobCommandOutput> {
15
28
  logger.debug(param)
16
29
  const command = new CreateModelCustomizationJobCommand(param)
17
30
  const res = await client.send(command)
@@ -21,12 +34,14 @@ export async function createModelCustomizationJob(param: CreateModelCustomizatio
21
34
  }
22
35
 
23
36
  /*
24
- * Get Model Customization Job
25
- * @param {GetModelCustomizationJobCommandInput} params
26
- * @returns {Promise<GetModelCustomizationJobCommandOutput>}
27
- * @see https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Bedrock.html#getModelCustomizationJob-property
28
- */
29
- export async function getModelCustomizationJob(params: GetModelCustomizationJobCommandInput): Promise<GetModelCustomizationJobCommandOutput> {
37
+ * Get Model Customization Job
38
+ * @param {GetModelCustomizationJobCommandInput} params
39
+ * @returns {Promise<GetModelCustomizationJobCommandOutput>}
40
+ * @see https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Bedrock.html#getModelCustomizationJob-property
41
+ */
42
+ export async function getModelCustomizationJob(
43
+ params: GetModelCustomizationJobCommandInput,
44
+ ): Promise<GetModelCustomizationJobCommandOutput> {
30
45
  logger.debug(params)
31
46
  const command = new GetModelCustomizationJobCommand(params)
32
47
  const res = await client.send(command)
@@ -36,12 +51,14 @@ export async function getModelCustomizationJob(params: GetModelCustomizationJobC
36
51
  }
37
52
 
38
53
  /*
39
- * List Foundation Models
40
- * @param {ListFoundationModelsCommandInput} params
41
- * @returns {Promise<ListFoundationModelsCommandOutput>}
42
- * @see https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Bedrock.html#listFoundationModels-property
43
- */
44
- export async function listFoundationModels(params: ListFoundationModelsCommandInput): Promise<ListFoundationModelsCommandOutput> {
54
+ * List Foundation Models
55
+ * @param {ListFoundationModelsCommandInput} params
56
+ * @returns {Promise<ListFoundationModelsCommandOutput>}
57
+ * @see https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Bedrock.html#listFoundationModels-property
58
+ */
59
+ export async function listFoundationModels(
60
+ params: ListFoundationModelsCommandInput,
61
+ ): Promise<ListFoundationModelsCommandOutput> {
45
62
  logger.debug(params)
46
63
  const command = new ListFoundationModelsCommand(params)
47
64
  const res = await client.send(command)
@@ -50,4 +67,8 @@ export async function listFoundationModels(params: ListFoundationModelsCommandIn
50
67
  return res
51
68
  }
52
69
 
53
- export type { CreateModelCustomizationJobCommandInput, GetModelCustomizationJobCommandInput, ListFoundationModelsCommandInput }
70
+ export type {
71
+ CreateModelCustomizationJobCommandInput,
72
+ GetModelCustomizationJobCommandInput,
73
+ ListFoundationModelsCommandInput,
74
+ }
package/dist/index.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export * from './utils/client-bedrock';
2
- export * from './utils/client-bedrock-runtime';
@@ -1,4 +0,0 @@
1
- import type { InvokeModelCommandInput, InvokeModelCommandOutput, InvokeModelWithResponseStreamCommandInput, InvokeModelWithResponseStreamCommandOutput } from '@aws-sdk/client-bedrock-runtime';
2
- export declare function invokeModel(params: InvokeModelCommandInput): Promise<InvokeModelCommandOutput>;
3
- export declare function invokeModelWithResponseStream(params: InvokeModelWithResponseStreamCommandInput): Promise<InvokeModelWithResponseStreamCommandOutput>;
4
- export type { InvokeModelCommandInput, InvokeModelWithResponseStreamCommandInput };
@@ -1,5 +0,0 @@
1
- import type { CreateModelCustomizationJobCommandInput, CreateModelCustomizationJobCommandOutput, GetModelCustomizationJobCommandInput, GetModelCustomizationJobCommandOutput, ListFoundationModelsCommandInput, ListFoundationModelsCommandOutput } from '@aws-sdk/client-bedrock';
2
- export declare function createModelCustomizationJob(param: CreateModelCustomizationJobCommandInput): Promise<CreateModelCustomizationJobCommandOutput>;
3
- export declare function getModelCustomizationJob(params: GetModelCustomizationJobCommandInput): Promise<GetModelCustomizationJobCommandOutput>;
4
- export declare function listFoundationModels(params: ListFoundationModelsCommandInput): Promise<ListFoundationModelsCommandOutput>;
5
- export type { CreateModelCustomizationJobCommandInput, GetModelCustomizationJobCommandInput, ListFoundationModelsCommandInput };