@aws-sdk/client-bedrock-runtime 3.704.0 → 3.705.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/README.md +31 -7
- package/dist-cjs/index.js +464 -112
- package/dist-es/BedrockRuntime.js +6 -0
- package/dist-es/commands/GetAsyncInvokeCommand.js +23 -0
- package/dist-es/commands/ListAsyncInvokesCommand.js +23 -0
- package/dist-es/commands/StartAsyncInvokeCommand.js +23 -0
- package/dist-es/commands/index.js +3 -0
- package/dist-es/index.js +1 -0
- package/dist-es/models/models_0.js +152 -72
- package/dist-es/pagination/Interfaces.js +1 -0
- package/dist-es/pagination/ListAsyncInvokesPaginator.js +4 -0
- package/dist-es/pagination/index.js +2 -0
- package/dist-es/protocols/Aws_restJson1.js +190 -2
- package/dist-types/BedrockRuntime.d.ts +22 -0
- package/dist-types/BedrockRuntimeClient.d.ts +5 -2
- package/dist-types/commands/ApplyGuardrailCommand.d.ts +2 -0
- package/dist-types/commands/ConverseCommand.d.ts +43 -0
- package/dist-types/commands/ConverseStreamCommand.d.ts +23 -0
- package/dist-types/commands/GetAsyncInvokeCommand.d.ts +101 -0
- package/dist-types/commands/ListAsyncInvokesCommand.d.ts +112 -0
- package/dist-types/commands/StartAsyncInvokeCommand.d.ts +124 -0
- package/dist-types/commands/index.d.ts +3 -0
- package/dist-types/index.d.ts +1 -0
- package/dist-types/models/models_0.d.ts +569 -90
- package/dist-types/pagination/Interfaces.d.ts +8 -0
- package/dist-types/pagination/ListAsyncInvokesPaginator.d.ts +7 -0
- package/dist-types/pagination/index.d.ts +2 -0
- package/dist-types/protocols/Aws_restJson1.d.ts +27 -0
- package/dist-types/ts3.4/BedrockRuntime.d.ts +52 -0
- package/dist-types/ts3.4/BedrockRuntimeClient.d.ts +20 -2
- package/dist-types/ts3.4/commands/GetAsyncInvokeCommand.d.ts +50 -0
- package/dist-types/ts3.4/commands/ListAsyncInvokesCommand.d.ts +50 -0
- package/dist-types/ts3.4/commands/StartAsyncInvokeCommand.d.ts +50 -0
- package/dist-types/ts3.4/commands/index.d.ts +3 -0
- package/dist-types/ts3.4/index.d.ts +1 -0
- package/dist-types/ts3.4/models/models_0.d.ts +237 -42
- package/dist-types/ts3.4/pagination/Interfaces.d.ts +6 -0
- package/dist-types/ts3.4/pagination/ListAsyncInvokesPaginator.d.ts +11 -0
- package/dist-types/ts3.4/pagination/index.d.ts +2 -0
- package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +36 -0
- package/package.json +4 -2
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { awsExpectUnion as __expectUnion, loadRestJsonErrorCode, parseJsonBody as parseBody, parseJsonErrorBody as parseErrorBody, } from "@aws-sdk/core";
|
|
2
2
|
import { requestBuilder as rb } from "@smithy/core";
|
|
3
|
-
import { _json, collectBody, decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, isSerializableHeaderValue, limitedParseDouble as __limitedParseDouble, map, serializeFloat as __serializeFloat, take, withBaseException, } from "@smithy/smithy-client";
|
|
3
|
+
import { _json, collectBody, decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, isSerializableHeaderValue, limitedParseDouble as __limitedParseDouble, map, parseRfc3339DateTimeWithOffset as __parseRfc3339DateTimeWithOffset, serializeDateTime as __serializeDateTime, serializeFloat as __serializeFloat, take, withBaseException, } from "@smithy/smithy-client";
|
|
4
|
+
import { v4 as generateIdempotencyToken } from "uuid";
|
|
4
5
|
import { BedrockRuntimeServiceException as __BaseException } from "../models/BedrockRuntimeServiceException";
|
|
5
|
-
import { AccessDeniedException, ContentBlock, DocumentSource, ImageSource, InternalServerException, ModelErrorException, ModelNotReadyException, ModelStreamErrorException, ModelTimeoutException, ResourceNotFoundException, ServiceQuotaExceededException, ServiceUnavailableException, ThrottlingException, Tool, ToolInputSchema, ToolResultContentBlock, ValidationException, } from "../models/models_0";
|
|
6
|
+
import { AccessDeniedException, ConflictException, ContentBlock, DocumentSource, ImageSource, InternalServerException, ModelErrorException, ModelNotReadyException, ModelStreamErrorException, ModelTimeoutException, ResourceNotFoundException, ServiceQuotaExceededException, ServiceUnavailableException, ThrottlingException, Tool, ToolInputSchema, ToolResultContentBlock, ValidationException, VideoSource, } from "../models/models_0";
|
|
6
7
|
export const se_ApplyGuardrailCommand = async (input, context) => {
|
|
7
8
|
const b = rb(input, context);
|
|
8
9
|
const headers = {
|
|
@@ -35,6 +36,7 @@ export const se_ConverseCommand = async (input, context) => {
|
|
|
35
36
|
messages: (_) => se_Messages(_, context),
|
|
36
37
|
performanceConfig: (_) => _json(_),
|
|
37
38
|
promptVariables: (_) => _json(_),
|
|
39
|
+
requestMetadata: (_) => _json(_),
|
|
38
40
|
system: (_) => _json(_),
|
|
39
41
|
toolConfig: (_) => se_ToolConfiguration(_, context),
|
|
40
42
|
}));
|
|
@@ -57,12 +59,22 @@ export const se_ConverseStreamCommand = async (input, context) => {
|
|
|
57
59
|
messages: (_) => se_Messages(_, context),
|
|
58
60
|
performanceConfig: (_) => _json(_),
|
|
59
61
|
promptVariables: (_) => _json(_),
|
|
62
|
+
requestMetadata: (_) => _json(_),
|
|
60
63
|
system: (_) => _json(_),
|
|
61
64
|
toolConfig: (_) => se_ToolConfiguration(_, context),
|
|
62
65
|
}));
|
|
63
66
|
b.m("POST").h(headers).b(body);
|
|
64
67
|
return b.build();
|
|
65
68
|
};
|
|
69
|
+
export const se_GetAsyncInvokeCommand = async (input, context) => {
|
|
70
|
+
const b = rb(input, context);
|
|
71
|
+
const headers = {};
|
|
72
|
+
b.bp("/async-invoke/{invocationArn}");
|
|
73
|
+
b.p("invocationArn", () => input.invocationArn, "{invocationArn}", false);
|
|
74
|
+
let body;
|
|
75
|
+
b.m("GET").h(headers).b(body);
|
|
76
|
+
return b.build();
|
|
77
|
+
};
|
|
66
78
|
export const se_InvokeModelCommand = async (input, context) => {
|
|
67
79
|
const b = rb(input, context);
|
|
68
80
|
const headers = map({}, isSerializableHeaderValue, {
|
|
@@ -101,6 +113,40 @@ export const se_InvokeModelWithResponseStreamCommand = async (input, context) =>
|
|
|
101
113
|
b.m("POST").h(headers).b(body);
|
|
102
114
|
return b.build();
|
|
103
115
|
};
|
|
116
|
+
export const se_ListAsyncInvokesCommand = async (input, context) => {
|
|
117
|
+
const b = rb(input, context);
|
|
118
|
+
const headers = {};
|
|
119
|
+
b.bp("/async-invoke");
|
|
120
|
+
const query = map({
|
|
121
|
+
[_sTA]: [() => input.submitTimeAfter !== void 0, () => __serializeDateTime(input[_sTA]).toString()],
|
|
122
|
+
[_sTB]: [() => input.submitTimeBefore !== void 0, () => __serializeDateTime(input[_sTB]).toString()],
|
|
123
|
+
[_sE]: [, input[_sE]],
|
|
124
|
+
[_mR]: [() => input.maxResults !== void 0, () => input[_mR].toString()],
|
|
125
|
+
[_nT]: [, input[_nT]],
|
|
126
|
+
[_sB]: [, input[_sB]],
|
|
127
|
+
[_sO]: [, input[_sO]],
|
|
128
|
+
});
|
|
129
|
+
let body;
|
|
130
|
+
b.m("GET").h(headers).q(query).b(body);
|
|
131
|
+
return b.build();
|
|
132
|
+
};
|
|
133
|
+
export const se_StartAsyncInvokeCommand = async (input, context) => {
|
|
134
|
+
const b = rb(input, context);
|
|
135
|
+
const headers = {
|
|
136
|
+
"content-type": "application/json",
|
|
137
|
+
};
|
|
138
|
+
b.bp("/async-invoke");
|
|
139
|
+
let body;
|
|
140
|
+
body = JSON.stringify(take(input, {
|
|
141
|
+
clientRequestToken: [true, (_) => _ ?? generateIdempotencyToken()],
|
|
142
|
+
modelId: [],
|
|
143
|
+
modelInput: (_) => se_ModelInputPayload(_, context),
|
|
144
|
+
outputDataConfig: (_) => _json(_),
|
|
145
|
+
tags: (_) => _json(_),
|
|
146
|
+
}));
|
|
147
|
+
b.m("POST").h(headers).b(body);
|
|
148
|
+
return b.build();
|
|
149
|
+
};
|
|
104
150
|
export const de_ApplyGuardrailCommand = async (output, context) => {
|
|
105
151
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
106
152
|
return de_CommandError(output, context);
|
|
@@ -150,6 +196,28 @@ export const de_ConverseStreamCommand = async (output, context) => {
|
|
|
150
196
|
contents.stream = de_ConverseStreamOutput(data, context);
|
|
151
197
|
return contents;
|
|
152
198
|
};
|
|
199
|
+
export const de_GetAsyncInvokeCommand = async (output, context) => {
|
|
200
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
201
|
+
return de_CommandError(output, context);
|
|
202
|
+
}
|
|
203
|
+
const contents = map({
|
|
204
|
+
$metadata: deserializeMetadata(output),
|
|
205
|
+
});
|
|
206
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
207
|
+
const doc = take(data, {
|
|
208
|
+
clientRequestToken: __expectString,
|
|
209
|
+
endTime: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
|
|
210
|
+
failureMessage: __expectString,
|
|
211
|
+
invocationArn: __expectString,
|
|
212
|
+
lastModifiedTime: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
|
|
213
|
+
modelArn: __expectString,
|
|
214
|
+
outputDataConfig: (_) => _json(__expectUnion(_)),
|
|
215
|
+
status: __expectString,
|
|
216
|
+
submitTime: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
|
|
217
|
+
});
|
|
218
|
+
Object.assign(contents, doc);
|
|
219
|
+
return contents;
|
|
220
|
+
};
|
|
153
221
|
export const de_InvokeModelCommand = async (output, context) => {
|
|
154
222
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
155
223
|
return de_CommandError(output, context);
|
|
@@ -176,6 +244,35 @@ export const de_InvokeModelWithResponseStreamCommand = async (output, context) =
|
|
|
176
244
|
contents.body = de_ResponseStream(data, context);
|
|
177
245
|
return contents;
|
|
178
246
|
};
|
|
247
|
+
export const de_ListAsyncInvokesCommand = async (output, context) => {
|
|
248
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
249
|
+
return de_CommandError(output, context);
|
|
250
|
+
}
|
|
251
|
+
const contents = map({
|
|
252
|
+
$metadata: deserializeMetadata(output),
|
|
253
|
+
});
|
|
254
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
255
|
+
const doc = take(data, {
|
|
256
|
+
asyncInvokeSummaries: (_) => de_AsyncInvokeSummaries(_, context),
|
|
257
|
+
nextToken: __expectString,
|
|
258
|
+
});
|
|
259
|
+
Object.assign(contents, doc);
|
|
260
|
+
return contents;
|
|
261
|
+
};
|
|
262
|
+
export const de_StartAsyncInvokeCommand = async (output, context) => {
|
|
263
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
264
|
+
return de_CommandError(output, context);
|
|
265
|
+
}
|
|
266
|
+
const contents = map({
|
|
267
|
+
$metadata: deserializeMetadata(output),
|
|
268
|
+
});
|
|
269
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
270
|
+
const doc = take(data, {
|
|
271
|
+
invocationArn: __expectString,
|
|
272
|
+
});
|
|
273
|
+
Object.assign(contents, doc);
|
|
274
|
+
return contents;
|
|
275
|
+
};
|
|
179
276
|
const de_CommandError = async (output, context) => {
|
|
180
277
|
const parsedOutput = {
|
|
181
278
|
...output,
|
|
@@ -216,6 +313,9 @@ const de_CommandError = async (output, context) => {
|
|
|
216
313
|
case "ModelStreamErrorException":
|
|
217
314
|
case "com.amazonaws.bedrockruntime#ModelStreamErrorException":
|
|
218
315
|
throw await de_ModelStreamErrorExceptionRes(parsedOutput, context);
|
|
316
|
+
case "ConflictException":
|
|
317
|
+
case "com.amazonaws.bedrockruntime#ConflictException":
|
|
318
|
+
throw await de_ConflictExceptionRes(parsedOutput, context);
|
|
219
319
|
default:
|
|
220
320
|
const parsedBody = parsedOutput.body;
|
|
221
321
|
return throwDefaultError({
|
|
@@ -239,6 +339,19 @@ const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
|
|
|
239
339
|
});
|
|
240
340
|
return __decorateServiceException(exception, parsedOutput.body);
|
|
241
341
|
};
|
|
342
|
+
const de_ConflictExceptionRes = async (parsedOutput, context) => {
|
|
343
|
+
const contents = map({});
|
|
344
|
+
const data = parsedOutput.body;
|
|
345
|
+
const doc = take(data, {
|
|
346
|
+
message: __expectString,
|
|
347
|
+
});
|
|
348
|
+
Object.assign(contents, doc);
|
|
349
|
+
const exception = new ConflictException({
|
|
350
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
351
|
+
...contents,
|
|
352
|
+
});
|
|
353
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
354
|
+
};
|
|
242
355
|
const de_InternalServerExceptionRes = async (parsedOutput, context) => {
|
|
243
356
|
const contents = map({});
|
|
244
357
|
const data = parsedOutput.body;
|
|
@@ -565,6 +678,7 @@ const se_ContentBlock = (input, context) => {
|
|
|
565
678
|
text: (value) => ({ text: value }),
|
|
566
679
|
toolResult: (value) => ({ toolResult: se_ToolResultBlock(value, context) }),
|
|
567
680
|
toolUse: (value) => ({ toolUse: se_ToolUseBlock(value, context) }),
|
|
681
|
+
video: (value) => ({ video: se_VideoBlock(value, context) }),
|
|
568
682
|
_: (name, value) => ({ name: value }),
|
|
569
683
|
});
|
|
570
684
|
};
|
|
@@ -621,6 +735,9 @@ const se_Messages = (input, context) => {
|
|
|
621
735
|
return se_Message(entry, context);
|
|
622
736
|
});
|
|
623
737
|
};
|
|
738
|
+
const se_ModelInputPayload = (input, context) => {
|
|
739
|
+
return input;
|
|
740
|
+
};
|
|
624
741
|
const se_Tool = (input, context) => {
|
|
625
742
|
return Tool.visit(input, {
|
|
626
743
|
toolSpec: (value) => ({ toolSpec: se_ToolSpecification(value, context) }),
|
|
@@ -652,6 +769,7 @@ const se_ToolResultContentBlock = (input, context) => {
|
|
|
652
769
|
image: (value) => ({ image: se_ImageBlock(value, context) }),
|
|
653
770
|
json: (value) => ({ json: se_Document(value, context) }),
|
|
654
771
|
text: (value) => ({ text: value }),
|
|
772
|
+
video: (value) => ({ video: se_VideoBlock(value, context) }),
|
|
655
773
|
_: (name, value) => ({ name: value }),
|
|
656
774
|
});
|
|
657
775
|
};
|
|
@@ -683,9 +801,43 @@ const se_ToolUseBlock = (input, context) => {
|
|
|
683
801
|
toolUseId: [],
|
|
684
802
|
});
|
|
685
803
|
};
|
|
804
|
+
const se_VideoBlock = (input, context) => {
|
|
805
|
+
return take(input, {
|
|
806
|
+
format: [],
|
|
807
|
+
source: (_) => se_VideoSource(_, context),
|
|
808
|
+
});
|
|
809
|
+
};
|
|
810
|
+
const se_VideoSource = (input, context) => {
|
|
811
|
+
return VideoSource.visit(input, {
|
|
812
|
+
bytes: (value) => ({ bytes: context.base64Encoder(value) }),
|
|
813
|
+
s3Location: (value) => ({ s3Location: _json(value) }),
|
|
814
|
+
_: (name, value) => ({ name: value }),
|
|
815
|
+
});
|
|
816
|
+
};
|
|
686
817
|
const se_Document = (input, context) => {
|
|
687
818
|
return input;
|
|
688
819
|
};
|
|
820
|
+
const de_AsyncInvokeSummaries = (output, context) => {
|
|
821
|
+
const retVal = (output || [])
|
|
822
|
+
.filter((e) => e != null)
|
|
823
|
+
.map((entry) => {
|
|
824
|
+
return de_AsyncInvokeSummary(entry, context);
|
|
825
|
+
});
|
|
826
|
+
return retVal;
|
|
827
|
+
};
|
|
828
|
+
const de_AsyncInvokeSummary = (output, context) => {
|
|
829
|
+
return take(output, {
|
|
830
|
+
clientRequestToken: __expectString,
|
|
831
|
+
endTime: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
|
|
832
|
+
failureMessage: __expectString,
|
|
833
|
+
invocationArn: __expectString,
|
|
834
|
+
lastModifiedTime: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
|
|
835
|
+
modelArn: __expectString,
|
|
836
|
+
outputDataConfig: (_) => _json(__expectUnion(_)),
|
|
837
|
+
status: __expectString,
|
|
838
|
+
submitTime: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
|
|
839
|
+
});
|
|
840
|
+
};
|
|
689
841
|
const de_ContentBlock = (output, context) => {
|
|
690
842
|
if (output.document != null) {
|
|
691
843
|
return {
|
|
@@ -715,6 +867,11 @@ const de_ContentBlock = (output, context) => {
|
|
|
715
867
|
toolUse: de_ToolUseBlock(output.toolUse, context),
|
|
716
868
|
};
|
|
717
869
|
}
|
|
870
|
+
if (output.video != null) {
|
|
871
|
+
return {
|
|
872
|
+
video: de_VideoBlock(output.video, context),
|
|
873
|
+
};
|
|
874
|
+
}
|
|
718
875
|
return { $unknown: Object.entries(output)[0] };
|
|
719
876
|
};
|
|
720
877
|
const de_ContentBlocks = (output, context) => {
|
|
@@ -887,6 +1044,11 @@ const de_ToolResultContentBlock = (output, context) => {
|
|
|
887
1044
|
if (__expectString(output.text) !== undefined) {
|
|
888
1045
|
return { text: __expectString(output.text) };
|
|
889
1046
|
}
|
|
1047
|
+
if (output.video != null) {
|
|
1048
|
+
return {
|
|
1049
|
+
video: de_VideoBlock(output.video, context),
|
|
1050
|
+
};
|
|
1051
|
+
}
|
|
890
1052
|
return { $unknown: Object.entries(output)[0] };
|
|
891
1053
|
};
|
|
892
1054
|
const de_ToolResultContentBlocks = (output, context) => {
|
|
@@ -904,6 +1066,25 @@ const de_ToolUseBlock = (output, context) => {
|
|
|
904
1066
|
toolUseId: __expectString,
|
|
905
1067
|
});
|
|
906
1068
|
};
|
|
1069
|
+
const de_VideoBlock = (output, context) => {
|
|
1070
|
+
return take(output, {
|
|
1071
|
+
format: __expectString,
|
|
1072
|
+
source: (_) => de_VideoSource(__expectUnion(_), context),
|
|
1073
|
+
});
|
|
1074
|
+
};
|
|
1075
|
+
const de_VideoSource = (output, context) => {
|
|
1076
|
+
if (output.bytes != null) {
|
|
1077
|
+
return {
|
|
1078
|
+
bytes: context.base64Decoder(output.bytes),
|
|
1079
|
+
};
|
|
1080
|
+
}
|
|
1081
|
+
if (output.s3Location != null) {
|
|
1082
|
+
return {
|
|
1083
|
+
s3Location: _json(output.s3Location),
|
|
1084
|
+
};
|
|
1085
|
+
}
|
|
1086
|
+
return { $unknown: Object.entries(output)[0] };
|
|
1087
|
+
};
|
|
907
1088
|
const de_Document = (output, context) => {
|
|
908
1089
|
return output;
|
|
909
1090
|
};
|
|
@@ -919,7 +1100,14 @@ const _cT = "contentType";
|
|
|
919
1100
|
const _ct = "content-type";
|
|
920
1101
|
const _gI = "guardrailIdentifier";
|
|
921
1102
|
const _gV = "guardrailVersion";
|
|
1103
|
+
const _mR = "maxResults";
|
|
1104
|
+
const _nT = "nextToken";
|
|
922
1105
|
const _pCL = "performanceConfigLatency";
|
|
1106
|
+
const _sB = "sortBy";
|
|
1107
|
+
const _sE = "statusEquals";
|
|
1108
|
+
const _sO = "sortOrder";
|
|
1109
|
+
const _sTA = "submitTimeAfter";
|
|
1110
|
+
const _sTB = "submitTimeBefore";
|
|
923
1111
|
const _t = "trace";
|
|
924
1112
|
const _xaba = "x-amzn-bedrock-accept";
|
|
925
1113
|
const _xabct = "x-amzn-bedrock-content-type";
|
|
@@ -3,8 +3,11 @@ import { BedrockRuntimeClient } from "./BedrockRuntimeClient";
|
|
|
3
3
|
import { ApplyGuardrailCommandInput, ApplyGuardrailCommandOutput } from "./commands/ApplyGuardrailCommand";
|
|
4
4
|
import { ConverseCommandInput, ConverseCommandOutput } from "./commands/ConverseCommand";
|
|
5
5
|
import { ConverseStreamCommandInput, ConverseStreamCommandOutput } from "./commands/ConverseStreamCommand";
|
|
6
|
+
import { GetAsyncInvokeCommandInput, GetAsyncInvokeCommandOutput } from "./commands/GetAsyncInvokeCommand";
|
|
6
7
|
import { InvokeModelCommandInput, InvokeModelCommandOutput } from "./commands/InvokeModelCommand";
|
|
7
8
|
import { InvokeModelWithResponseStreamCommandInput, InvokeModelWithResponseStreamCommandOutput } from "./commands/InvokeModelWithResponseStreamCommand";
|
|
9
|
+
import { ListAsyncInvokesCommandInput, ListAsyncInvokesCommandOutput } from "./commands/ListAsyncInvokesCommand";
|
|
10
|
+
import { StartAsyncInvokeCommandInput, StartAsyncInvokeCommandOutput } from "./commands/StartAsyncInvokeCommand";
|
|
8
11
|
export interface BedrockRuntime {
|
|
9
12
|
/**
|
|
10
13
|
* @see {@link ApplyGuardrailCommand}
|
|
@@ -24,6 +27,12 @@ export interface BedrockRuntime {
|
|
|
24
27
|
converseStream(args: ConverseStreamCommandInput, options?: __HttpHandlerOptions): Promise<ConverseStreamCommandOutput>;
|
|
25
28
|
converseStream(args: ConverseStreamCommandInput, cb: (err: any, data?: ConverseStreamCommandOutput) => void): void;
|
|
26
29
|
converseStream(args: ConverseStreamCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: ConverseStreamCommandOutput) => void): void;
|
|
30
|
+
/**
|
|
31
|
+
* @see {@link GetAsyncInvokeCommand}
|
|
32
|
+
*/
|
|
33
|
+
getAsyncInvoke(args: GetAsyncInvokeCommandInput, options?: __HttpHandlerOptions): Promise<GetAsyncInvokeCommandOutput>;
|
|
34
|
+
getAsyncInvoke(args: GetAsyncInvokeCommandInput, cb: (err: any, data?: GetAsyncInvokeCommandOutput) => void): void;
|
|
35
|
+
getAsyncInvoke(args: GetAsyncInvokeCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: GetAsyncInvokeCommandOutput) => void): void;
|
|
27
36
|
/**
|
|
28
37
|
* @see {@link InvokeModelCommand}
|
|
29
38
|
*/
|
|
@@ -36,6 +45,19 @@ export interface BedrockRuntime {
|
|
|
36
45
|
invokeModelWithResponseStream(args: InvokeModelWithResponseStreamCommandInput, options?: __HttpHandlerOptions): Promise<InvokeModelWithResponseStreamCommandOutput>;
|
|
37
46
|
invokeModelWithResponseStream(args: InvokeModelWithResponseStreamCommandInput, cb: (err: any, data?: InvokeModelWithResponseStreamCommandOutput) => void): void;
|
|
38
47
|
invokeModelWithResponseStream(args: InvokeModelWithResponseStreamCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: InvokeModelWithResponseStreamCommandOutput) => void): void;
|
|
48
|
+
/**
|
|
49
|
+
* @see {@link ListAsyncInvokesCommand}
|
|
50
|
+
*/
|
|
51
|
+
listAsyncInvokes(): Promise<ListAsyncInvokesCommandOutput>;
|
|
52
|
+
listAsyncInvokes(args: ListAsyncInvokesCommandInput, options?: __HttpHandlerOptions): Promise<ListAsyncInvokesCommandOutput>;
|
|
53
|
+
listAsyncInvokes(args: ListAsyncInvokesCommandInput, cb: (err: any, data?: ListAsyncInvokesCommandOutput) => void): void;
|
|
54
|
+
listAsyncInvokes(args: ListAsyncInvokesCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: ListAsyncInvokesCommandOutput) => void): void;
|
|
55
|
+
/**
|
|
56
|
+
* @see {@link StartAsyncInvokeCommand}
|
|
57
|
+
*/
|
|
58
|
+
startAsyncInvoke(args: StartAsyncInvokeCommandInput, options?: __HttpHandlerOptions): Promise<StartAsyncInvokeCommandOutput>;
|
|
59
|
+
startAsyncInvoke(args: StartAsyncInvokeCommandInput, cb: (err: any, data?: StartAsyncInvokeCommandOutput) => void): void;
|
|
60
|
+
startAsyncInvoke(args: StartAsyncInvokeCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: StartAsyncInvokeCommandOutput) => void): void;
|
|
39
61
|
}
|
|
40
62
|
/**
|
|
41
63
|
* <p>Describes the API operations for running inference using Amazon Bedrock models.</p>
|
|
@@ -11,19 +11,22 @@ import { HttpAuthSchemeInputConfig, HttpAuthSchemeResolvedConfig } from "./auth/
|
|
|
11
11
|
import { ApplyGuardrailCommandInput, ApplyGuardrailCommandOutput } from "./commands/ApplyGuardrailCommand";
|
|
12
12
|
import { ConverseCommandInput, ConverseCommandOutput } from "./commands/ConverseCommand";
|
|
13
13
|
import { ConverseStreamCommandInput, ConverseStreamCommandOutput } from "./commands/ConverseStreamCommand";
|
|
14
|
+
import { GetAsyncInvokeCommandInput, GetAsyncInvokeCommandOutput } from "./commands/GetAsyncInvokeCommand";
|
|
14
15
|
import { InvokeModelCommandInput, InvokeModelCommandOutput } from "./commands/InvokeModelCommand";
|
|
15
16
|
import { InvokeModelWithResponseStreamCommandInput, InvokeModelWithResponseStreamCommandOutput } from "./commands/InvokeModelWithResponseStreamCommand";
|
|
17
|
+
import { ListAsyncInvokesCommandInput, ListAsyncInvokesCommandOutput } from "./commands/ListAsyncInvokesCommand";
|
|
18
|
+
import { StartAsyncInvokeCommandInput, StartAsyncInvokeCommandOutput } from "./commands/StartAsyncInvokeCommand";
|
|
16
19
|
import { ClientInputEndpointParameters, ClientResolvedEndpointParameters, EndpointParameters } from "./endpoint/EndpointParameters";
|
|
17
20
|
import { RuntimeExtension, RuntimeExtensionsConfig } from "./runtimeExtensions";
|
|
18
21
|
export { __Client };
|
|
19
22
|
/**
|
|
20
23
|
* @public
|
|
21
24
|
*/
|
|
22
|
-
export type ServiceInputTypes = ApplyGuardrailCommandInput | ConverseCommandInput | ConverseStreamCommandInput | InvokeModelCommandInput | InvokeModelWithResponseStreamCommandInput;
|
|
25
|
+
export type ServiceInputTypes = ApplyGuardrailCommandInput | ConverseCommandInput | ConverseStreamCommandInput | GetAsyncInvokeCommandInput | InvokeModelCommandInput | InvokeModelWithResponseStreamCommandInput | ListAsyncInvokesCommandInput | StartAsyncInvokeCommandInput;
|
|
23
26
|
/**
|
|
24
27
|
* @public
|
|
25
28
|
*/
|
|
26
|
-
export type ServiceOutputTypes = ApplyGuardrailCommandOutput | ConverseCommandOutput | ConverseStreamCommandOutput | InvokeModelCommandOutput | InvokeModelWithResponseStreamCommandOutput;
|
|
29
|
+
export type ServiceOutputTypes = ApplyGuardrailCommandOutput | ConverseCommandOutput | ConverseStreamCommandOutput | GetAsyncInvokeCommandOutput | InvokeModelCommandOutput | InvokeModelWithResponseStreamCommandOutput | ListAsyncInvokesCommandOutput | StartAsyncInvokeCommandOutput;
|
|
27
30
|
/**
|
|
28
31
|
* @public
|
|
29
32
|
*/
|
|
@@ -28,6 +28,8 @@ declare const ApplyGuardrailCommand_base: {
|
|
|
28
28
|
};
|
|
29
29
|
/**
|
|
30
30
|
* <p>The action to apply a guardrail.</p>
|
|
31
|
+
* <p>For troubleshooting some of the common errors you might encounter when using the <code>ApplyGuardrail</code> API,
|
|
32
|
+
* see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html">Troubleshooting Amazon Bedrock API Error Codes</a> in the Amazon Bedrock User Guide</p>
|
|
31
33
|
* @example
|
|
32
34
|
* Use a bare-bones client and the command you need to make an API call.
|
|
33
35
|
* ```javascript
|
|
@@ -78,6 +78,16 @@ declare const ConverseCommand_base: {
|
|
|
78
78
|
* bytes: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("")
|
|
79
79
|
* },
|
|
80
80
|
* },
|
|
81
|
+
* video: { // VideoBlock
|
|
82
|
+
* format: "mkv" || "mov" || "mp4" || "webm" || "flv" || "mpeg" || "mpg" || "wmv" || "three_gp", // required
|
|
83
|
+
* source: { // VideoSource Union: only one key present
|
|
84
|
+
* bytes: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("")
|
|
85
|
+
* s3Location: { // S3Location
|
|
86
|
+
* uri: "STRING_VALUE", // required
|
|
87
|
+
* bucketOwner: "STRING_VALUE",
|
|
88
|
+
* },
|
|
89
|
+
* },
|
|
90
|
+
* },
|
|
81
91
|
* toolUse: { // ToolUseBlock
|
|
82
92
|
* toolUseId: "STRING_VALUE", // required
|
|
83
93
|
* name: "STRING_VALUE", // required
|
|
@@ -102,6 +112,16 @@ declare const ConverseCommand_base: {
|
|
|
102
112
|
* bytes: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("")
|
|
103
113
|
* },
|
|
104
114
|
* },
|
|
115
|
+
* video: {
|
|
116
|
+
* format: "mkv" || "mov" || "mp4" || "webm" || "flv" || "mpeg" || "mpg" || "wmv" || "three_gp", // required
|
|
117
|
+
* source: {// Union: only one key present
|
|
118
|
+
* bytes: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("")
|
|
119
|
+
* s3Location: {
|
|
120
|
+
* uri: "STRING_VALUE", // required
|
|
121
|
+
* bucketOwner: "STRING_VALUE",
|
|
122
|
+
* },
|
|
123
|
+
* },
|
|
124
|
+
* },
|
|
105
125
|
* },
|
|
106
126
|
* ],
|
|
107
127
|
* status: "success" || "error",
|
|
@@ -173,6 +193,9 @@ declare const ConverseCommand_base: {
|
|
|
173
193
|
* additionalModelResponseFieldPaths: [ // AdditionalModelResponseFieldPaths
|
|
174
194
|
* "STRING_VALUE",
|
|
175
195
|
* ],
|
|
196
|
+
* requestMetadata: { // RequestMetadata
|
|
197
|
+
* "<keys>": "STRING_VALUE",
|
|
198
|
+
* },
|
|
176
199
|
* performanceConfig: { // PerformanceConfiguration
|
|
177
200
|
* latency: "standard" || "optimized",
|
|
178
201
|
* },
|
|
@@ -199,6 +222,16 @@ declare const ConverseCommand_base: {
|
|
|
199
222
|
* // bytes: new Uint8Array(),
|
|
200
223
|
* // },
|
|
201
224
|
* // },
|
|
225
|
+
* // video: { // VideoBlock
|
|
226
|
+
* // format: "mkv" || "mov" || "mp4" || "webm" || "flv" || "mpeg" || "mpg" || "wmv" || "three_gp", // required
|
|
227
|
+
* // source: { // VideoSource Union: only one key present
|
|
228
|
+
* // bytes: new Uint8Array(),
|
|
229
|
+
* // s3Location: { // S3Location
|
|
230
|
+
* // uri: "STRING_VALUE", // required
|
|
231
|
+
* // bucketOwner: "STRING_VALUE",
|
|
232
|
+
* // },
|
|
233
|
+
* // },
|
|
234
|
+
* // },
|
|
202
235
|
* // toolUse: { // ToolUseBlock
|
|
203
236
|
* // toolUseId: "STRING_VALUE", // required
|
|
204
237
|
* // name: "STRING_VALUE", // required
|
|
@@ -223,6 +256,16 @@ declare const ConverseCommand_base: {
|
|
|
223
256
|
* // bytes: new Uint8Array(),
|
|
224
257
|
* // },
|
|
225
258
|
* // },
|
|
259
|
+
* // video: {
|
|
260
|
+
* // format: "mkv" || "mov" || "mp4" || "webm" || "flv" || "mpeg" || "mpg" || "wmv" || "three_gp", // required
|
|
261
|
+
* // source: {// Union: only one key present
|
|
262
|
+
* // bytes: new Uint8Array(),
|
|
263
|
+
* // s3Location: {
|
|
264
|
+
* // uri: "STRING_VALUE", // required
|
|
265
|
+
* // bucketOwner: "STRING_VALUE",
|
|
266
|
+
* // },
|
|
267
|
+
* // },
|
|
268
|
+
* // },
|
|
226
269
|
* // },
|
|
227
270
|
* // ],
|
|
228
271
|
* // status: "success" || "error",
|
|
@@ -84,6 +84,16 @@ declare const ConverseStreamCommand_base: {
|
|
|
84
84
|
* bytes: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("")
|
|
85
85
|
* },
|
|
86
86
|
* },
|
|
87
|
+
* video: { // VideoBlock
|
|
88
|
+
* format: "mkv" || "mov" || "mp4" || "webm" || "flv" || "mpeg" || "mpg" || "wmv" || "three_gp", // required
|
|
89
|
+
* source: { // VideoSource Union: only one key present
|
|
90
|
+
* bytes: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("")
|
|
91
|
+
* s3Location: { // S3Location
|
|
92
|
+
* uri: "STRING_VALUE", // required
|
|
93
|
+
* bucketOwner: "STRING_VALUE",
|
|
94
|
+
* },
|
|
95
|
+
* },
|
|
96
|
+
* },
|
|
87
97
|
* toolUse: { // ToolUseBlock
|
|
88
98
|
* toolUseId: "STRING_VALUE", // required
|
|
89
99
|
* name: "STRING_VALUE", // required
|
|
@@ -108,6 +118,16 @@ declare const ConverseStreamCommand_base: {
|
|
|
108
118
|
* bytes: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("")
|
|
109
119
|
* },
|
|
110
120
|
* },
|
|
121
|
+
* video: {
|
|
122
|
+
* format: "mkv" || "mov" || "mp4" || "webm" || "flv" || "mpeg" || "mpg" || "wmv" || "three_gp", // required
|
|
123
|
+
* source: {// Union: only one key present
|
|
124
|
+
* bytes: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("")
|
|
125
|
+
* s3Location: {
|
|
126
|
+
* uri: "STRING_VALUE", // required
|
|
127
|
+
* bucketOwner: "STRING_VALUE",
|
|
128
|
+
* },
|
|
129
|
+
* },
|
|
130
|
+
* },
|
|
111
131
|
* },
|
|
112
132
|
* ],
|
|
113
133
|
* status: "success" || "error",
|
|
@@ -180,6 +200,9 @@ declare const ConverseStreamCommand_base: {
|
|
|
180
200
|
* additionalModelResponseFieldPaths: [ // AdditionalModelResponseFieldPaths
|
|
181
201
|
* "STRING_VALUE",
|
|
182
202
|
* ],
|
|
203
|
+
* requestMetadata: { // RequestMetadata
|
|
204
|
+
* "<keys>": "STRING_VALUE",
|
|
205
|
+
* },
|
|
183
206
|
* performanceConfig: { // PerformanceConfiguration
|
|
184
207
|
* latency: "standard" || "optimized",
|
|
185
208
|
* },
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { Command as $Command } from "@smithy/smithy-client";
|
|
2
|
+
import { MetadataBearer as __MetadataBearer } from "@smithy/types";
|
|
3
|
+
import { BedrockRuntimeClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BedrockRuntimeClient";
|
|
4
|
+
import { GetAsyncInvokeRequest, GetAsyncInvokeResponse } from "../models/models_0";
|
|
5
|
+
/**
|
|
6
|
+
* @public
|
|
7
|
+
*/
|
|
8
|
+
export type { __MetadataBearer };
|
|
9
|
+
export { $Command };
|
|
10
|
+
/**
|
|
11
|
+
* @public
|
|
12
|
+
*
|
|
13
|
+
* The input for {@link GetAsyncInvokeCommand}.
|
|
14
|
+
*/
|
|
15
|
+
export interface GetAsyncInvokeCommandInput extends GetAsyncInvokeRequest {
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* @public
|
|
19
|
+
*
|
|
20
|
+
* The output of {@link GetAsyncInvokeCommand}.
|
|
21
|
+
*/
|
|
22
|
+
export interface GetAsyncInvokeCommandOutput extends GetAsyncInvokeResponse, __MetadataBearer {
|
|
23
|
+
}
|
|
24
|
+
declare const GetAsyncInvokeCommand_base: {
|
|
25
|
+
new (input: GetAsyncInvokeCommandInput): import("@smithy/smithy-client").CommandImpl<GetAsyncInvokeCommandInput, GetAsyncInvokeCommandOutput, BedrockRuntimeClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes>;
|
|
26
|
+
new (__0_0: GetAsyncInvokeCommandInput): import("@smithy/smithy-client").CommandImpl<GetAsyncInvokeCommandInput, GetAsyncInvokeCommandOutput, BedrockRuntimeClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes>;
|
|
27
|
+
getEndpointParameterInstructions(): import("@smithy/middleware-endpoint").EndpointParameterInstructions;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* <p>Retrieve information about an asynchronous invocation.</p>
|
|
31
|
+
* @example
|
|
32
|
+
* Use a bare-bones client and the command you need to make an API call.
|
|
33
|
+
* ```javascript
|
|
34
|
+
* import { BedrockRuntimeClient, GetAsyncInvokeCommand } from "@aws-sdk/client-bedrock-runtime"; // ES Modules import
|
|
35
|
+
* // const { BedrockRuntimeClient, GetAsyncInvokeCommand } = require("@aws-sdk/client-bedrock-runtime"); // CommonJS import
|
|
36
|
+
* const client = new BedrockRuntimeClient(config);
|
|
37
|
+
* const input = { // GetAsyncInvokeRequest
|
|
38
|
+
* invocationArn: "STRING_VALUE", // required
|
|
39
|
+
* };
|
|
40
|
+
* const command = new GetAsyncInvokeCommand(input);
|
|
41
|
+
* const response = await client.send(command);
|
|
42
|
+
* // { // GetAsyncInvokeResponse
|
|
43
|
+
* // invocationArn: "STRING_VALUE", // required
|
|
44
|
+
* // modelArn: "STRING_VALUE", // required
|
|
45
|
+
* // clientRequestToken: "STRING_VALUE",
|
|
46
|
+
* // status: "InProgress" || "Completed" || "Failed", // required
|
|
47
|
+
* // failureMessage: "STRING_VALUE",
|
|
48
|
+
* // submitTime: new Date("TIMESTAMP"), // required
|
|
49
|
+
* // lastModifiedTime: new Date("TIMESTAMP"),
|
|
50
|
+
* // endTime: new Date("TIMESTAMP"),
|
|
51
|
+
* // outputDataConfig: { // AsyncInvokeOutputDataConfig Union: only one key present
|
|
52
|
+
* // s3OutputDataConfig: { // AsyncInvokeS3OutputDataConfig
|
|
53
|
+
* // s3Uri: "STRING_VALUE", // required
|
|
54
|
+
* // kmsKeyId: "STRING_VALUE",
|
|
55
|
+
* // bucketOwner: "STRING_VALUE",
|
|
56
|
+
* // },
|
|
57
|
+
* // },
|
|
58
|
+
* // };
|
|
59
|
+
*
|
|
60
|
+
* ```
|
|
61
|
+
*
|
|
62
|
+
* @param GetAsyncInvokeCommandInput - {@link GetAsyncInvokeCommandInput}
|
|
63
|
+
* @returns {@link GetAsyncInvokeCommandOutput}
|
|
64
|
+
* @see {@link GetAsyncInvokeCommandInput} for command's `input` shape.
|
|
65
|
+
* @see {@link GetAsyncInvokeCommandOutput} for command's `response` shape.
|
|
66
|
+
* @see {@link BedrockRuntimeClientResolvedConfig | config} for BedrockRuntimeClient's `config` shape.
|
|
67
|
+
*
|
|
68
|
+
* @throws {@link AccessDeniedException} (client fault)
|
|
69
|
+
* <p>The request is denied because you do not have sufficient permissions to perform the requested action. For troubleshooting this error,
|
|
70
|
+
* see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-access-denied">AccessDeniedException</a> in the Amazon Bedrock User Guide</p>
|
|
71
|
+
*
|
|
72
|
+
* @throws {@link InternalServerException} (server fault)
|
|
73
|
+
* <p>An internal server error occurred. For troubleshooting this error,
|
|
74
|
+
* see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-internal-failure">InternalFailure</a> in the Amazon Bedrock User Guide</p>
|
|
75
|
+
*
|
|
76
|
+
* @throws {@link ThrottlingException} (client fault)
|
|
77
|
+
* <p>Your request was denied due to exceeding the account quotas for <i>Amazon Bedrock</i>. For
|
|
78
|
+
* troubleshooting this error, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-throttling-exception">ThrottlingException</a> in the Amazon Bedrock User Guide</p>
|
|
79
|
+
*
|
|
80
|
+
* @throws {@link ValidationException} (client fault)
|
|
81
|
+
* <p>The input fails to satisfy the constraints specified by <i>Amazon Bedrock</i>. For troubleshooting this error,
|
|
82
|
+
* see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-validation-error">ValidationError</a> in the Amazon Bedrock User Guide</p>
|
|
83
|
+
*
|
|
84
|
+
* @throws {@link BedrockRuntimeServiceException}
|
|
85
|
+
* <p>Base exception class for all service exceptions from BedrockRuntime service.</p>
|
|
86
|
+
*
|
|
87
|
+
* @public
|
|
88
|
+
*/
|
|
89
|
+
export declare class GetAsyncInvokeCommand extends GetAsyncInvokeCommand_base {
|
|
90
|
+
/** @internal type navigation helper, not in runtime. */
|
|
91
|
+
protected static __types: {
|
|
92
|
+
api: {
|
|
93
|
+
input: GetAsyncInvokeRequest;
|
|
94
|
+
output: GetAsyncInvokeResponse;
|
|
95
|
+
};
|
|
96
|
+
sdk: {
|
|
97
|
+
input: GetAsyncInvokeCommandInput;
|
|
98
|
+
output: GetAsyncInvokeCommandOutput;
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
}
|