@signageos/lib 23.15.1 → 23.16.0
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/AWS/Bedrock.d.ts +48 -0
- package/dist/AWS/Bedrock.js +93 -0
- package/dist/AWS/Bedrock.js.map +1 -0
- package/dist/AWS/BedrockTypes.d.ts +21 -0
- package/dist/AWS/BedrockTypes.js +3 -0
- package/dist/AWS/BedrockTypes.js.map +1 -0
- package/dist/AWS/MockBedrock.d.ts +10 -0
- package/dist/AWS/MockBedrock.js +150 -0
- package/dist/AWS/MockBedrock.js.map +1 -0
- package/package.json +4 -2
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { BedrockRuntimeClientConfig, ConverseResponse, ConverseStreamResponse, GetAsyncInvokeCommandInput, GetAsyncInvokeResponse, ListAsyncInvokesCommandInput, ListAsyncInvokesResponse, StartAsyncInvokeCommandInput, StartAsyncInvokeResponse } from '@aws-sdk/client-bedrock-runtime';
|
|
2
|
+
import { SendMessageInput } from './BedrockTypes';
|
|
3
|
+
export interface IAwsBedrock {
|
|
4
|
+
/**
|
|
5
|
+
* Send a message to a Bedrock model
|
|
6
|
+
* More info: https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock-runtime/command/ConverseCommand/
|
|
7
|
+
* @param input - The input for the message
|
|
8
|
+
* @returns The response from the message
|
|
9
|
+
*/
|
|
10
|
+
sendMessage(input: SendMessageInput): Promise<ConverseResponse>;
|
|
11
|
+
/**
|
|
12
|
+
* Send a message to a Bedrock model with streaming response. Could be used for cases when you expect to receive a stream of data from the model.
|
|
13
|
+
* More info: https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock-runtime/command/ConverseStreamCommand/
|
|
14
|
+
* @param input - The input for the message
|
|
15
|
+
* @returns The response from the message
|
|
16
|
+
*/
|
|
17
|
+
sendMessageWithStream(input: SendMessageInput): Promise<ConverseStreamResponse>;
|
|
18
|
+
/**
|
|
19
|
+
* Send an asynchronous request to a Bedrock model. Could be used for cases when you expect that the request will take a long time to complete.
|
|
20
|
+
* More info: https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock-runtime/command/StartAsyncInvokeCommand/
|
|
21
|
+
* @param input - The input for the request
|
|
22
|
+
* @returns The response from the request
|
|
23
|
+
*/
|
|
24
|
+
sendAsyncRequest(input: StartAsyncInvokeCommandInput): Promise<StartAsyncInvokeResponse>;
|
|
25
|
+
/**
|
|
26
|
+
* Get the status of an asynchronous request to a Bedrock model.
|
|
27
|
+
* More info: https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock-runtime/command/GetAsyncInvokeCommand/
|
|
28
|
+
* @param input - The input for the request
|
|
29
|
+
* @returns The response from the request
|
|
30
|
+
*/
|
|
31
|
+
getAsyncRequestStatus(input: GetAsyncInvokeCommandInput): Promise<GetAsyncInvokeResponse>;
|
|
32
|
+
/**
|
|
33
|
+
* List all asynchronous requests to a Bedrock model.
|
|
34
|
+
* More info: https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock-runtime/command/ListAsyncRequestsCommand/
|
|
35
|
+
* @param input - The input for the request
|
|
36
|
+
* @returns The response from the request
|
|
37
|
+
*/
|
|
38
|
+
listAsyncRequests(input: ListAsyncInvokesCommandInput): Promise<ListAsyncInvokesResponse>;
|
|
39
|
+
}
|
|
40
|
+
export declare class AwsBedrock implements IAwsBedrock {
|
|
41
|
+
private client;
|
|
42
|
+
constructor(config: BedrockRuntimeClientConfig);
|
|
43
|
+
sendMessage(input: SendMessageInput): Promise<ConverseResponse>;
|
|
44
|
+
sendMessageWithStream(input: SendMessageInput): Promise<ConverseStreamResponse>;
|
|
45
|
+
sendAsyncRequest(input: StartAsyncInvokeCommandInput): Promise<StartAsyncInvokeResponse>;
|
|
46
|
+
getAsyncRequestStatus(input: GetAsyncInvokeCommandInput): Promise<GetAsyncInvokeResponse>;
|
|
47
|
+
listAsyncRequests(input: ListAsyncInvokesCommandInput): Promise<ListAsyncInvokesResponse>;
|
|
48
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.AwsBedrock = void 0;
|
|
40
|
+
var client_bedrock_runtime_1 = require("@aws-sdk/client-bedrock-runtime");
|
|
41
|
+
var AwsBedrock = /** @class */ (function () {
|
|
42
|
+
function AwsBedrock(config) {
|
|
43
|
+
this.client = new client_bedrock_runtime_1.BedrockRuntimeClient(config);
|
|
44
|
+
}
|
|
45
|
+
AwsBedrock.prototype.sendMessage = function (input) {
|
|
46
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
47
|
+
var command;
|
|
48
|
+
return __generator(this, function (_a) {
|
|
49
|
+
command = new client_bedrock_runtime_1.ConverseCommand(input);
|
|
50
|
+
return [2 /*return*/, this.client.send(command)];
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
};
|
|
54
|
+
AwsBedrock.prototype.sendMessageWithStream = function (input) {
|
|
55
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
56
|
+
var command;
|
|
57
|
+
return __generator(this, function (_a) {
|
|
58
|
+
command = new client_bedrock_runtime_1.ConverseStreamCommand(input);
|
|
59
|
+
return [2 /*return*/, this.client.send(command)];
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
};
|
|
63
|
+
AwsBedrock.prototype.sendAsyncRequest = function (input) {
|
|
64
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
65
|
+
var command;
|
|
66
|
+
return __generator(this, function (_a) {
|
|
67
|
+
command = new client_bedrock_runtime_1.StartAsyncInvokeCommand(input);
|
|
68
|
+
return [2 /*return*/, this.client.send(command)];
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
};
|
|
72
|
+
AwsBedrock.prototype.getAsyncRequestStatus = function (input) {
|
|
73
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
74
|
+
var command;
|
|
75
|
+
return __generator(this, function (_a) {
|
|
76
|
+
command = new client_bedrock_runtime_1.GetAsyncInvokeCommand(input);
|
|
77
|
+
return [2 /*return*/, this.client.send(command)];
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
};
|
|
81
|
+
AwsBedrock.prototype.listAsyncRequests = function (input) {
|
|
82
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
83
|
+
var command;
|
|
84
|
+
return __generator(this, function (_a) {
|
|
85
|
+
command = new client_bedrock_runtime_1.ListAsyncInvokesCommand(input);
|
|
86
|
+
return [2 /*return*/, this.client.send(command)];
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
};
|
|
90
|
+
return AwsBedrock;
|
|
91
|
+
}());
|
|
92
|
+
exports.AwsBedrock = AwsBedrock;
|
|
93
|
+
//# sourceMappingURL=Bedrock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Bedrock.js","sourceRoot":"","sources":["../../src/AWS/Bedrock.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0EAgByC;AA6CzC;IAGC,oBAAY,MAAkC;QAC7C,IAAI,CAAC,MAAM,GAAG,IAAI,6CAAoB,CAAC,MAAM,CAAC,CAAC;IAChD,CAAC;IAEK,gCAAW,GAAjB,UAAkB,KAAuB;;;;gBAElC,OAAO,GAAG,IAAI,wCAAe,CAAC,KAAK,CAAC,CAAC;gBAC3C,sBAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,EAAC;;;KACjC;IAEK,0CAAqB,GAA3B,UAA4B,KAAuB;;;;gBAE5C,OAAO,GAAG,IAAI,8CAAqB,CAAC,KAAK,CAAC,CAAC;gBACjD,sBAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,EAAC;;;KACjC;IAEK,qCAAgB,GAAtB,UAAuB,KAAmC;;;;gBACnD,OAAO,GAAG,IAAI,gDAAuB,CAAC,KAAK,CAAC,CAAC;gBACnD,sBAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,EAAC;;;KACjC;IAEK,0CAAqB,GAA3B,UAA4B,KAAiC;;;;gBACtD,OAAO,GAAG,IAAI,8CAAqB,CAAC,KAAK,CAAC,CAAC;gBACjD,sBAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,EAAC;;;KACjC;IAEK,sCAAiB,GAAvB,UAAwB,KAAmC;;;;gBACpD,OAAO,GAAG,IAAI,gDAAuB,CAAC,KAAK,CAAC,CAAC;gBACnD,sBAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,EAAC;;;KACjC;IACF,iBAAC;AAAD,CAAC,AAjCD,IAiCC;AAjCY,gCAAU"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { GuardrailConfiguration, Message, SystemContentBlock } from '@aws-sdk/client-bedrock-runtime/dist-types/models/models_0';
|
|
2
|
+
export interface SendMessageInput {
|
|
3
|
+
/**
|
|
4
|
+
* The model to use for the message.
|
|
5
|
+
* More info: https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids.html#model-ids-arns
|
|
6
|
+
*/
|
|
7
|
+
modelId: string;
|
|
8
|
+
/**
|
|
9
|
+
* The messages to send to the model. Could be text, images, audio, video, etc.
|
|
10
|
+
*/
|
|
11
|
+
messages: Message[];
|
|
12
|
+
/**
|
|
13
|
+
* A prompt that provides instructions or context to the model about the task it should perform, or the persona it should adopt during the conversation.
|
|
14
|
+
*/
|
|
15
|
+
system?: SystemContentBlock[];
|
|
16
|
+
/**
|
|
17
|
+
* The guardrails to apply to the conversation. Guardrails are used to enforce certain rules or constraints on the model's behavior. For example, you can use guardrails to prevent the model from generating certain content or from using certain tools.
|
|
18
|
+
* More info: https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails.html
|
|
19
|
+
*/
|
|
20
|
+
guardrailConfig?: GuardrailConfiguration | undefined;
|
|
21
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BedrockTypes.js","sourceRoot":"","sources":["../../src/AWS/BedrockTypes.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ConverseStreamResponse, StartAsyncInvokeCommandInput, StartAsyncInvokeResponse, GetAsyncInvokeCommandInput, GetAsyncInvokeResponse, ListAsyncInvokesCommandInput, ListAsyncInvokesResponse, ConverseResponse } from '@aws-sdk/client-bedrock-runtime';
|
|
2
|
+
import { IAwsBedrock } from './Bedrock';
|
|
3
|
+
import { SendMessageInput } from './BedrockTypes';
|
|
4
|
+
export declare class MockBedrock implements IAwsBedrock {
|
|
5
|
+
sendMessageWithStream(_input: SendMessageInput): Promise<ConverseStreamResponse>;
|
|
6
|
+
sendAsyncRequest(_input: StartAsyncInvokeCommandInput): Promise<StartAsyncInvokeResponse>;
|
|
7
|
+
getAsyncRequestStatus(_input: GetAsyncInvokeCommandInput): Promise<GetAsyncInvokeResponse>;
|
|
8
|
+
listAsyncRequests(_input: ListAsyncInvokesCommandInput): Promise<ListAsyncInvokesResponse>;
|
|
9
|
+
sendMessage(_input: SendMessageInput): Promise<ConverseResponse>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
|
|
39
|
+
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
|
|
40
|
+
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
41
|
+
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
42
|
+
return i = {}, verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;
|
|
43
|
+
function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }
|
|
44
|
+
function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }
|
|
45
|
+
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
|
46
|
+
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
|
47
|
+
function fulfill(value) { resume("next", value); }
|
|
48
|
+
function reject(value) { resume("throw", value); }
|
|
49
|
+
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
|
50
|
+
};
|
|
51
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
52
|
+
exports.MockBedrock = void 0;
|
|
53
|
+
var client_bedrock_runtime_1 = require("@aws-sdk/client-bedrock-runtime");
|
|
54
|
+
var MockBedrock = /** @class */ (function () {
|
|
55
|
+
function MockBedrock() {
|
|
56
|
+
}
|
|
57
|
+
MockBedrock.prototype.sendMessageWithStream = function (_input) {
|
|
58
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
59
|
+
var asyncIterator, result;
|
|
60
|
+
return __generator(this, function (_a) {
|
|
61
|
+
asyncIterator = (function () {
|
|
62
|
+
return __asyncGenerator(this, arguments, function () {
|
|
63
|
+
var output;
|
|
64
|
+
return __generator(this, function (_a) {
|
|
65
|
+
switch (_a.label) {
|
|
66
|
+
case 0:
|
|
67
|
+
output = {
|
|
68
|
+
messageStart: {
|
|
69
|
+
role: client_bedrock_runtime_1.ConversationRole.USER,
|
|
70
|
+
},
|
|
71
|
+
};
|
|
72
|
+
return [4 /*yield*/, __await(output)];
|
|
73
|
+
case 1: return [4 /*yield*/, _a.sent()];
|
|
74
|
+
case 2:
|
|
75
|
+
_a.sent();
|
|
76
|
+
return [4 /*yield*/, __await({
|
|
77
|
+
messageStop: {
|
|
78
|
+
stopReason: client_bedrock_runtime_1.StopReason.CONTENT_FILTERED,
|
|
79
|
+
},
|
|
80
|
+
})];
|
|
81
|
+
case 3: return [4 /*yield*/, _a.sent()];
|
|
82
|
+
case 4:
|
|
83
|
+
_a.sent();
|
|
84
|
+
return [2 /*return*/];
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
})();
|
|
89
|
+
result = {
|
|
90
|
+
stream: asyncIterator,
|
|
91
|
+
};
|
|
92
|
+
return [2 /*return*/, result];
|
|
93
|
+
});
|
|
94
|
+
});
|
|
95
|
+
};
|
|
96
|
+
MockBedrock.prototype.sendAsyncRequest = function (_input) {
|
|
97
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
98
|
+
return __generator(this, function (_a) {
|
|
99
|
+
return [2 /*return*/, {
|
|
100
|
+
invocationArn: 'arn:aws:bedrock:eu-central-1:123:async-invoke/abc',
|
|
101
|
+
}];
|
|
102
|
+
});
|
|
103
|
+
});
|
|
104
|
+
};
|
|
105
|
+
MockBedrock.prototype.getAsyncRequestStatus = function (_input) {
|
|
106
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
107
|
+
return __generator(this, function (_a) {
|
|
108
|
+
return [2 /*return*/, {
|
|
109
|
+
invocationArn: 'arn:aws:bedrock:eu-central-1:123:async-invoke/abc',
|
|
110
|
+
status: 'Completed',
|
|
111
|
+
modelArn: 'arn:aws:bedrock:eu-central-1:123:model/abc',
|
|
112
|
+
submitTime: new Date(),
|
|
113
|
+
outputDataConfig: undefined,
|
|
114
|
+
}];
|
|
115
|
+
});
|
|
116
|
+
});
|
|
117
|
+
};
|
|
118
|
+
MockBedrock.prototype.listAsyncRequests = function (_input) {
|
|
119
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
120
|
+
return __generator(this, function (_a) {
|
|
121
|
+
return [2 /*return*/, {
|
|
122
|
+
nextToken: undefined,
|
|
123
|
+
asyncInvokeSummaries: [],
|
|
124
|
+
}];
|
|
125
|
+
});
|
|
126
|
+
});
|
|
127
|
+
};
|
|
128
|
+
MockBedrock.prototype.sendMessage = function (_input) {
|
|
129
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
130
|
+
return __generator(this, function (_a) {
|
|
131
|
+
return [2 /*return*/, {
|
|
132
|
+
output: {
|
|
133
|
+
message: {
|
|
134
|
+
content: [{ text: 'Hello, world!' }],
|
|
135
|
+
role: client_bedrock_runtime_1.ConversationRole.ASSISTANT,
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
stopReason: client_bedrock_runtime_1.StopReason.CONTENT_FILTERED,
|
|
139
|
+
usage: { inputTokens: 100, outputTokens: 100, totalTokens: 200 },
|
|
140
|
+
metrics: {
|
|
141
|
+
latencyMs: 100,
|
|
142
|
+
},
|
|
143
|
+
}];
|
|
144
|
+
});
|
|
145
|
+
});
|
|
146
|
+
};
|
|
147
|
+
return MockBedrock;
|
|
148
|
+
}());
|
|
149
|
+
exports.MockBedrock = MockBedrock;
|
|
150
|
+
//# sourceMappingURL=MockBedrock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MockBedrock.js","sourceRoot":"","sources":["../../src/AWS/MockBedrock.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0EAYyC;AAIzC;IAAA;IAwDA,CAAC;IAvDM,2CAAqB,GAA3B,UAA4B,MAAwB;;;;gBAC7C,aAAa,GAAG,CAAC;;;;;;oCAChB,MAAM,GAAyB;wCACpC,YAAY,EAAE;4CACb,IAAI,EAAE,yCAAgB,CAAC,IAAI;yCAC3B;qCACD,CAAC;iEACI,MAAM;wCAAZ,gCAAY;;oCAAZ,SAAY,CAAC;iEACP;4CACL,WAAW,EAAE;gDACZ,UAAU,EAAE,mCAAU,CAAC,gBAAgB;6CACvC;yCACD;wCAJD,gCAIC;;oCAJD,SAIC,CAAC;;;;;iBACF,CAAC,EAAE,CAAC;gBAEC,MAAM,GAA2B;oBACtC,MAAM,EAAE,aAAa;iBACrB,CAAC;gBACF,sBAAO,MAAM,EAAC;;;KACd;IACK,sCAAgB,GAAtB,UAAuB,MAAoC;;;gBAC1D,sBAAO;wBACN,aAAa,EAAE,mDAAmD;qBAClE,EAAC;;;KACF;IACK,2CAAqB,GAA3B,UAA4B,MAAkC;;;gBAC7D,sBAAO;wBACN,aAAa,EAAE,mDAAmD;wBAClE,MAAM,EAAE,WAAW;wBACnB,QAAQ,EAAE,4CAA4C;wBACtD,UAAU,EAAE,IAAI,IAAI,EAAE;wBACtB,gBAAgB,EAAE,SAAS;qBAC3B,EAAC;;;KACF;IACK,uCAAiB,GAAvB,UAAwB,MAAoC;;;gBAC3D,sBAAO;wBACN,SAAS,EAAE,SAAS;wBACpB,oBAAoB,EAAE,EAAE;qBACxB,EAAC;;;KACF;IACK,iCAAW,GAAjB,UAAkB,MAAwB;;;gBACzC,sBAAO;wBACN,MAAM,EAAE;4BACP,OAAO,EAAE;gCACR,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,eAAe,EAAE,CAAC;gCACpC,IAAI,EAAE,yCAAgB,CAAC,SAAS;6BAChC;yBACD;wBACD,UAAU,EAAE,mCAAU,CAAC,gBAAgB;wBACvC,KAAK,EAAE,EAAE,WAAW,EAAE,GAAG,EAAE,YAAY,EAAE,GAAG,EAAE,WAAW,EAAE,GAAG,EAAE;wBAChE,OAAO,EAAE;4BACR,SAAS,EAAE,GAAG;yBACd;qBACD,EAAC;;;KACF;IACF,kBAAC;AAAD,CAAC,AAxDD,IAwDC;AAxDY,kCAAW"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@signageos/lib",
|
|
3
|
-
"version": "23.
|
|
3
|
+
"version": "23.16.0",
|
|
4
4
|
"main": "./dist",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"files": [
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@signageos/amqp": "^0.2.1",
|
|
41
41
|
"@signageos/core": "^1.0.0",
|
|
42
|
-
"@signageos/lib-ci": "23.
|
|
42
|
+
"@signageos/lib-ci": "23.16.0",
|
|
43
43
|
"@signageos/metrics": "^1.0.0",
|
|
44
44
|
"@signageos/redis": "^2.2.0",
|
|
45
45
|
"async-lock": "1.4.0",
|
|
@@ -72,6 +72,7 @@
|
|
|
72
72
|
"zod": "^3.24.1"
|
|
73
73
|
},
|
|
74
74
|
"optionalPeerDependencies": {
|
|
75
|
+
"@aws-sdk/client-bedrock-runtime": "3.962.0",
|
|
75
76
|
"@aws-sdk/client-s3": "3.489.0",
|
|
76
77
|
"@aws-sdk/lib-storage": "3.489.0",
|
|
77
78
|
"@aws-sdk/s3-request-presigner": "3.489.0",
|
|
@@ -90,6 +91,7 @@
|
|
|
90
91
|
"npm": ">=10"
|
|
91
92
|
},
|
|
92
93
|
"devDependencies": {
|
|
94
|
+
"@aws-sdk/client-bedrock-runtime": "3.962.0",
|
|
93
95
|
"@aws-sdk/client-codeartifact": "3.645.0",
|
|
94
96
|
"@aws-sdk/client-s3": "3.489.0",
|
|
95
97
|
"@aws-sdk/lib-storage": "3.489.0",
|