@aws-sdk/client-bedrock-agent-runtime 3.928.0 → 3.929.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.
Files changed (58) hide show
  1. package/dist-cjs/index.js +3454 -4732
  2. package/dist-cjs/runtimeConfig.shared.js +2 -0
  3. package/dist-es/BedrockAgentRuntimeClient.js +2 -0
  4. package/dist-es/commands/CreateInvocationCommand.js +3 -9
  5. package/dist-es/commands/CreateSessionCommand.js +3 -9
  6. package/dist-es/commands/DeleteAgentMemoryCommand.js +3 -9
  7. package/dist-es/commands/DeleteSessionCommand.js +3 -9
  8. package/dist-es/commands/EndSessionCommand.js +3 -9
  9. package/dist-es/commands/GenerateQueryCommand.js +3 -10
  10. package/dist-es/commands/GetAgentMemoryCommand.js +3 -9
  11. package/dist-es/commands/GetExecutionFlowSnapshotCommand.js +3 -9
  12. package/dist-es/commands/GetFlowExecutionCommand.js +3 -9
  13. package/dist-es/commands/GetInvocationStepCommand.js +3 -10
  14. package/dist-es/commands/GetSessionCommand.js +3 -9
  15. package/dist-es/commands/InvokeAgentCommand.js +3 -11
  16. package/dist-es/commands/InvokeFlowCommand.js +3 -10
  17. package/dist-es/commands/InvokeInlineAgentCommand.js +3 -11
  18. package/dist-es/commands/ListFlowExecutionEventsCommand.js +3 -10
  19. package/dist-es/commands/ListFlowExecutionsCommand.js +3 -9
  20. package/dist-es/commands/ListInvocationStepsCommand.js +3 -9
  21. package/dist-es/commands/ListInvocationsCommand.js +3 -9
  22. package/dist-es/commands/ListSessionsCommand.js +3 -9
  23. package/dist-es/commands/ListTagsForResourceCommand.js +3 -9
  24. package/dist-es/commands/OptimizePromptCommand.js +3 -10
  25. package/dist-es/commands/PutInvocationStepCommand.js +3 -10
  26. package/dist-es/commands/RerankCommand.js +3 -10
  27. package/dist-es/commands/RetrieveAndGenerateCommand.js +3 -10
  28. package/dist-es/commands/RetrieveAndGenerateStreamCommand.js +3 -10
  29. package/dist-es/commands/RetrieveCommand.js +3 -10
  30. package/dist-es/commands/StartFlowExecutionCommand.js +3 -10
  31. package/dist-es/commands/StopFlowExecutionCommand.js +3 -9
  32. package/dist-es/commands/TagResourceCommand.js +3 -9
  33. package/dist-es/commands/UntagResourceCommand.js +3 -9
  34. package/dist-es/commands/UpdateSessionCommand.js +3 -9
  35. package/dist-es/models/models_0.js +0 -922
  36. package/dist-es/models/models_1.js +0 -262
  37. package/dist-es/runtimeConfig.shared.js +2 -0
  38. package/dist-es/schemas/schemas_0.js +3380 -0
  39. package/dist-types/BedrockAgentRuntimeClient.d.ts +10 -1
  40. package/dist-types/models/models_0.d.ts +0 -644
  41. package/dist-types/models/models_1.d.ts +0 -128
  42. package/dist-types/runtimeConfig.browser.d.ts +1 -0
  43. package/dist-types/runtimeConfig.d.ts +1 -0
  44. package/dist-types/runtimeConfig.native.d.ts +1 -0
  45. package/dist-types/runtimeConfig.shared.d.ts +1 -0
  46. package/dist-types/schemas/schemas_0.d.ts +445 -0
  47. package/dist-types/ts3.4/BedrockAgentRuntimeClient.d.ts +4 -0
  48. package/dist-types/ts3.4/models/models_0.d.ts +0 -431
  49. package/dist-types/ts3.4/models/models_1.d.ts +0 -92
  50. package/dist-types/ts3.4/runtimeConfig.browser.d.ts +4 -0
  51. package/dist-types/ts3.4/runtimeConfig.d.ts +4 -0
  52. package/dist-types/ts3.4/runtimeConfig.native.d.ts +4 -0
  53. package/dist-types/ts3.4/runtimeConfig.shared.d.ts +4 -0
  54. package/dist-types/ts3.4/schemas/schemas_0.d.ts +452 -0
  55. package/package.json +2 -2
  56. package/dist-es/protocols/Aws_restJson1.js +0 -3122
  57. package/dist-types/protocols/Aws_restJson1.d.ts +0 -281
  58. package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +0 -380
@@ -1,3122 +0,0 @@
1
- import { awsExpectUnion as __expectUnion, loadRestJsonErrorCode, parseJsonBody as parseBody, parseJsonErrorBody as parseErrorBody, } from "@aws-sdk/core";
2
- import { requestBuilder as rb } from "@smithy/core";
3
- import { _json, collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, expectLong as __expectLong, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, isSerializableHeaderValue, limitedParseDouble as __limitedParseDouble, limitedParseFloat32 as __limitedParseFloat32, map, parseRfc3339DateTimeWithOffset as __parseRfc3339DateTimeWithOffset, serializeDateTime as __serializeDateTime, serializeFloat as __serializeFloat, take, withBaseException, } from "@smithy/smithy-client";
4
- import { BedrockAgentRuntimeServiceException as __BaseException } from "../models/BedrockAgentRuntimeServiceException";
5
- import { AccessDeniedException, BadGatewayException, ConflictException, DependencyFailedException, FlowInputContent, ImageInputSource, InternalServerException, InvocationResultMember, ModelNotReadyException, ResourceNotFoundException, ServiceQuotaExceededException, ThrottlingException, ValidationException, } from "../models/models_0";
6
- import { BedrockSessionContentBlock, ImageSource, InvocationStepPayload, RetrievalFilter, } from "../models/models_1";
7
- export const se_CreateInvocationCommand = async (input, context) => {
8
- const b = rb(input, context);
9
- const headers = {
10
- "content-type": "application/json",
11
- };
12
- b.bp("/sessions/{sessionIdentifier}/invocations");
13
- b.p("sessionIdentifier", () => input.sessionIdentifier, "{sessionIdentifier}", false);
14
- let body;
15
- body = JSON.stringify(take(input, {
16
- description: [],
17
- invocationId: [],
18
- }));
19
- b.m("PUT").h(headers).b(body);
20
- return b.build();
21
- };
22
- export const se_CreateSessionCommand = async (input, context) => {
23
- const b = rb(input, context);
24
- const headers = {
25
- "content-type": "application/json",
26
- };
27
- b.bp("/sessions");
28
- let body;
29
- body = JSON.stringify(take(input, {
30
- encryptionKeyArn: [],
31
- sessionMetadata: (_) => _json(_),
32
- tags: (_) => _json(_),
33
- }));
34
- b.m("PUT").h(headers).b(body);
35
- return b.build();
36
- };
37
- export const se_DeleteAgentMemoryCommand = async (input, context) => {
38
- const b = rb(input, context);
39
- const headers = {};
40
- b.bp("/agents/{agentId}/agentAliases/{agentAliasId}/memories");
41
- b.p("agentId", () => input.agentId, "{agentId}", false);
42
- b.p("agentAliasId", () => input.agentAliasId, "{agentAliasId}", false);
43
- const query = map({
44
- [_mI]: [, input[_mI]],
45
- [_sI]: [, input[_sI]],
46
- });
47
- let body;
48
- b.m("DELETE").h(headers).q(query).b(body);
49
- return b.build();
50
- };
51
- export const se_DeleteSessionCommand = async (input, context) => {
52
- const b = rb(input, context);
53
- const headers = {};
54
- b.bp("/sessions/{sessionIdentifier}");
55
- b.p("sessionIdentifier", () => input.sessionIdentifier, "{sessionIdentifier}", false);
56
- let body;
57
- b.m("DELETE").h(headers).b(body);
58
- return b.build();
59
- };
60
- export const se_EndSessionCommand = async (input, context) => {
61
- const b = rb(input, context);
62
- const headers = {};
63
- b.bp("/sessions/{sessionIdentifier}");
64
- b.p("sessionIdentifier", () => input.sessionIdentifier, "{sessionIdentifier}", false);
65
- let body;
66
- b.m("PATCH").h(headers).b(body);
67
- return b.build();
68
- };
69
- export const se_GenerateQueryCommand = async (input, context) => {
70
- const b = rb(input, context);
71
- const headers = {
72
- "content-type": "application/json",
73
- };
74
- b.bp("/generateQuery");
75
- let body;
76
- body = JSON.stringify(take(input, {
77
- queryGenerationInput: (_) => _json(_),
78
- transformationConfiguration: (_) => _json(_),
79
- }));
80
- b.m("POST").h(headers).b(body);
81
- return b.build();
82
- };
83
- export const se_GetAgentMemoryCommand = async (input, context) => {
84
- const b = rb(input, context);
85
- const headers = {};
86
- b.bp("/agents/{agentId}/agentAliases/{agentAliasId}/memories");
87
- b.p("agentId", () => input.agentId, "{agentId}", false);
88
- b.p("agentAliasId", () => input.agentAliasId, "{agentAliasId}", false);
89
- const query = map({
90
- [_nT]: [, input[_nT]],
91
- [_mIa]: [() => input.maxItems !== void 0, () => input[_mIa].toString()],
92
- [_mT]: [, __expectNonNull(input[_mT], `memoryType`)],
93
- [_mI]: [, __expectNonNull(input[_mI], `memoryId`)],
94
- });
95
- let body;
96
- b.m("GET").h(headers).q(query).b(body);
97
- return b.build();
98
- };
99
- export const se_GetExecutionFlowSnapshotCommand = async (input, context) => {
100
- const b = rb(input, context);
101
- const headers = {};
102
- b.bp("/flows/{flowIdentifier}/aliases/{flowAliasIdentifier}/executions/{executionIdentifier}/flowsnapshot");
103
- b.p("flowIdentifier", () => input.flowIdentifier, "{flowIdentifier}", false);
104
- b.p("flowAliasIdentifier", () => input.flowAliasIdentifier, "{flowAliasIdentifier}", false);
105
- b.p("executionIdentifier", () => input.executionIdentifier, "{executionIdentifier}", false);
106
- let body;
107
- b.m("GET").h(headers).b(body);
108
- return b.build();
109
- };
110
- export const se_GetFlowExecutionCommand = async (input, context) => {
111
- const b = rb(input, context);
112
- const headers = {};
113
- b.bp("/flows/{flowIdentifier}/aliases/{flowAliasIdentifier}/executions/{executionIdentifier}");
114
- b.p("flowIdentifier", () => input.flowIdentifier, "{flowIdentifier}", false);
115
- b.p("flowAliasIdentifier", () => input.flowAliasIdentifier, "{flowAliasIdentifier}", false);
116
- b.p("executionIdentifier", () => input.executionIdentifier, "{executionIdentifier}", false);
117
- let body;
118
- b.m("GET").h(headers).b(body);
119
- return b.build();
120
- };
121
- export const se_GetInvocationStepCommand = async (input, context) => {
122
- const b = rb(input, context);
123
- const headers = {
124
- "content-type": "application/json",
125
- };
126
- b.bp("/sessions/{sessionIdentifier}/invocationSteps/{invocationStepId}");
127
- b.p("invocationStepId", () => input.invocationStepId, "{invocationStepId}", false);
128
- b.p("sessionIdentifier", () => input.sessionIdentifier, "{sessionIdentifier}", false);
129
- let body;
130
- body = JSON.stringify(take(input, {
131
- invocationIdentifier: [],
132
- }));
133
- b.m("POST").h(headers).b(body);
134
- return b.build();
135
- };
136
- export const se_GetSessionCommand = async (input, context) => {
137
- const b = rb(input, context);
138
- const headers = {};
139
- b.bp("/sessions/{sessionIdentifier}");
140
- b.p("sessionIdentifier", () => input.sessionIdentifier, "{sessionIdentifier}", false);
141
- let body;
142
- b.m("GET").h(headers).b(body);
143
- return b.build();
144
- };
145
- export const se_InvokeAgentCommand = async (input, context) => {
146
- const b = rb(input, context);
147
- const headers = map({}, isSerializableHeaderValue, {
148
- "content-type": "application/json",
149
- [_xasa]: input[_sA],
150
- });
151
- b.bp("/agents/{agentId}/agentAliases/{agentAliasId}/sessions/{sessionId}/text");
152
- b.p("agentId", () => input.agentId, "{agentId}", false);
153
- b.p("agentAliasId", () => input.agentAliasId, "{agentAliasId}", false);
154
- b.p("sessionId", () => input.sessionId, "{sessionId}", false);
155
- let body;
156
- body = JSON.stringify(take(input, {
157
- bedrockModelConfigurations: (_) => _json(_),
158
- enableTrace: [],
159
- endSession: [],
160
- inputText: [],
161
- memoryId: [],
162
- promptCreationConfigurations: (_) => _json(_),
163
- sessionState: (_) => se_SessionState(_, context),
164
- streamingConfigurations: (_) => _json(_),
165
- }));
166
- b.m("POST").h(headers).b(body);
167
- return b.build();
168
- };
169
- export const se_InvokeFlowCommand = async (input, context) => {
170
- const b = rb(input, context);
171
- const headers = {
172
- "content-type": "application/json",
173
- };
174
- b.bp("/flows/{flowIdentifier}/aliases/{flowAliasIdentifier}");
175
- b.p("flowIdentifier", () => input.flowIdentifier, "{flowIdentifier}", false);
176
- b.p("flowAliasIdentifier", () => input.flowAliasIdentifier, "{flowAliasIdentifier}", false);
177
- let body;
178
- body = JSON.stringify(take(input, {
179
- enableTrace: [],
180
- executionId: [],
181
- inputs: (_) => se_FlowInputs(_, context),
182
- modelPerformanceConfiguration: (_) => _json(_),
183
- }));
184
- b.m("POST").h(headers).b(body);
185
- return b.build();
186
- };
187
- export const se_InvokeInlineAgentCommand = async (input, context) => {
188
- const b = rb(input, context);
189
- const headers = {
190
- "content-type": "application/json",
191
- };
192
- b.bp("/agents/{sessionId}");
193
- b.p("sessionId", () => input.sessionId, "{sessionId}", false);
194
- let body;
195
- body = JSON.stringify(take(input, {
196
- actionGroups: (_) => _json(_),
197
- agentCollaboration: [],
198
- agentName: [],
199
- bedrockModelConfigurations: (_) => _json(_),
200
- collaboratorConfigurations: (_) => _json(_),
201
- collaborators: (_) => se_Collaborators(_, context),
202
- customOrchestration: (_) => _json(_),
203
- customerEncryptionKeyArn: [],
204
- enableTrace: [],
205
- endSession: [],
206
- foundationModel: [],
207
- guardrailConfiguration: (_) => _json(_),
208
- idleSessionTTLInSeconds: [],
209
- inlineSessionState: (_) => se_InlineSessionState(_, context),
210
- inputText: [],
211
- instruction: [],
212
- knowledgeBases: (_) => se_KnowledgeBases(_, context),
213
- orchestrationType: [],
214
- promptCreationConfigurations: (_) => _json(_),
215
- promptOverrideConfiguration: (_) => se_PromptOverrideConfiguration(_, context),
216
- streamingConfigurations: (_) => _json(_),
217
- }));
218
- b.m("POST").h(headers).b(body);
219
- return b.build();
220
- };
221
- export const se_ListFlowExecutionEventsCommand = async (input, context) => {
222
- const b = rb(input, context);
223
- const headers = {};
224
- b.bp("/flows/{flowIdentifier}/aliases/{flowAliasIdentifier}/executions/{executionIdentifier}/events");
225
- b.p("flowIdentifier", () => input.flowIdentifier, "{flowIdentifier}", false);
226
- b.p("flowAliasIdentifier", () => input.flowAliasIdentifier, "{flowAliasIdentifier}", false);
227
- b.p("executionIdentifier", () => input.executionIdentifier, "{executionIdentifier}", false);
228
- const query = map({
229
- [_mR]: [() => input.maxResults !== void 0, () => input[_mR].toString()],
230
- [_nT]: [, input[_nT]],
231
- [_eT]: [, __expectNonNull(input[_eT], `eventType`)],
232
- });
233
- let body;
234
- b.m("GET").h(headers).q(query).b(body);
235
- return b.build();
236
- };
237
- export const se_ListFlowExecutionsCommand = async (input, context) => {
238
- const b = rb(input, context);
239
- const headers = {};
240
- b.bp("/flows/{flowIdentifier}/executions");
241
- b.p("flowIdentifier", () => input.flowIdentifier, "{flowIdentifier}", false);
242
- const query = map({
243
- [_fAI]: [, input[_fAI]],
244
- [_mR]: [() => input.maxResults !== void 0, () => input[_mR].toString()],
245
- [_nT]: [, input[_nT]],
246
- });
247
- let body;
248
- b.m("GET").h(headers).q(query).b(body);
249
- return b.build();
250
- };
251
- export const se_ListInvocationsCommand = async (input, context) => {
252
- const b = rb(input, context);
253
- const headers = {};
254
- b.bp("/sessions/{sessionIdentifier}/invocations");
255
- b.p("sessionIdentifier", () => input.sessionIdentifier, "{sessionIdentifier}", false);
256
- const query = map({
257
- [_nT]: [, input[_nT]],
258
- [_mR]: [() => input.maxResults !== void 0, () => input[_mR].toString()],
259
- });
260
- let body;
261
- b.m("POST").h(headers).q(query).b(body);
262
- return b.build();
263
- };
264
- export const se_ListInvocationStepsCommand = async (input, context) => {
265
- const b = rb(input, context);
266
- const headers = {
267
- "content-type": "application/json",
268
- };
269
- b.bp("/sessions/{sessionIdentifier}/invocationSteps");
270
- b.p("sessionIdentifier", () => input.sessionIdentifier, "{sessionIdentifier}", false);
271
- const query = map({
272
- [_nT]: [, input[_nT]],
273
- [_mR]: [() => input.maxResults !== void 0, () => input[_mR].toString()],
274
- });
275
- let body;
276
- body = JSON.stringify(take(input, {
277
- invocationIdentifier: [],
278
- }));
279
- b.m("POST").h(headers).q(query).b(body);
280
- return b.build();
281
- };
282
- export const se_ListSessionsCommand = async (input, context) => {
283
- const b = rb(input, context);
284
- const headers = {};
285
- b.bp("/sessions");
286
- const query = map({
287
- [_mR]: [() => input.maxResults !== void 0, () => input[_mR].toString()],
288
- [_nT]: [, input[_nT]],
289
- });
290
- let body;
291
- b.m("POST").h(headers).q(query).b(body);
292
- return b.build();
293
- };
294
- export const se_ListTagsForResourceCommand = async (input, context) => {
295
- const b = rb(input, context);
296
- const headers = {};
297
- b.bp("/tags/{resourceArn}");
298
- b.p("resourceArn", () => input.resourceArn, "{resourceArn}", false);
299
- let body;
300
- b.m("GET").h(headers).b(body);
301
- return b.build();
302
- };
303
- export const se_OptimizePromptCommand = async (input, context) => {
304
- const b = rb(input, context);
305
- const headers = {
306
- "content-type": "application/json",
307
- };
308
- b.bp("/optimize-prompt");
309
- let body;
310
- body = JSON.stringify(take(input, {
311
- input: (_) => _json(_),
312
- targetModelId: [],
313
- }));
314
- b.m("POST").h(headers).b(body);
315
- return b.build();
316
- };
317
- export const se_PutInvocationStepCommand = async (input, context) => {
318
- const b = rb(input, context);
319
- const headers = {
320
- "content-type": "application/json",
321
- };
322
- b.bp("/sessions/{sessionIdentifier}/invocationSteps");
323
- b.p("sessionIdentifier", () => input.sessionIdentifier, "{sessionIdentifier}", false);
324
- let body;
325
- body = JSON.stringify(take(input, {
326
- invocationIdentifier: [],
327
- invocationStepId: [],
328
- invocationStepTime: (_) => __serializeDateTime(_),
329
- payload: (_) => se_InvocationStepPayload(_, context),
330
- }));
331
- b.m("PUT").h(headers).b(body);
332
- return b.build();
333
- };
334
- export const se_RerankCommand = async (input, context) => {
335
- const b = rb(input, context);
336
- const headers = {
337
- "content-type": "application/json",
338
- };
339
- b.bp("/rerank");
340
- let body;
341
- body = JSON.stringify(take(input, {
342
- nextToken: [],
343
- queries: (_) => _json(_),
344
- rerankingConfiguration: (_) => se_RerankingConfiguration(_, context),
345
- sources: (_) => se_RerankSourcesList(_, context),
346
- }));
347
- b.m("POST").h(headers).b(body);
348
- return b.build();
349
- };
350
- export const se_RetrieveCommand = async (input, context) => {
351
- const b = rb(input, context);
352
- const headers = {
353
- "content-type": "application/json",
354
- };
355
- b.bp("/knowledgebases/{knowledgeBaseId}/retrieve");
356
- b.p("knowledgeBaseId", () => input.knowledgeBaseId, "{knowledgeBaseId}", false);
357
- let body;
358
- body = JSON.stringify(take(input, {
359
- guardrailConfiguration: (_) => _json(_),
360
- nextToken: [],
361
- retrievalConfiguration: (_) => se_KnowledgeBaseRetrievalConfiguration(_, context),
362
- retrievalQuery: (_) => _json(_),
363
- }));
364
- b.m("POST").h(headers).b(body);
365
- return b.build();
366
- };
367
- export const se_RetrieveAndGenerateCommand = async (input, context) => {
368
- const b = rb(input, context);
369
- const headers = {
370
- "content-type": "application/json",
371
- };
372
- b.bp("/retrieveAndGenerate");
373
- let body;
374
- body = JSON.stringify(take(input, {
375
- input: (_) => _json(_),
376
- retrieveAndGenerateConfiguration: (_) => se_RetrieveAndGenerateConfiguration(_, context),
377
- sessionConfiguration: (_) => _json(_),
378
- sessionId: [],
379
- }));
380
- b.m("POST").h(headers).b(body);
381
- return b.build();
382
- };
383
- export const se_RetrieveAndGenerateStreamCommand = async (input, context) => {
384
- const b = rb(input, context);
385
- const headers = {
386
- "content-type": "application/json",
387
- };
388
- b.bp("/retrieveAndGenerateStream");
389
- let body;
390
- body = JSON.stringify(take(input, {
391
- input: (_) => _json(_),
392
- retrieveAndGenerateConfiguration: (_) => se_RetrieveAndGenerateConfiguration(_, context),
393
- sessionConfiguration: (_) => _json(_),
394
- sessionId: [],
395
- }));
396
- b.m("POST").h(headers).b(body);
397
- return b.build();
398
- };
399
- export const se_StartFlowExecutionCommand = async (input, context) => {
400
- const b = rb(input, context);
401
- const headers = {
402
- "content-type": "application/json",
403
- };
404
- b.bp("/flows/{flowIdentifier}/aliases/{flowAliasIdentifier}/executions");
405
- b.p("flowIdentifier", () => input.flowIdentifier, "{flowIdentifier}", false);
406
- b.p("flowAliasIdentifier", () => input.flowAliasIdentifier, "{flowAliasIdentifier}", false);
407
- let body;
408
- body = JSON.stringify(take(input, {
409
- flowExecutionName: [],
410
- inputs: (_) => se_FlowInputs(_, context),
411
- modelPerformanceConfiguration: (_) => _json(_),
412
- }));
413
- b.m("POST").h(headers).b(body);
414
- return b.build();
415
- };
416
- export const se_StopFlowExecutionCommand = async (input, context) => {
417
- const b = rb(input, context);
418
- const headers = {};
419
- b.bp("/flows/{flowIdentifier}/aliases/{flowAliasIdentifier}/executions/{executionIdentifier}/stop");
420
- b.p("flowIdentifier", () => input.flowIdentifier, "{flowIdentifier}", false);
421
- b.p("flowAliasIdentifier", () => input.flowAliasIdentifier, "{flowAliasIdentifier}", false);
422
- b.p("executionIdentifier", () => input.executionIdentifier, "{executionIdentifier}", false);
423
- let body;
424
- b.m("POST").h(headers).b(body);
425
- return b.build();
426
- };
427
- export const se_TagResourceCommand = async (input, context) => {
428
- const b = rb(input, context);
429
- const headers = {
430
- "content-type": "application/json",
431
- };
432
- b.bp("/tags/{resourceArn}");
433
- b.p("resourceArn", () => input.resourceArn, "{resourceArn}", false);
434
- let body;
435
- body = JSON.stringify(take(input, {
436
- tags: (_) => _json(_),
437
- }));
438
- b.m("POST").h(headers).b(body);
439
- return b.build();
440
- };
441
- export const se_UntagResourceCommand = async (input, context) => {
442
- const b = rb(input, context);
443
- const headers = {};
444
- b.bp("/tags/{resourceArn}");
445
- b.p("resourceArn", () => input.resourceArn, "{resourceArn}", false);
446
- const query = map({
447
- [_tK]: [__expectNonNull(input.tagKeys, `tagKeys`) != null, () => input[_tK] || []],
448
- });
449
- let body;
450
- b.m("DELETE").h(headers).q(query).b(body);
451
- return b.build();
452
- };
453
- export const se_UpdateSessionCommand = async (input, context) => {
454
- const b = rb(input, context);
455
- const headers = {
456
- "content-type": "application/json",
457
- };
458
- b.bp("/sessions/{sessionIdentifier}");
459
- b.p("sessionIdentifier", () => input.sessionIdentifier, "{sessionIdentifier}", false);
460
- let body;
461
- body = JSON.stringify(take(input, {
462
- sessionMetadata: (_) => _json(_),
463
- }));
464
- b.m("PUT").h(headers).b(body);
465
- return b.build();
466
- };
467
- export const de_CreateInvocationCommand = async (output, context) => {
468
- if (output.statusCode !== 201 && output.statusCode >= 300) {
469
- return de_CommandError(output, context);
470
- }
471
- const contents = map({
472
- $metadata: deserializeMetadata(output),
473
- });
474
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
475
- const doc = take(data, {
476
- createdAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
477
- invocationId: __expectString,
478
- sessionId: __expectString,
479
- });
480
- Object.assign(contents, doc);
481
- return contents;
482
- };
483
- export const de_CreateSessionCommand = async (output, context) => {
484
- if (output.statusCode !== 201 && output.statusCode >= 300) {
485
- return de_CommandError(output, context);
486
- }
487
- const contents = map({
488
- $metadata: deserializeMetadata(output),
489
- });
490
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
491
- const doc = take(data, {
492
- createdAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
493
- sessionArn: __expectString,
494
- sessionId: __expectString,
495
- sessionStatus: __expectString,
496
- });
497
- Object.assign(contents, doc);
498
- return contents;
499
- };
500
- export const de_DeleteAgentMemoryCommand = async (output, context) => {
501
- if (output.statusCode !== 202 && output.statusCode >= 300) {
502
- return de_CommandError(output, context);
503
- }
504
- const contents = map({
505
- $metadata: deserializeMetadata(output),
506
- });
507
- await collectBody(output.body, context);
508
- return contents;
509
- };
510
- export const de_DeleteSessionCommand = async (output, context) => {
511
- if (output.statusCode !== 200 && output.statusCode >= 300) {
512
- return de_CommandError(output, context);
513
- }
514
- const contents = map({
515
- $metadata: deserializeMetadata(output),
516
- });
517
- await collectBody(output.body, context);
518
- return contents;
519
- };
520
- export const de_EndSessionCommand = async (output, context) => {
521
- if (output.statusCode !== 200 && output.statusCode >= 300) {
522
- return de_CommandError(output, context);
523
- }
524
- const contents = map({
525
- $metadata: deserializeMetadata(output),
526
- });
527
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
528
- const doc = take(data, {
529
- sessionArn: __expectString,
530
- sessionId: __expectString,
531
- sessionStatus: __expectString,
532
- });
533
- Object.assign(contents, doc);
534
- return contents;
535
- };
536
- export const de_GenerateQueryCommand = async (output, context) => {
537
- if (output.statusCode !== 200 && output.statusCode >= 300) {
538
- return de_CommandError(output, context);
539
- }
540
- const contents = map({
541
- $metadata: deserializeMetadata(output),
542
- });
543
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
544
- const doc = take(data, {
545
- queries: _json,
546
- });
547
- Object.assign(contents, doc);
548
- return contents;
549
- };
550
- export const de_GetAgentMemoryCommand = async (output, context) => {
551
- if (output.statusCode !== 200 && output.statusCode >= 300) {
552
- return de_CommandError(output, context);
553
- }
554
- const contents = map({
555
- $metadata: deserializeMetadata(output),
556
- });
557
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
558
- const doc = take(data, {
559
- memoryContents: (_) => de_Memories(_, context),
560
- nextToken: __expectString,
561
- });
562
- Object.assign(contents, doc);
563
- return contents;
564
- };
565
- export const de_GetExecutionFlowSnapshotCommand = async (output, context) => {
566
- if (output.statusCode !== 200 && output.statusCode >= 300) {
567
- return de_CommandError(output, context);
568
- }
569
- const contents = map({
570
- $metadata: deserializeMetadata(output),
571
- });
572
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
573
- const doc = take(data, {
574
- customerEncryptionKeyArn: __expectString,
575
- definition: __expectString,
576
- executionRoleArn: __expectString,
577
- flowAliasIdentifier: __expectString,
578
- flowIdentifier: __expectString,
579
- flowVersion: __expectString,
580
- });
581
- Object.assign(contents, doc);
582
- return contents;
583
- };
584
- export const de_GetFlowExecutionCommand = async (output, context) => {
585
- if (output.statusCode !== 200 && output.statusCode >= 300) {
586
- return de_CommandError(output, context);
587
- }
588
- const contents = map({
589
- $metadata: deserializeMetadata(output),
590
- });
591
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
592
- const doc = take(data, {
593
- endedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
594
- errors: _json,
595
- executionArn: __expectString,
596
- flowAliasIdentifier: __expectString,
597
- flowIdentifier: __expectString,
598
- flowVersion: __expectString,
599
- startedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
600
- status: __expectString,
601
- });
602
- Object.assign(contents, doc);
603
- return contents;
604
- };
605
- export const de_GetInvocationStepCommand = async (output, context) => {
606
- if (output.statusCode !== 200 && output.statusCode >= 300) {
607
- return de_CommandError(output, context);
608
- }
609
- const contents = map({
610
- $metadata: deserializeMetadata(output),
611
- });
612
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
613
- const doc = take(data, {
614
- invocationStep: (_) => de_InvocationStep(_, context),
615
- });
616
- Object.assign(contents, doc);
617
- return contents;
618
- };
619
- export const de_GetSessionCommand = async (output, context) => {
620
- if (output.statusCode !== 200 && output.statusCode >= 300) {
621
- return de_CommandError(output, context);
622
- }
623
- const contents = map({
624
- $metadata: deserializeMetadata(output),
625
- });
626
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
627
- const doc = take(data, {
628
- createdAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
629
- encryptionKeyArn: __expectString,
630
- lastUpdatedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
631
- sessionArn: __expectString,
632
- sessionId: __expectString,
633
- sessionMetadata: _json,
634
- sessionStatus: __expectString,
635
- });
636
- Object.assign(contents, doc);
637
- return contents;
638
- };
639
- export const de_InvokeAgentCommand = async (output, context) => {
640
- if (output.statusCode !== 200 && output.statusCode >= 300) {
641
- return de_CommandError(output, context);
642
- }
643
- const contents = map({
644
- $metadata: deserializeMetadata(output),
645
- [_cT]: [, output.headers[_xabact]],
646
- [_sI]: [, output.headers[_xabasi]],
647
- [_mI]: [, output.headers[_xabami]],
648
- });
649
- const data = output.body;
650
- contents.completion = de_ResponseStream(data, context);
651
- return contents;
652
- };
653
- export const de_InvokeFlowCommand = async (output, context) => {
654
- if (output.statusCode !== 200 && output.statusCode >= 300) {
655
- return de_CommandError(output, context);
656
- }
657
- const contents = map({
658
- $metadata: deserializeMetadata(output),
659
- [_eI]: [, output.headers[_xabfei]],
660
- });
661
- const data = output.body;
662
- contents.responseStream = de_FlowResponseStream(data, context);
663
- return contents;
664
- };
665
- export const de_InvokeInlineAgentCommand = async (output, context) => {
666
- if (output.statusCode !== 200 && output.statusCode >= 300) {
667
- return de_CommandError(output, context);
668
- }
669
- const contents = map({
670
- $metadata: deserializeMetadata(output),
671
- [_cT]: [, output.headers[_xabact]],
672
- [_sI]: [, output.headers[_xabasi]],
673
- });
674
- const data = output.body;
675
- contents.completion = de_InlineAgentResponseStream(data, context);
676
- return contents;
677
- };
678
- export const de_ListFlowExecutionEventsCommand = async (output, context) => {
679
- if (output.statusCode !== 200 && output.statusCode >= 300) {
680
- return de_CommandError(output, context);
681
- }
682
- const contents = map({
683
- $metadata: deserializeMetadata(output),
684
- });
685
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
686
- const doc = take(data, {
687
- flowExecutionEvents: (_) => de_FlowExecutionEvents(_, context),
688
- nextToken: __expectString,
689
- });
690
- Object.assign(contents, doc);
691
- return contents;
692
- };
693
- export const de_ListFlowExecutionsCommand = async (output, context) => {
694
- if (output.statusCode !== 200 && output.statusCode >= 300) {
695
- return de_CommandError(output, context);
696
- }
697
- const contents = map({
698
- $metadata: deserializeMetadata(output),
699
- });
700
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
701
- const doc = take(data, {
702
- flowExecutionSummaries: (_) => de_FlowExecutionSummaries(_, context),
703
- nextToken: __expectString,
704
- });
705
- Object.assign(contents, doc);
706
- return contents;
707
- };
708
- export const de_ListInvocationsCommand = async (output, context) => {
709
- if (output.statusCode !== 200 && output.statusCode >= 300) {
710
- return de_CommandError(output, context);
711
- }
712
- const contents = map({
713
- $metadata: deserializeMetadata(output),
714
- });
715
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
716
- const doc = take(data, {
717
- invocationSummaries: (_) => de_InvocationSummaries(_, context),
718
- nextToken: __expectString,
719
- });
720
- Object.assign(contents, doc);
721
- return contents;
722
- };
723
- export const de_ListInvocationStepsCommand = async (output, context) => {
724
- if (output.statusCode !== 200 && output.statusCode >= 300) {
725
- return de_CommandError(output, context);
726
- }
727
- const contents = map({
728
- $metadata: deserializeMetadata(output),
729
- });
730
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
731
- const doc = take(data, {
732
- invocationStepSummaries: (_) => de_InvocationStepSummaries(_, context),
733
- nextToken: __expectString,
734
- });
735
- Object.assign(contents, doc);
736
- return contents;
737
- };
738
- export const de_ListSessionsCommand = async (output, context) => {
739
- if (output.statusCode !== 200 && output.statusCode >= 300) {
740
- return de_CommandError(output, context);
741
- }
742
- const contents = map({
743
- $metadata: deserializeMetadata(output),
744
- });
745
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
746
- const doc = take(data, {
747
- nextToken: __expectString,
748
- sessionSummaries: (_) => de_SessionSummaries(_, context),
749
- });
750
- Object.assign(contents, doc);
751
- return contents;
752
- };
753
- export const de_ListTagsForResourceCommand = async (output, context) => {
754
- if (output.statusCode !== 200 && output.statusCode >= 300) {
755
- return de_CommandError(output, context);
756
- }
757
- const contents = map({
758
- $metadata: deserializeMetadata(output),
759
- });
760
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
761
- const doc = take(data, {
762
- tags: _json,
763
- });
764
- Object.assign(contents, doc);
765
- return contents;
766
- };
767
- export const de_OptimizePromptCommand = async (output, context) => {
768
- if (output.statusCode !== 200 && output.statusCode >= 300) {
769
- return de_CommandError(output, context);
770
- }
771
- const contents = map({
772
- $metadata: deserializeMetadata(output),
773
- });
774
- const data = output.body;
775
- contents.optimizedPrompt = de_OptimizedPromptStream(data, context);
776
- return contents;
777
- };
778
- export const de_PutInvocationStepCommand = async (output, context) => {
779
- if (output.statusCode !== 201 && output.statusCode >= 300) {
780
- return de_CommandError(output, context);
781
- }
782
- const contents = map({
783
- $metadata: deserializeMetadata(output),
784
- });
785
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
786
- const doc = take(data, {
787
- invocationStepId: __expectString,
788
- });
789
- Object.assign(contents, doc);
790
- return contents;
791
- };
792
- export const de_RerankCommand = async (output, context) => {
793
- if (output.statusCode !== 200 && output.statusCode >= 300) {
794
- return de_CommandError(output, context);
795
- }
796
- const contents = map({
797
- $metadata: deserializeMetadata(output),
798
- });
799
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
800
- const doc = take(data, {
801
- nextToken: __expectString,
802
- results: (_) => de_RerankResultsList(_, context),
803
- });
804
- Object.assign(contents, doc);
805
- return contents;
806
- };
807
- export const de_RetrieveCommand = async (output, context) => {
808
- if (output.statusCode !== 200 && output.statusCode >= 300) {
809
- return de_CommandError(output, context);
810
- }
811
- const contents = map({
812
- $metadata: deserializeMetadata(output),
813
- });
814
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
815
- const doc = take(data, {
816
- guardrailAction: __expectString,
817
- nextToken: __expectString,
818
- retrievalResults: (_) => de_KnowledgeBaseRetrievalResults(_, context),
819
- });
820
- Object.assign(contents, doc);
821
- return contents;
822
- };
823
- export const de_RetrieveAndGenerateCommand = async (output, context) => {
824
- if (output.statusCode !== 200 && output.statusCode >= 300) {
825
- return de_CommandError(output, context);
826
- }
827
- const contents = map({
828
- $metadata: deserializeMetadata(output),
829
- });
830
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
831
- const doc = take(data, {
832
- citations: (_) => de_Citations(_, context),
833
- guardrailAction: __expectString,
834
- output: _json,
835
- sessionId: __expectString,
836
- });
837
- Object.assign(contents, doc);
838
- return contents;
839
- };
840
- export const de_RetrieveAndGenerateStreamCommand = async (output, context) => {
841
- if (output.statusCode !== 200 && output.statusCode >= 300) {
842
- return de_CommandError(output, context);
843
- }
844
- const contents = map({
845
- $metadata: deserializeMetadata(output),
846
- [_sI]: [, output.headers[_xabkbsi]],
847
- });
848
- const data = output.body;
849
- contents.stream = de_RetrieveAndGenerateStreamResponseOutput(data, context);
850
- return contents;
851
- };
852
- export const de_StartFlowExecutionCommand = async (output, context) => {
853
- if (output.statusCode !== 200 && output.statusCode >= 300) {
854
- return de_CommandError(output, context);
855
- }
856
- const contents = map({
857
- $metadata: deserializeMetadata(output),
858
- });
859
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
860
- const doc = take(data, {
861
- executionArn: __expectString,
862
- });
863
- Object.assign(contents, doc);
864
- return contents;
865
- };
866
- export const de_StopFlowExecutionCommand = async (output, context) => {
867
- if (output.statusCode !== 200 && output.statusCode >= 300) {
868
- return de_CommandError(output, context);
869
- }
870
- const contents = map({
871
- $metadata: deserializeMetadata(output),
872
- });
873
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
874
- const doc = take(data, {
875
- executionArn: __expectString,
876
- status: __expectString,
877
- });
878
- Object.assign(contents, doc);
879
- return contents;
880
- };
881
- export const de_TagResourceCommand = async (output, context) => {
882
- if (output.statusCode !== 200 && output.statusCode >= 300) {
883
- return de_CommandError(output, context);
884
- }
885
- const contents = map({
886
- $metadata: deserializeMetadata(output),
887
- });
888
- await collectBody(output.body, context);
889
- return contents;
890
- };
891
- export const de_UntagResourceCommand = async (output, context) => {
892
- if (output.statusCode !== 200 && output.statusCode >= 300) {
893
- return de_CommandError(output, context);
894
- }
895
- const contents = map({
896
- $metadata: deserializeMetadata(output),
897
- });
898
- await collectBody(output.body, context);
899
- return contents;
900
- };
901
- export const de_UpdateSessionCommand = async (output, context) => {
902
- if (output.statusCode !== 200 && output.statusCode >= 300) {
903
- return de_CommandError(output, context);
904
- }
905
- const contents = map({
906
- $metadata: deserializeMetadata(output),
907
- });
908
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
909
- const doc = take(data, {
910
- createdAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
911
- lastUpdatedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
912
- sessionArn: __expectString,
913
- sessionId: __expectString,
914
- sessionStatus: __expectString,
915
- });
916
- Object.assign(contents, doc);
917
- return contents;
918
- };
919
- const de_CommandError = async (output, context) => {
920
- const parsedOutput = {
921
- ...output,
922
- body: await parseErrorBody(output.body, context),
923
- };
924
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
925
- switch (errorCode) {
926
- case "AccessDeniedException":
927
- case "com.amazonaws.bedrockagentruntime#AccessDeniedException":
928
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
929
- case "ConflictException":
930
- case "com.amazonaws.bedrockagentruntime#ConflictException":
931
- throw await de_ConflictExceptionRes(parsedOutput, context);
932
- case "InternalServerException":
933
- case "com.amazonaws.bedrockagentruntime#InternalServerException":
934
- throw await de_InternalServerExceptionRes(parsedOutput, context);
935
- case "ResourceNotFoundException":
936
- case "com.amazonaws.bedrockagentruntime#ResourceNotFoundException":
937
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
938
- case "ServiceQuotaExceededException":
939
- case "com.amazonaws.bedrockagentruntime#ServiceQuotaExceededException":
940
- throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
941
- case "ThrottlingException":
942
- case "com.amazonaws.bedrockagentruntime#ThrottlingException":
943
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
944
- case "ValidationException":
945
- case "com.amazonaws.bedrockagentruntime#ValidationException":
946
- throw await de_ValidationExceptionRes(parsedOutput, context);
947
- case "BadGatewayException":
948
- case "com.amazonaws.bedrockagentruntime#BadGatewayException":
949
- throw await de_BadGatewayExceptionRes(parsedOutput, context);
950
- case "DependencyFailedException":
951
- case "com.amazonaws.bedrockagentruntime#DependencyFailedException":
952
- throw await de_DependencyFailedExceptionRes(parsedOutput, context);
953
- case "ModelNotReadyException":
954
- case "com.amazonaws.bedrockagentruntime#ModelNotReadyException":
955
- throw await de_ModelNotReadyExceptionRes(parsedOutput, context);
956
- default:
957
- const parsedBody = parsedOutput.body;
958
- return throwDefaultError({
959
- output,
960
- parsedBody,
961
- errorCode,
962
- });
963
- }
964
- };
965
- const throwDefaultError = withBaseException(__BaseException);
966
- const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
967
- const contents = map({});
968
- const data = parsedOutput.body;
969
- const doc = take(data, {
970
- message: __expectString,
971
- });
972
- Object.assign(contents, doc);
973
- const exception = new AccessDeniedException({
974
- $metadata: deserializeMetadata(parsedOutput),
975
- ...contents,
976
- });
977
- return __decorateServiceException(exception, parsedOutput.body);
978
- };
979
- const de_BadGatewayExceptionRes = async (parsedOutput, context) => {
980
- const contents = map({});
981
- const data = parsedOutput.body;
982
- const doc = take(data, {
983
- message: __expectString,
984
- resourceName: __expectString,
985
- });
986
- Object.assign(contents, doc);
987
- const exception = new BadGatewayException({
988
- $metadata: deserializeMetadata(parsedOutput),
989
- ...contents,
990
- });
991
- return __decorateServiceException(exception, parsedOutput.body);
992
- };
993
- const de_ConflictExceptionRes = async (parsedOutput, context) => {
994
- const contents = map({});
995
- const data = parsedOutput.body;
996
- const doc = take(data, {
997
- message: __expectString,
998
- });
999
- Object.assign(contents, doc);
1000
- const exception = new ConflictException({
1001
- $metadata: deserializeMetadata(parsedOutput),
1002
- ...contents,
1003
- });
1004
- return __decorateServiceException(exception, parsedOutput.body);
1005
- };
1006
- const de_DependencyFailedExceptionRes = async (parsedOutput, context) => {
1007
- const contents = map({});
1008
- const data = parsedOutput.body;
1009
- const doc = take(data, {
1010
- message: __expectString,
1011
- resourceName: __expectString,
1012
- });
1013
- Object.assign(contents, doc);
1014
- const exception = new DependencyFailedException({
1015
- $metadata: deserializeMetadata(parsedOutput),
1016
- ...contents,
1017
- });
1018
- return __decorateServiceException(exception, parsedOutput.body);
1019
- };
1020
- const de_InternalServerExceptionRes = async (parsedOutput, context) => {
1021
- const contents = map({});
1022
- const data = parsedOutput.body;
1023
- const doc = take(data, {
1024
- message: __expectString,
1025
- reason: __expectString,
1026
- });
1027
- Object.assign(contents, doc);
1028
- const exception = new InternalServerException({
1029
- $metadata: deserializeMetadata(parsedOutput),
1030
- ...contents,
1031
- });
1032
- return __decorateServiceException(exception, parsedOutput.body);
1033
- };
1034
- const de_ModelNotReadyExceptionRes = async (parsedOutput, context) => {
1035
- const contents = map({});
1036
- const data = parsedOutput.body;
1037
- const doc = take(data, {
1038
- message: __expectString,
1039
- });
1040
- Object.assign(contents, doc);
1041
- const exception = new ModelNotReadyException({
1042
- $metadata: deserializeMetadata(parsedOutput),
1043
- ...contents,
1044
- });
1045
- return __decorateServiceException(exception, parsedOutput.body);
1046
- };
1047
- const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
1048
- const contents = map({});
1049
- const data = parsedOutput.body;
1050
- const doc = take(data, {
1051
- message: __expectString,
1052
- });
1053
- Object.assign(contents, doc);
1054
- const exception = new ResourceNotFoundException({
1055
- $metadata: deserializeMetadata(parsedOutput),
1056
- ...contents,
1057
- });
1058
- return __decorateServiceException(exception, parsedOutput.body);
1059
- };
1060
- const de_ServiceQuotaExceededExceptionRes = async (parsedOutput, context) => {
1061
- const contents = map({});
1062
- const data = parsedOutput.body;
1063
- const doc = take(data, {
1064
- message: __expectString,
1065
- });
1066
- Object.assign(contents, doc);
1067
- const exception = new ServiceQuotaExceededException({
1068
- $metadata: deserializeMetadata(parsedOutput),
1069
- ...contents,
1070
- });
1071
- return __decorateServiceException(exception, parsedOutput.body);
1072
- };
1073
- const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
1074
- const contents = map({});
1075
- const data = parsedOutput.body;
1076
- const doc = take(data, {
1077
- message: __expectString,
1078
- });
1079
- Object.assign(contents, doc);
1080
- const exception = new ThrottlingException({
1081
- $metadata: deserializeMetadata(parsedOutput),
1082
- ...contents,
1083
- });
1084
- return __decorateServiceException(exception, parsedOutput.body);
1085
- };
1086
- const de_ValidationExceptionRes = async (parsedOutput, context) => {
1087
- const contents = map({});
1088
- const data = parsedOutput.body;
1089
- const doc = take(data, {
1090
- message: __expectString,
1091
- });
1092
- Object.assign(contents, doc);
1093
- const exception = new ValidationException({
1094
- $metadata: deserializeMetadata(parsedOutput),
1095
- ...contents,
1096
- });
1097
- return __decorateServiceException(exception, parsedOutput.body);
1098
- };
1099
- const de_FlowResponseStream = (output, context) => {
1100
- return context.eventStreamMarshaller.deserialize(output, async (event) => {
1101
- if (event["flowOutputEvent"] != null) {
1102
- return {
1103
- flowOutputEvent: await de_FlowOutputEvent_event(event["flowOutputEvent"], context),
1104
- };
1105
- }
1106
- if (event["flowCompletionEvent"] != null) {
1107
- return {
1108
- flowCompletionEvent: await de_FlowCompletionEvent_event(event["flowCompletionEvent"], context),
1109
- };
1110
- }
1111
- if (event["flowTraceEvent"] != null) {
1112
- return {
1113
- flowTraceEvent: await de_FlowTraceEvent_event(event["flowTraceEvent"], context),
1114
- };
1115
- }
1116
- if (event["internalServerException"] != null) {
1117
- return {
1118
- internalServerException: await de_InternalServerException_event(event["internalServerException"], context),
1119
- };
1120
- }
1121
- if (event["validationException"] != null) {
1122
- return {
1123
- validationException: await de_ValidationException_event(event["validationException"], context),
1124
- };
1125
- }
1126
- if (event["resourceNotFoundException"] != null) {
1127
- return {
1128
- resourceNotFoundException: await de_ResourceNotFoundException_event(event["resourceNotFoundException"], context),
1129
- };
1130
- }
1131
- if (event["serviceQuotaExceededException"] != null) {
1132
- return {
1133
- serviceQuotaExceededException: await de_ServiceQuotaExceededException_event(event["serviceQuotaExceededException"], context),
1134
- };
1135
- }
1136
- if (event["throttlingException"] != null) {
1137
- return {
1138
- throttlingException: await de_ThrottlingException_event(event["throttlingException"], context),
1139
- };
1140
- }
1141
- if (event["accessDeniedException"] != null) {
1142
- return {
1143
- accessDeniedException: await de_AccessDeniedException_event(event["accessDeniedException"], context),
1144
- };
1145
- }
1146
- if (event["conflictException"] != null) {
1147
- return {
1148
- conflictException: await de_ConflictException_event(event["conflictException"], context),
1149
- };
1150
- }
1151
- if (event["dependencyFailedException"] != null) {
1152
- return {
1153
- dependencyFailedException: await de_DependencyFailedException_event(event["dependencyFailedException"], context),
1154
- };
1155
- }
1156
- if (event["badGatewayException"] != null) {
1157
- return {
1158
- badGatewayException: await de_BadGatewayException_event(event["badGatewayException"], context),
1159
- };
1160
- }
1161
- if (event["flowMultiTurnInputRequestEvent"] != null) {
1162
- return {
1163
- flowMultiTurnInputRequestEvent: await de_FlowMultiTurnInputRequestEvent_event(event["flowMultiTurnInputRequestEvent"], context),
1164
- };
1165
- }
1166
- return { $unknown: event };
1167
- });
1168
- };
1169
- const de_InlineAgentResponseStream = (output, context) => {
1170
- return context.eventStreamMarshaller.deserialize(output, async (event) => {
1171
- if (event["chunk"] != null) {
1172
- return {
1173
- chunk: await de_InlineAgentPayloadPart_event(event["chunk"], context),
1174
- };
1175
- }
1176
- if (event["trace"] != null) {
1177
- return {
1178
- trace: await de_InlineAgentTracePart_event(event["trace"], context),
1179
- };
1180
- }
1181
- if (event["returnControl"] != null) {
1182
- return {
1183
- returnControl: await de_InlineAgentReturnControlPayload_event(event["returnControl"], context),
1184
- };
1185
- }
1186
- if (event["internalServerException"] != null) {
1187
- return {
1188
- internalServerException: await de_InternalServerException_event(event["internalServerException"], context),
1189
- };
1190
- }
1191
- if (event["validationException"] != null) {
1192
- return {
1193
- validationException: await de_ValidationException_event(event["validationException"], context),
1194
- };
1195
- }
1196
- if (event["resourceNotFoundException"] != null) {
1197
- return {
1198
- resourceNotFoundException: await de_ResourceNotFoundException_event(event["resourceNotFoundException"], context),
1199
- };
1200
- }
1201
- if (event["serviceQuotaExceededException"] != null) {
1202
- return {
1203
- serviceQuotaExceededException: await de_ServiceQuotaExceededException_event(event["serviceQuotaExceededException"], context),
1204
- };
1205
- }
1206
- if (event["throttlingException"] != null) {
1207
- return {
1208
- throttlingException: await de_ThrottlingException_event(event["throttlingException"], context),
1209
- };
1210
- }
1211
- if (event["accessDeniedException"] != null) {
1212
- return {
1213
- accessDeniedException: await de_AccessDeniedException_event(event["accessDeniedException"], context),
1214
- };
1215
- }
1216
- if (event["conflictException"] != null) {
1217
- return {
1218
- conflictException: await de_ConflictException_event(event["conflictException"], context),
1219
- };
1220
- }
1221
- if (event["dependencyFailedException"] != null) {
1222
- return {
1223
- dependencyFailedException: await de_DependencyFailedException_event(event["dependencyFailedException"], context),
1224
- };
1225
- }
1226
- if (event["badGatewayException"] != null) {
1227
- return {
1228
- badGatewayException: await de_BadGatewayException_event(event["badGatewayException"], context),
1229
- };
1230
- }
1231
- if (event["files"] != null) {
1232
- return {
1233
- files: await de_InlineAgentFilePart_event(event["files"], context),
1234
- };
1235
- }
1236
- return { $unknown: event };
1237
- });
1238
- };
1239
- const de_OptimizedPromptStream = (output, context) => {
1240
- return context.eventStreamMarshaller.deserialize(output, async (event) => {
1241
- if (event["optimizedPromptEvent"] != null) {
1242
- return {
1243
- optimizedPromptEvent: await de_OptimizedPromptEvent_event(event["optimizedPromptEvent"], context),
1244
- };
1245
- }
1246
- if (event["analyzePromptEvent"] != null) {
1247
- return {
1248
- analyzePromptEvent: await de_AnalyzePromptEvent_event(event["analyzePromptEvent"], context),
1249
- };
1250
- }
1251
- if (event["internalServerException"] != null) {
1252
- return {
1253
- internalServerException: await de_InternalServerException_event(event["internalServerException"], context),
1254
- };
1255
- }
1256
- if (event["throttlingException"] != null) {
1257
- return {
1258
- throttlingException: await de_ThrottlingException_event(event["throttlingException"], context),
1259
- };
1260
- }
1261
- if (event["validationException"] != null) {
1262
- return {
1263
- validationException: await de_ValidationException_event(event["validationException"], context),
1264
- };
1265
- }
1266
- if (event["dependencyFailedException"] != null) {
1267
- return {
1268
- dependencyFailedException: await de_DependencyFailedException_event(event["dependencyFailedException"], context),
1269
- };
1270
- }
1271
- if (event["accessDeniedException"] != null) {
1272
- return {
1273
- accessDeniedException: await de_AccessDeniedException_event(event["accessDeniedException"], context),
1274
- };
1275
- }
1276
- if (event["badGatewayException"] != null) {
1277
- return {
1278
- badGatewayException: await de_BadGatewayException_event(event["badGatewayException"], context),
1279
- };
1280
- }
1281
- return { $unknown: event };
1282
- });
1283
- };
1284
- const de_ResponseStream = (output, context) => {
1285
- return context.eventStreamMarshaller.deserialize(output, async (event) => {
1286
- if (event["chunk"] != null) {
1287
- return {
1288
- chunk: await de_PayloadPart_event(event["chunk"], context),
1289
- };
1290
- }
1291
- if (event["trace"] != null) {
1292
- return {
1293
- trace: await de_TracePart_event(event["trace"], context),
1294
- };
1295
- }
1296
- if (event["returnControl"] != null) {
1297
- return {
1298
- returnControl: await de_ReturnControlPayload_event(event["returnControl"], context),
1299
- };
1300
- }
1301
- if (event["internalServerException"] != null) {
1302
- return {
1303
- internalServerException: await de_InternalServerException_event(event["internalServerException"], context),
1304
- };
1305
- }
1306
- if (event["validationException"] != null) {
1307
- return {
1308
- validationException: await de_ValidationException_event(event["validationException"], context),
1309
- };
1310
- }
1311
- if (event["resourceNotFoundException"] != null) {
1312
- return {
1313
- resourceNotFoundException: await de_ResourceNotFoundException_event(event["resourceNotFoundException"], context),
1314
- };
1315
- }
1316
- if (event["serviceQuotaExceededException"] != null) {
1317
- return {
1318
- serviceQuotaExceededException: await de_ServiceQuotaExceededException_event(event["serviceQuotaExceededException"], context),
1319
- };
1320
- }
1321
- if (event["throttlingException"] != null) {
1322
- return {
1323
- throttlingException: await de_ThrottlingException_event(event["throttlingException"], context),
1324
- };
1325
- }
1326
- if (event["accessDeniedException"] != null) {
1327
- return {
1328
- accessDeniedException: await de_AccessDeniedException_event(event["accessDeniedException"], context),
1329
- };
1330
- }
1331
- if (event["conflictException"] != null) {
1332
- return {
1333
- conflictException: await de_ConflictException_event(event["conflictException"], context),
1334
- };
1335
- }
1336
- if (event["dependencyFailedException"] != null) {
1337
- return {
1338
- dependencyFailedException: await de_DependencyFailedException_event(event["dependencyFailedException"], context),
1339
- };
1340
- }
1341
- if (event["badGatewayException"] != null) {
1342
- return {
1343
- badGatewayException: await de_BadGatewayException_event(event["badGatewayException"], context),
1344
- };
1345
- }
1346
- if (event["modelNotReadyException"] != null) {
1347
- return {
1348
- modelNotReadyException: await de_ModelNotReadyException_event(event["modelNotReadyException"], context),
1349
- };
1350
- }
1351
- if (event["files"] != null) {
1352
- return {
1353
- files: await de_FilePart_event(event["files"], context),
1354
- };
1355
- }
1356
- return { $unknown: event };
1357
- });
1358
- };
1359
- const de_RetrieveAndGenerateStreamResponseOutput = (output, context) => {
1360
- return context.eventStreamMarshaller.deserialize(output, async (event) => {
1361
- if (event["output"] != null) {
1362
- return {
1363
- output: await de_RetrieveAndGenerateOutputEvent_event(event["output"], context),
1364
- };
1365
- }
1366
- if (event["citation"] != null) {
1367
- return {
1368
- citation: await de_CitationEvent_event(event["citation"], context),
1369
- };
1370
- }
1371
- if (event["guardrail"] != null) {
1372
- return {
1373
- guardrail: await de_GuardrailEvent_event(event["guardrail"], context),
1374
- };
1375
- }
1376
- if (event["internalServerException"] != null) {
1377
- return {
1378
- internalServerException: await de_InternalServerException_event(event["internalServerException"], context),
1379
- };
1380
- }
1381
- if (event["validationException"] != null) {
1382
- return {
1383
- validationException: await de_ValidationException_event(event["validationException"], context),
1384
- };
1385
- }
1386
- if (event["resourceNotFoundException"] != null) {
1387
- return {
1388
- resourceNotFoundException: await de_ResourceNotFoundException_event(event["resourceNotFoundException"], context),
1389
- };
1390
- }
1391
- if (event["serviceQuotaExceededException"] != null) {
1392
- return {
1393
- serviceQuotaExceededException: await de_ServiceQuotaExceededException_event(event["serviceQuotaExceededException"], context),
1394
- };
1395
- }
1396
- if (event["throttlingException"] != null) {
1397
- return {
1398
- throttlingException: await de_ThrottlingException_event(event["throttlingException"], context),
1399
- };
1400
- }
1401
- if (event["accessDeniedException"] != null) {
1402
- return {
1403
- accessDeniedException: await de_AccessDeniedException_event(event["accessDeniedException"], context),
1404
- };
1405
- }
1406
- if (event["conflictException"] != null) {
1407
- return {
1408
- conflictException: await de_ConflictException_event(event["conflictException"], context),
1409
- };
1410
- }
1411
- if (event["dependencyFailedException"] != null) {
1412
- return {
1413
- dependencyFailedException: await de_DependencyFailedException_event(event["dependencyFailedException"], context),
1414
- };
1415
- }
1416
- if (event["badGatewayException"] != null) {
1417
- return {
1418
- badGatewayException: await de_BadGatewayException_event(event["badGatewayException"], context),
1419
- };
1420
- }
1421
- return { $unknown: event };
1422
- });
1423
- };
1424
- const de_AccessDeniedException_event = async (output, context) => {
1425
- const parsedOutput = {
1426
- ...output,
1427
- body: await parseBody(output.body, context),
1428
- };
1429
- return de_AccessDeniedExceptionRes(parsedOutput, context);
1430
- };
1431
- const de_AnalyzePromptEvent_event = async (output, context) => {
1432
- const contents = {};
1433
- const data = await parseBody(output.body, context);
1434
- Object.assign(contents, _json(data));
1435
- return contents;
1436
- };
1437
- const de_BadGatewayException_event = async (output, context) => {
1438
- const parsedOutput = {
1439
- ...output,
1440
- body: await parseBody(output.body, context),
1441
- };
1442
- return de_BadGatewayExceptionRes(parsedOutput, context);
1443
- };
1444
- const de_CitationEvent_event = async (output, context) => {
1445
- const contents = {};
1446
- const data = await parseBody(output.body, context);
1447
- Object.assign(contents, de_CitationEvent(data, context));
1448
- return contents;
1449
- };
1450
- const de_ConflictException_event = async (output, context) => {
1451
- const parsedOutput = {
1452
- ...output,
1453
- body: await parseBody(output.body, context),
1454
- };
1455
- return de_ConflictExceptionRes(parsedOutput, context);
1456
- };
1457
- const de_DependencyFailedException_event = async (output, context) => {
1458
- const parsedOutput = {
1459
- ...output,
1460
- body: await parseBody(output.body, context),
1461
- };
1462
- return de_DependencyFailedExceptionRes(parsedOutput, context);
1463
- };
1464
- const de_FilePart_event = async (output, context) => {
1465
- const contents = {};
1466
- const data = await parseBody(output.body, context);
1467
- Object.assign(contents, de_FilePart(data, context));
1468
- return contents;
1469
- };
1470
- const de_FlowCompletionEvent_event = async (output, context) => {
1471
- const contents = {};
1472
- const data = await parseBody(output.body, context);
1473
- Object.assign(contents, _json(data));
1474
- return contents;
1475
- };
1476
- const de_FlowMultiTurnInputRequestEvent_event = async (output, context) => {
1477
- const contents = {};
1478
- const data = await parseBody(output.body, context);
1479
- Object.assign(contents, de_FlowMultiTurnInputRequestEvent(data, context));
1480
- return contents;
1481
- };
1482
- const de_FlowOutputEvent_event = async (output, context) => {
1483
- const contents = {};
1484
- const data = await parseBody(output.body, context);
1485
- Object.assign(contents, de_FlowOutputEvent(data, context));
1486
- return contents;
1487
- };
1488
- const de_FlowTraceEvent_event = async (output, context) => {
1489
- const contents = {};
1490
- const data = await parseBody(output.body, context);
1491
- Object.assign(contents, de_FlowTraceEvent(data, context));
1492
- return contents;
1493
- };
1494
- const de_GuardrailEvent_event = async (output, context) => {
1495
- const contents = {};
1496
- const data = await parseBody(output.body, context);
1497
- Object.assign(contents, _json(data));
1498
- return contents;
1499
- };
1500
- const de_InlineAgentFilePart_event = async (output, context) => {
1501
- const contents = {};
1502
- const data = await parseBody(output.body, context);
1503
- Object.assign(contents, de_InlineAgentFilePart(data, context));
1504
- return contents;
1505
- };
1506
- const de_InlineAgentPayloadPart_event = async (output, context) => {
1507
- const contents = {};
1508
- const data = await parseBody(output.body, context);
1509
- Object.assign(contents, de_InlineAgentPayloadPart(data, context));
1510
- return contents;
1511
- };
1512
- const de_InlineAgentReturnControlPayload_event = async (output, context) => {
1513
- const contents = {};
1514
- const data = await parseBody(output.body, context);
1515
- Object.assign(contents, _json(data));
1516
- return contents;
1517
- };
1518
- const de_InlineAgentTracePart_event = async (output, context) => {
1519
- const contents = {};
1520
- const data = await parseBody(output.body, context);
1521
- Object.assign(contents, de_InlineAgentTracePart(data, context));
1522
- return contents;
1523
- };
1524
- const de_InternalServerException_event = async (output, context) => {
1525
- const parsedOutput = {
1526
- ...output,
1527
- body: await parseBody(output.body, context),
1528
- };
1529
- return de_InternalServerExceptionRes(parsedOutput, context);
1530
- };
1531
- const de_ModelNotReadyException_event = async (output, context) => {
1532
- const parsedOutput = {
1533
- ...output,
1534
- body: await parseBody(output.body, context),
1535
- };
1536
- return de_ModelNotReadyExceptionRes(parsedOutput, context);
1537
- };
1538
- const de_OptimizedPromptEvent_event = async (output, context) => {
1539
- const contents = {};
1540
- const data = await parseBody(output.body, context);
1541
- Object.assign(contents, _json(data));
1542
- return contents;
1543
- };
1544
- const de_PayloadPart_event = async (output, context) => {
1545
- const contents = {};
1546
- const data = await parseBody(output.body, context);
1547
- Object.assign(contents, de_PayloadPart(data, context));
1548
- return contents;
1549
- };
1550
- const de_ResourceNotFoundException_event = async (output, context) => {
1551
- const parsedOutput = {
1552
- ...output,
1553
- body: await parseBody(output.body, context),
1554
- };
1555
- return de_ResourceNotFoundExceptionRes(parsedOutput, context);
1556
- };
1557
- const de_RetrieveAndGenerateOutputEvent_event = async (output, context) => {
1558
- const contents = {};
1559
- const data = await parseBody(output.body, context);
1560
- Object.assign(contents, _json(data));
1561
- return contents;
1562
- };
1563
- const de_ReturnControlPayload_event = async (output, context) => {
1564
- const contents = {};
1565
- const data = await parseBody(output.body, context);
1566
- Object.assign(contents, _json(data));
1567
- return contents;
1568
- };
1569
- const de_ServiceQuotaExceededException_event = async (output, context) => {
1570
- const parsedOutput = {
1571
- ...output,
1572
- body: await parseBody(output.body, context),
1573
- };
1574
- return de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
1575
- };
1576
- const de_ThrottlingException_event = async (output, context) => {
1577
- const parsedOutput = {
1578
- ...output,
1579
- body: await parseBody(output.body, context),
1580
- };
1581
- return de_ThrottlingExceptionRes(parsedOutput, context);
1582
- };
1583
- const de_TracePart_event = async (output, context) => {
1584
- const contents = {};
1585
- const data = await parseBody(output.body, context);
1586
- Object.assign(contents, de_TracePart(data, context));
1587
- return contents;
1588
- };
1589
- const de_ValidationException_event = async (output, context) => {
1590
- const parsedOutput = {
1591
- ...output,
1592
- body: await parseBody(output.body, context),
1593
- };
1594
- return de_ValidationExceptionRes(parsedOutput, context);
1595
- };
1596
- const se_AdditionalModelRequestFields = (input, context) => {
1597
- return Object.entries(input).reduce((acc, [key, value]) => {
1598
- if (value === null) {
1599
- return acc;
1600
- }
1601
- acc[key] = se_AdditionalModelRequestFieldsValue(value, context);
1602
- return acc;
1603
- }, {});
1604
- };
1605
- const se_AdditionalModelRequestFieldsValue = (input, context) => {
1606
- return input;
1607
- };
1608
- const se_ApiResult = (input, context) => {
1609
- return take(input, {
1610
- actionGroup: [],
1611
- agentId: [],
1612
- apiPath: [],
1613
- confirmationState: [],
1614
- httpMethod: [],
1615
- httpStatusCode: [],
1616
- responseBody: (_) => se_ResponseBody(_, context),
1617
- responseState: [],
1618
- });
1619
- };
1620
- const se_BedrockRerankingConfiguration = (input, context) => {
1621
- return take(input, {
1622
- modelConfiguration: (_) => se_BedrockRerankingModelConfiguration(_, context),
1623
- numberOfResults: [],
1624
- });
1625
- };
1626
- const se_BedrockRerankingModelConfiguration = (input, context) => {
1627
- return take(input, {
1628
- additionalModelRequestFields: (_) => se_AdditionalModelRequestFields(_, context),
1629
- modelArn: [],
1630
- });
1631
- };
1632
- const se_BedrockSessionContentBlock = (input, context) => {
1633
- return BedrockSessionContentBlock.visit(input, {
1634
- image: (value) => ({ image: se_ImageBlock(value, context) }),
1635
- text: (value) => ({ text: value }),
1636
- _: (name, value) => ({ [name]: value }),
1637
- });
1638
- };
1639
- const se_BedrockSessionContentBlocks = (input, context) => {
1640
- return input
1641
- .filter((e) => e != null)
1642
- .map((entry) => {
1643
- return se_BedrockSessionContentBlock(entry, context);
1644
- });
1645
- };
1646
- const se_ByteContentDoc = (input, context) => {
1647
- return take(input, {
1648
- contentType: [],
1649
- data: context.base64Encoder,
1650
- identifier: [],
1651
- });
1652
- };
1653
- const se_ByteContentFile = (input, context) => {
1654
- return take(input, {
1655
- data: context.base64Encoder,
1656
- mediaType: [],
1657
- });
1658
- };
1659
- const se_Collaborator = (input, context) => {
1660
- return take(input, {
1661
- actionGroups: _json,
1662
- agentCollaboration: [],
1663
- agentName: [],
1664
- collaboratorConfigurations: _json,
1665
- customerEncryptionKeyArn: [],
1666
- foundationModel: [],
1667
- guardrailConfiguration: _json,
1668
- idleSessionTTLInSeconds: [],
1669
- instruction: [],
1670
- knowledgeBases: (_) => se_KnowledgeBases(_, context),
1671
- promptOverrideConfiguration: (_) => se_PromptOverrideConfiguration(_, context),
1672
- });
1673
- };
1674
- const se_Collaborators = (input, context) => {
1675
- return input
1676
- .filter((e) => e != null)
1677
- .map((entry) => {
1678
- return se_Collaborator(entry, context);
1679
- });
1680
- };
1681
- const se_ContentBody = (input, context) => {
1682
- return take(input, {
1683
- body: [],
1684
- images: (_) => se_ImageInputs(_, context),
1685
- });
1686
- };
1687
- const se_ExternalSource = (input, context) => {
1688
- return take(input, {
1689
- byteContent: (_) => se_ByteContentDoc(_, context),
1690
- s3Location: _json,
1691
- sourceType: [],
1692
- });
1693
- };
1694
- const se_ExternalSources = (input, context) => {
1695
- return input
1696
- .filter((e) => e != null)
1697
- .map((entry) => {
1698
- return se_ExternalSource(entry, context);
1699
- });
1700
- };
1701
- const se_ExternalSourcesGenerationConfiguration = (input, context) => {
1702
- return take(input, {
1703
- additionalModelRequestFields: (_) => se_AdditionalModelRequestFields(_, context),
1704
- guardrailConfiguration: _json,
1705
- inferenceConfig: (_) => se_InferenceConfig(_, context),
1706
- performanceConfig: _json,
1707
- promptTemplate: _json,
1708
- });
1709
- };
1710
- const se_ExternalSourcesRetrieveAndGenerateConfiguration = (input, context) => {
1711
- return take(input, {
1712
- generationConfiguration: (_) => se_ExternalSourcesGenerationConfiguration(_, context),
1713
- modelArn: [],
1714
- sources: (_) => se_ExternalSources(_, context),
1715
- });
1716
- };
1717
- const se_FileSource = (input, context) => {
1718
- return take(input, {
1719
- byteContent: (_) => se_ByteContentFile(_, context),
1720
- s3Location: _json,
1721
- sourceType: [],
1722
- });
1723
- };
1724
- const se_FilterAttribute = (input, context) => {
1725
- return take(input, {
1726
- key: [],
1727
- value: (_) => se_FilterValue(_, context),
1728
- });
1729
- };
1730
- const se_FilterValue = (input, context) => {
1731
- return input;
1732
- };
1733
- const se_FlowInput = (input, context) => {
1734
- return take(input, {
1735
- content: (_) => se_FlowInputContent(_, context),
1736
- nodeInputName: [],
1737
- nodeName: [],
1738
- nodeOutputName: [],
1739
- });
1740
- };
1741
- const se_FlowInputContent = (input, context) => {
1742
- return FlowInputContent.visit(input, {
1743
- document: (value) => ({ document: se_Document(value, context) }),
1744
- _: (name, value) => ({ [name]: value }),
1745
- });
1746
- };
1747
- const se_FlowInputs = (input, context) => {
1748
- return input
1749
- .filter((e) => e != null)
1750
- .map((entry) => {
1751
- return se_FlowInput(entry, context);
1752
- });
1753
- };
1754
- const se_FunctionResult = (input, context) => {
1755
- return take(input, {
1756
- actionGroup: [],
1757
- agentId: [],
1758
- confirmationState: [],
1759
- function: [],
1760
- responseBody: (_) => se_ResponseBody(_, context),
1761
- responseState: [],
1762
- });
1763
- };
1764
- const se_GenerationConfiguration = (input, context) => {
1765
- return take(input, {
1766
- additionalModelRequestFields: (_) => se_AdditionalModelRequestFields(_, context),
1767
- guardrailConfiguration: _json,
1768
- inferenceConfig: (_) => se_InferenceConfig(_, context),
1769
- performanceConfig: _json,
1770
- promptTemplate: _json,
1771
- });
1772
- };
1773
- const se_ImageBlock = (input, context) => {
1774
- return take(input, {
1775
- format: [],
1776
- source: (_) => se_ImageSource(_, context),
1777
- });
1778
- };
1779
- const se_ImageInput = (input, context) => {
1780
- return take(input, {
1781
- format: [],
1782
- source: (_) => se_ImageInputSource(_, context),
1783
- });
1784
- };
1785
- const se_ImageInputs = (input, context) => {
1786
- return input
1787
- .filter((e) => e != null)
1788
- .map((entry) => {
1789
- return se_ImageInput(entry, context);
1790
- });
1791
- };
1792
- const se_ImageInputSource = (input, context) => {
1793
- return ImageInputSource.visit(input, {
1794
- bytes: (value) => ({ bytes: context.base64Encoder(value) }),
1795
- _: (name, value) => ({ [name]: value }),
1796
- });
1797
- };
1798
- const se_ImageSource = (input, context) => {
1799
- return ImageSource.visit(input, {
1800
- bytes: (value) => ({ bytes: context.base64Encoder(value) }),
1801
- s3Location: (value) => ({ s3Location: _json(value) }),
1802
- _: (name, value) => ({ [name]: value }),
1803
- });
1804
- };
1805
- const se_InferenceConfig = (input, context) => {
1806
- return take(input, {
1807
- textInferenceConfig: (_) => se_TextInferenceConfig(_, context),
1808
- });
1809
- };
1810
- const se_InferenceConfiguration = (input, context) => {
1811
- return take(input, {
1812
- maximumLength: [],
1813
- stopSequences: _json,
1814
- temperature: __serializeFloat,
1815
- topK: [],
1816
- topP: __serializeFloat,
1817
- });
1818
- };
1819
- const se_InlineSessionState = (input, context) => {
1820
- return take(input, {
1821
- conversationHistory: _json,
1822
- files: (_) => se_InputFiles(_, context),
1823
- invocationId: [],
1824
- promptSessionAttributes: _json,
1825
- returnControlInvocationResults: (_) => se_ReturnControlInvocationResults(_, context),
1826
- sessionAttributes: _json,
1827
- });
1828
- };
1829
- const se_InputFile = (input, context) => {
1830
- return take(input, {
1831
- name: [],
1832
- source: (_) => se_FileSource(_, context),
1833
- useCase: [],
1834
- });
1835
- };
1836
- const se_InputFiles = (input, context) => {
1837
- return input
1838
- .filter((e) => e != null)
1839
- .map((entry) => {
1840
- return se_InputFile(entry, context);
1841
- });
1842
- };
1843
- const se_InvocationResultMember = (input, context) => {
1844
- return InvocationResultMember.visit(input, {
1845
- apiResult: (value) => ({ apiResult: se_ApiResult(value, context) }),
1846
- functionResult: (value) => ({ functionResult: se_FunctionResult(value, context) }),
1847
- _: (name, value) => ({ [name]: value }),
1848
- });
1849
- };
1850
- const se_InvocationStepPayload = (input, context) => {
1851
- return InvocationStepPayload.visit(input, {
1852
- contentBlocks: (value) => ({ contentBlocks: se_BedrockSessionContentBlocks(value, context) }),
1853
- _: (name, value) => ({ [name]: value }),
1854
- });
1855
- };
1856
- const se_KnowledgeBase = (input, context) => {
1857
- return take(input, {
1858
- description: [],
1859
- knowledgeBaseId: [],
1860
- retrievalConfiguration: (_) => se_KnowledgeBaseRetrievalConfiguration(_, context),
1861
- });
1862
- };
1863
- const se_KnowledgeBaseConfiguration = (input, context) => {
1864
- return take(input, {
1865
- knowledgeBaseId: [],
1866
- retrievalConfiguration: (_) => se_KnowledgeBaseRetrievalConfiguration(_, context),
1867
- });
1868
- };
1869
- const se_KnowledgeBaseConfigurations = (input, context) => {
1870
- return input
1871
- .filter((e) => e != null)
1872
- .map((entry) => {
1873
- return se_KnowledgeBaseConfiguration(entry, context);
1874
- });
1875
- };
1876
- const se_KnowledgeBaseRetrievalConfiguration = (input, context) => {
1877
- return take(input, {
1878
- vectorSearchConfiguration: (_) => se_KnowledgeBaseVectorSearchConfiguration(_, context),
1879
- });
1880
- };
1881
- const se_KnowledgeBaseRetrieveAndGenerateConfiguration = (input, context) => {
1882
- return take(input, {
1883
- generationConfiguration: (_) => se_GenerationConfiguration(_, context),
1884
- knowledgeBaseId: [],
1885
- modelArn: [],
1886
- orchestrationConfiguration: (_) => se_OrchestrationConfiguration(_, context),
1887
- retrievalConfiguration: (_) => se_KnowledgeBaseRetrievalConfiguration(_, context),
1888
- });
1889
- };
1890
- const se_KnowledgeBases = (input, context) => {
1891
- return input
1892
- .filter((e) => e != null)
1893
- .map((entry) => {
1894
- return se_KnowledgeBase(entry, context);
1895
- });
1896
- };
1897
- const se_KnowledgeBaseVectorSearchConfiguration = (input, context) => {
1898
- return take(input, {
1899
- filter: (_) => se_RetrievalFilter(_, context),
1900
- implicitFilterConfiguration: _json,
1901
- numberOfResults: [],
1902
- overrideSearchType: [],
1903
- rerankingConfiguration: (_) => se_VectorSearchRerankingConfiguration(_, context),
1904
- });
1905
- };
1906
- const se_OrchestrationConfiguration = (input, context) => {
1907
- return take(input, {
1908
- additionalModelRequestFields: (_) => se_AdditionalModelRequestFields(_, context),
1909
- inferenceConfig: (_) => se_InferenceConfig(_, context),
1910
- performanceConfig: _json,
1911
- promptTemplate: _json,
1912
- queryTransformationConfiguration: _json,
1913
- });
1914
- };
1915
- const se_PromptConfiguration = (input, context) => {
1916
- return take(input, {
1917
- additionalModelRequestFields: (_) => se_Document(_, context),
1918
- basePromptTemplate: [],
1919
- foundationModel: [],
1920
- inferenceConfiguration: (_) => se_InferenceConfiguration(_, context),
1921
- parserMode: [],
1922
- promptCreationMode: [],
1923
- promptState: [],
1924
- promptType: [],
1925
- });
1926
- };
1927
- const se_PromptConfigurations = (input, context) => {
1928
- return input
1929
- .filter((e) => e != null)
1930
- .map((entry) => {
1931
- return se_PromptConfiguration(entry, context);
1932
- });
1933
- };
1934
- const se_PromptOverrideConfiguration = (input, context) => {
1935
- return take(input, {
1936
- overrideLambda: [],
1937
- promptConfigurations: (_) => se_PromptConfigurations(_, context),
1938
- });
1939
- };
1940
- const se_RerankDocument = (input, context) => {
1941
- return take(input, {
1942
- jsonDocument: (_) => se_Document(_, context),
1943
- textDocument: _json,
1944
- type: [],
1945
- });
1946
- };
1947
- const se_RerankingConfiguration = (input, context) => {
1948
- return take(input, {
1949
- bedrockRerankingConfiguration: (_) => se_BedrockRerankingConfiguration(_, context),
1950
- type: [],
1951
- });
1952
- };
1953
- const se_RerankSource = (input, context) => {
1954
- return take(input, {
1955
- inlineDocumentSource: (_) => se_RerankDocument(_, context),
1956
- type: [],
1957
- });
1958
- };
1959
- const se_RerankSourcesList = (input, context) => {
1960
- return input
1961
- .filter((e) => e != null)
1962
- .map((entry) => {
1963
- return se_RerankSource(entry, context);
1964
- });
1965
- };
1966
- const se_ResponseBody = (input, context) => {
1967
- return Object.entries(input).reduce((acc, [key, value]) => {
1968
- if (value === null) {
1969
- return acc;
1970
- }
1971
- acc[key] = se_ContentBody(value, context);
1972
- return acc;
1973
- }, {});
1974
- };
1975
- const se_RetrievalFilter = (input, context) => {
1976
- return RetrievalFilter.visit(input, {
1977
- andAll: (value) => ({ andAll: se_RetrievalFilterList(value, context) }),
1978
- equals: (value) => ({ equals: se_FilterAttribute(value, context) }),
1979
- greaterThan: (value) => ({ greaterThan: se_FilterAttribute(value, context) }),
1980
- greaterThanOrEquals: (value) => ({ greaterThanOrEquals: se_FilterAttribute(value, context) }),
1981
- in: (value) => ({ in: se_FilterAttribute(value, context) }),
1982
- lessThan: (value) => ({ lessThan: se_FilterAttribute(value, context) }),
1983
- lessThanOrEquals: (value) => ({ lessThanOrEquals: se_FilterAttribute(value, context) }),
1984
- listContains: (value) => ({ listContains: se_FilterAttribute(value, context) }),
1985
- notEquals: (value) => ({ notEquals: se_FilterAttribute(value, context) }),
1986
- notIn: (value) => ({ notIn: se_FilterAttribute(value, context) }),
1987
- orAll: (value) => ({ orAll: se_RetrievalFilterList(value, context) }),
1988
- startsWith: (value) => ({ startsWith: se_FilterAttribute(value, context) }),
1989
- stringContains: (value) => ({ stringContains: se_FilterAttribute(value, context) }),
1990
- _: (name, value) => ({ [name]: value }),
1991
- });
1992
- };
1993
- const se_RetrievalFilterList = (input, context) => {
1994
- return input
1995
- .filter((e) => e != null)
1996
- .map((entry) => {
1997
- return se_RetrievalFilter(entry, context);
1998
- });
1999
- };
2000
- const se_RetrieveAndGenerateConfiguration = (input, context) => {
2001
- return take(input, {
2002
- externalSourcesConfiguration: (_) => se_ExternalSourcesRetrieveAndGenerateConfiguration(_, context),
2003
- knowledgeBaseConfiguration: (_) => se_KnowledgeBaseRetrieveAndGenerateConfiguration(_, context),
2004
- type: [],
2005
- });
2006
- };
2007
- const se_ReturnControlInvocationResults = (input, context) => {
2008
- return input
2009
- .filter((e) => e != null)
2010
- .map((entry) => {
2011
- return se_InvocationResultMember(entry, context);
2012
- });
2013
- };
2014
- const se_SessionState = (input, context) => {
2015
- return take(input, {
2016
- conversationHistory: _json,
2017
- files: (_) => se_InputFiles(_, context),
2018
- invocationId: [],
2019
- knowledgeBaseConfigurations: (_) => se_KnowledgeBaseConfigurations(_, context),
2020
- promptSessionAttributes: _json,
2021
- returnControlInvocationResults: (_) => se_ReturnControlInvocationResults(_, context),
2022
- sessionAttributes: _json,
2023
- });
2024
- };
2025
- const se_TextInferenceConfig = (input, context) => {
2026
- return take(input, {
2027
- maxTokens: [],
2028
- stopSequences: _json,
2029
- temperature: __serializeFloat,
2030
- topP: __serializeFloat,
2031
- });
2032
- };
2033
- const se_VectorSearchBedrockRerankingConfiguration = (input, context) => {
2034
- return take(input, {
2035
- metadataConfiguration: _json,
2036
- modelConfiguration: (_) => se_VectorSearchBedrockRerankingModelConfiguration(_, context),
2037
- numberOfRerankedResults: [],
2038
- });
2039
- };
2040
- const se_VectorSearchBedrockRerankingModelConfiguration = (input, context) => {
2041
- return take(input, {
2042
- additionalModelRequestFields: (_) => se_AdditionalModelRequestFields(_, context),
2043
- modelArn: [],
2044
- });
2045
- };
2046
- const se_VectorSearchRerankingConfiguration = (input, context) => {
2047
- return take(input, {
2048
- bedrockRerankingConfiguration: (_) => se_VectorSearchBedrockRerankingConfiguration(_, context),
2049
- type: [],
2050
- });
2051
- };
2052
- const se_Document = (input, context) => {
2053
- return input;
2054
- };
2055
- const de_ActionGroupInvocationOutput = (output, context) => {
2056
- return take(output, {
2057
- metadata: (_) => de_Metadata(_, context),
2058
- text: __expectString,
2059
- });
2060
- };
2061
- const de_AgentCollaboratorInputPayload = (output, context) => {
2062
- return take(output, {
2063
- returnControlResults: (_) => de_ReturnControlResults(_, context),
2064
- text: __expectString,
2065
- type: __expectString,
2066
- });
2067
- };
2068
- const de_AgentCollaboratorInvocationInput = (output, context) => {
2069
- return take(output, {
2070
- agentCollaboratorAliasArn: __expectString,
2071
- agentCollaboratorName: __expectString,
2072
- input: (_) => de_AgentCollaboratorInputPayload(_, context),
2073
- });
2074
- };
2075
- const de_AgentCollaboratorInvocationOutput = (output, context) => {
2076
- return take(output, {
2077
- agentCollaboratorAliasArn: __expectString,
2078
- agentCollaboratorName: __expectString,
2079
- metadata: (_) => de_Metadata(_, context),
2080
- output: _json,
2081
- });
2082
- };
2083
- const de_AgentTraces = (output, context) => {
2084
- const retVal = (output || [])
2085
- .filter((e) => e != null)
2086
- .map((entry) => {
2087
- return de_TracePart(entry, context);
2088
- });
2089
- return retVal;
2090
- };
2091
- const de_ApiResult = (output, context) => {
2092
- return take(output, {
2093
- actionGroup: __expectString,
2094
- agentId: __expectString,
2095
- apiPath: __expectString,
2096
- confirmationState: __expectString,
2097
- httpMethod: __expectString,
2098
- httpStatusCode: __expectInt32,
2099
- responseBody: (_) => de_ResponseBody(_, context),
2100
- responseState: __expectString,
2101
- });
2102
- };
2103
- const de_Attribution = (output, context) => {
2104
- return take(output, {
2105
- citations: (_) => de_Citations(_, context),
2106
- });
2107
- };
2108
- const de_BedrockSessionContentBlock = (output, context) => {
2109
- if (output.image != null) {
2110
- return {
2111
- image: de_ImageBlock(output.image, context),
2112
- };
2113
- }
2114
- if (__expectString(output.text) !== undefined) {
2115
- return { text: __expectString(output.text) };
2116
- }
2117
- return { $unknown: Object.entries(output)[0] };
2118
- };
2119
- const de_BedrockSessionContentBlocks = (output, context) => {
2120
- const retVal = (output || [])
2121
- .filter((e) => e != null)
2122
- .map((entry) => {
2123
- return de_BedrockSessionContentBlock(__expectUnion(entry), context);
2124
- });
2125
- return retVal;
2126
- };
2127
- const de_Citation = (output, context) => {
2128
- return take(output, {
2129
- generatedResponsePart: _json,
2130
- retrievedReferences: (_) => de_RetrievedReferences(_, context),
2131
- });
2132
- };
2133
- const de_CitationEvent = (output, context) => {
2134
- return take(output, {
2135
- citation: (_) => de_Citation(_, context),
2136
- generatedResponsePart: _json,
2137
- retrievedReferences: (_) => de_RetrievedReferences(_, context),
2138
- });
2139
- };
2140
- const de_Citations = (output, context) => {
2141
- const retVal = (output || [])
2142
- .filter((e) => e != null)
2143
- .map((entry) => {
2144
- return de_Citation(entry, context);
2145
- });
2146
- return retVal;
2147
- };
2148
- const de_CodeInterpreterInvocationOutput = (output, context) => {
2149
- return take(output, {
2150
- executionError: __expectString,
2151
- executionOutput: __expectString,
2152
- executionTimeout: __expectBoolean,
2153
- files: _json,
2154
- metadata: (_) => de_Metadata(_, context),
2155
- });
2156
- };
2157
- const de_ConditionResultEvent = (output, context) => {
2158
- return take(output, {
2159
- nodeName: __expectString,
2160
- satisfiedConditions: _json,
2161
- timestamp: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
2162
- });
2163
- };
2164
- const de_ContentBody = (output, context) => {
2165
- return take(output, {
2166
- body: __expectString,
2167
- images: (_) => de_ImageInputs(_, context),
2168
- });
2169
- };
2170
- const de_FailureTrace = (output, context) => {
2171
- return take(output, {
2172
- failureCode: __expectInt32,
2173
- failureReason: __expectString,
2174
- metadata: (_) => de_Metadata(_, context),
2175
- traceId: __expectString,
2176
- });
2177
- };
2178
- const de_FilePart = (output, context) => {
2179
- return take(output, {
2180
- files: (_) => de_OutputFiles(_, context),
2181
- });
2182
- };
2183
- const de_FinalResponse = (output, context) => {
2184
- return take(output, {
2185
- metadata: (_) => de_Metadata(_, context),
2186
- text: __expectString,
2187
- });
2188
- };
2189
- const de_FlowExecutionContent = (output, context) => {
2190
- if (output.document != null) {
2191
- return {
2192
- document: de_Document(output.document, context),
2193
- };
2194
- }
2195
- return { $unknown: Object.entries(output)[0] };
2196
- };
2197
- const de_FlowExecutionEvent = (output, context) => {
2198
- if (output.conditionResultEvent != null) {
2199
- return {
2200
- conditionResultEvent: de_ConditionResultEvent(output.conditionResultEvent, context),
2201
- };
2202
- }
2203
- if (output.flowFailureEvent != null) {
2204
- return {
2205
- flowFailureEvent: de_FlowFailureEvent(output.flowFailureEvent, context),
2206
- };
2207
- }
2208
- if (output.flowInputEvent != null) {
2209
- return {
2210
- flowInputEvent: de_FlowExecutionInputEvent(output.flowInputEvent, context),
2211
- };
2212
- }
2213
- if (output.flowOutputEvent != null) {
2214
- return {
2215
- flowOutputEvent: de_FlowExecutionOutputEvent(output.flowOutputEvent, context),
2216
- };
2217
- }
2218
- if (output.nodeActionEvent != null) {
2219
- return {
2220
- nodeActionEvent: de_NodeActionEvent(output.nodeActionEvent, context),
2221
- };
2222
- }
2223
- if (output.nodeDependencyEvent != null) {
2224
- return {
2225
- nodeDependencyEvent: de_NodeDependencyEvent(output.nodeDependencyEvent, context),
2226
- };
2227
- }
2228
- if (output.nodeFailureEvent != null) {
2229
- return {
2230
- nodeFailureEvent: de_NodeFailureEvent(output.nodeFailureEvent, context),
2231
- };
2232
- }
2233
- if (output.nodeInputEvent != null) {
2234
- return {
2235
- nodeInputEvent: de_NodeInputEvent(output.nodeInputEvent, context),
2236
- };
2237
- }
2238
- if (output.nodeOutputEvent != null) {
2239
- return {
2240
- nodeOutputEvent: de_NodeOutputEvent(output.nodeOutputEvent, context),
2241
- };
2242
- }
2243
- return { $unknown: Object.entries(output)[0] };
2244
- };
2245
- const de_FlowExecutionEvents = (output, context) => {
2246
- const retVal = (output || [])
2247
- .filter((e) => e != null)
2248
- .map((entry) => {
2249
- return de_FlowExecutionEvent(__expectUnion(entry), context);
2250
- });
2251
- return retVal;
2252
- };
2253
- const de_FlowExecutionInputEvent = (output, context) => {
2254
- return take(output, {
2255
- fields: (_) => de_FlowInputFields(_, context),
2256
- nodeName: __expectString,
2257
- timestamp: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
2258
- });
2259
- };
2260
- const de_FlowExecutionOutputEvent = (output, context) => {
2261
- return take(output, {
2262
- fields: (_) => de_FlowOutputFields(_, context),
2263
- nodeName: __expectString,
2264
- timestamp: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
2265
- });
2266
- };
2267
- const de_FlowExecutionSummaries = (output, context) => {
2268
- const retVal = (output || [])
2269
- .filter((e) => e != null)
2270
- .map((entry) => {
2271
- return de_FlowExecutionSummary(entry, context);
2272
- });
2273
- return retVal;
2274
- };
2275
- const de_FlowExecutionSummary = (output, context) => {
2276
- return take(output, {
2277
- createdAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
2278
- endedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
2279
- executionArn: __expectString,
2280
- flowAliasIdentifier: __expectString,
2281
- flowIdentifier: __expectString,
2282
- flowVersion: __expectString,
2283
- status: __expectString,
2284
- });
2285
- };
2286
- const de_FlowFailureEvent = (output, context) => {
2287
- return take(output, {
2288
- errorCode: __expectString,
2289
- errorMessage: __expectString,
2290
- timestamp: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
2291
- });
2292
- };
2293
- const de_FlowInputField = (output, context) => {
2294
- return take(output, {
2295
- content: (_) => de_FlowExecutionContent(__expectUnion(_), context),
2296
- name: __expectString,
2297
- });
2298
- };
2299
- const de_FlowInputFields = (output, context) => {
2300
- const retVal = (output || [])
2301
- .filter((e) => e != null)
2302
- .map((entry) => {
2303
- return de_FlowInputField(entry, context);
2304
- });
2305
- return retVal;
2306
- };
2307
- const de_FlowMultiTurnInputContent = (output, context) => {
2308
- if (output.document != null) {
2309
- return {
2310
- document: de_Document(output.document, context),
2311
- };
2312
- }
2313
- return { $unknown: Object.entries(output)[0] };
2314
- };
2315
- const de_FlowMultiTurnInputRequestEvent = (output, context) => {
2316
- return take(output, {
2317
- content: (_) => de_FlowMultiTurnInputContent(__expectUnion(_), context),
2318
- nodeName: __expectString,
2319
- nodeType: __expectString,
2320
- });
2321
- };
2322
- const de_FlowOutputContent = (output, context) => {
2323
- if (output.document != null) {
2324
- return {
2325
- document: de_Document(output.document, context),
2326
- };
2327
- }
2328
- return { $unknown: Object.entries(output)[0] };
2329
- };
2330
- const de_FlowOutputEvent = (output, context) => {
2331
- return take(output, {
2332
- content: (_) => de_FlowOutputContent(__expectUnion(_), context),
2333
- nodeName: __expectString,
2334
- nodeType: __expectString,
2335
- });
2336
- };
2337
- const de_FlowOutputField = (output, context) => {
2338
- return take(output, {
2339
- content: (_) => de_FlowExecutionContent(__expectUnion(_), context),
2340
- name: __expectString,
2341
- });
2342
- };
2343
- const de_FlowOutputFields = (output, context) => {
2344
- const retVal = (output || [])
2345
- .filter((e) => e != null)
2346
- .map((entry) => {
2347
- return de_FlowOutputField(entry, context);
2348
- });
2349
- return retVal;
2350
- };
2351
- const de_FlowTrace = (output, context) => {
2352
- if (output.conditionNodeResultTrace != null) {
2353
- return {
2354
- conditionNodeResultTrace: de_FlowTraceConditionNodeResultEvent(output.conditionNodeResultTrace, context),
2355
- };
2356
- }
2357
- if (output.nodeActionTrace != null) {
2358
- return {
2359
- nodeActionTrace: de_FlowTraceNodeActionEvent(output.nodeActionTrace, context),
2360
- };
2361
- }
2362
- if (output.nodeDependencyTrace != null) {
2363
- return {
2364
- nodeDependencyTrace: de_FlowTraceDependencyEvent(output.nodeDependencyTrace, context),
2365
- };
2366
- }
2367
- if (output.nodeInputTrace != null) {
2368
- return {
2369
- nodeInputTrace: de_FlowTraceNodeInputEvent(output.nodeInputTrace, context),
2370
- };
2371
- }
2372
- if (output.nodeOutputTrace != null) {
2373
- return {
2374
- nodeOutputTrace: de_FlowTraceNodeOutputEvent(output.nodeOutputTrace, context),
2375
- };
2376
- }
2377
- return { $unknown: Object.entries(output)[0] };
2378
- };
2379
- const de_FlowTraceConditionNodeResultEvent = (output, context) => {
2380
- return take(output, {
2381
- nodeName: __expectString,
2382
- satisfiedConditions: _json,
2383
- timestamp: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
2384
- });
2385
- };
2386
- const de_FlowTraceDependencyEvent = (output, context) => {
2387
- return take(output, {
2388
- nodeName: __expectString,
2389
- timestamp: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
2390
- traceElements: (_) => de_TraceElements(__expectUnion(_), context),
2391
- });
2392
- };
2393
- const de_FlowTraceEvent = (output, context) => {
2394
- return take(output, {
2395
- trace: (_) => de_FlowTrace(__expectUnion(_), context),
2396
- });
2397
- };
2398
- const de_FlowTraceNodeActionEvent = (output, context) => {
2399
- return take(output, {
2400
- nodeName: __expectString,
2401
- operationName: __expectString,
2402
- operationRequest: (_) => de_Document(_, context),
2403
- operationResponse: (_) => de_Document(_, context),
2404
- requestId: __expectString,
2405
- serviceName: __expectString,
2406
- timestamp: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
2407
- });
2408
- };
2409
- const de_FlowTraceNodeInputContent = (output, context) => {
2410
- if (output.document != null) {
2411
- return {
2412
- document: de_Document(output.document, context),
2413
- };
2414
- }
2415
- return { $unknown: Object.entries(output)[0] };
2416
- };
2417
- const de_FlowTraceNodeInputEvent = (output, context) => {
2418
- return take(output, {
2419
- fields: (_) => de_FlowTraceNodeInputFields(_, context),
2420
- nodeName: __expectString,
2421
- timestamp: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
2422
- });
2423
- };
2424
- const de_FlowTraceNodeInputField = (output, context) => {
2425
- return take(output, {
2426
- category: __expectString,
2427
- content: (_) => de_FlowTraceNodeInputContent(__expectUnion(_), context),
2428
- executionChain: _json,
2429
- nodeInputName: __expectString,
2430
- source: _json,
2431
- type: __expectString,
2432
- });
2433
- };
2434
- const de_FlowTraceNodeInputFields = (output, context) => {
2435
- const retVal = (output || [])
2436
- .filter((e) => e != null)
2437
- .map((entry) => {
2438
- return de_FlowTraceNodeInputField(entry, context);
2439
- });
2440
- return retVal;
2441
- };
2442
- const de_FlowTraceNodeOutputContent = (output, context) => {
2443
- if (output.document != null) {
2444
- return {
2445
- document: de_Document(output.document, context),
2446
- };
2447
- }
2448
- return { $unknown: Object.entries(output)[0] };
2449
- };
2450
- const de_FlowTraceNodeOutputEvent = (output, context) => {
2451
- return take(output, {
2452
- fields: (_) => de_FlowTraceNodeOutputFields(_, context),
2453
- nodeName: __expectString,
2454
- timestamp: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
2455
- });
2456
- };
2457
- const de_FlowTraceNodeOutputField = (output, context) => {
2458
- return take(output, {
2459
- content: (_) => de_FlowTraceNodeOutputContent(__expectUnion(_), context),
2460
- next: _json,
2461
- nodeOutputName: __expectString,
2462
- type: __expectString,
2463
- });
2464
- };
2465
- const de_FlowTraceNodeOutputFields = (output, context) => {
2466
- const retVal = (output || [])
2467
- .filter((e) => e != null)
2468
- .map((entry) => {
2469
- return de_FlowTraceNodeOutputField(entry, context);
2470
- });
2471
- return retVal;
2472
- };
2473
- const de_FunctionResult = (output, context) => {
2474
- return take(output, {
2475
- actionGroup: __expectString,
2476
- agentId: __expectString,
2477
- confirmationState: __expectString,
2478
- function: __expectString,
2479
- responseBody: (_) => de_ResponseBody(_, context),
2480
- responseState: __expectString,
2481
- });
2482
- };
2483
- const de_GuardrailTrace = (output, context) => {
2484
- return take(output, {
2485
- action: __expectString,
2486
- inputAssessments: _json,
2487
- metadata: (_) => de_Metadata(_, context),
2488
- outputAssessments: _json,
2489
- traceId: __expectString,
2490
- });
2491
- };
2492
- const de_ImageBlock = (output, context) => {
2493
- return take(output, {
2494
- format: __expectString,
2495
- source: (_) => de_ImageSource(__expectUnion(_), context),
2496
- });
2497
- };
2498
- const de_ImageInput = (output, context) => {
2499
- return take(output, {
2500
- format: __expectString,
2501
- source: (_) => de_ImageInputSource(__expectUnion(_), context),
2502
- });
2503
- };
2504
- const de_ImageInputs = (output, context) => {
2505
- const retVal = (output || [])
2506
- .filter((e) => e != null)
2507
- .map((entry) => {
2508
- return de_ImageInput(entry, context);
2509
- });
2510
- return retVal;
2511
- };
2512
- const de_ImageInputSource = (output, context) => {
2513
- if (output.bytes != null) {
2514
- return {
2515
- bytes: context.base64Decoder(output.bytes),
2516
- };
2517
- }
2518
- return { $unknown: Object.entries(output)[0] };
2519
- };
2520
- const de_ImageSource = (output, context) => {
2521
- if (output.bytes != null) {
2522
- return {
2523
- bytes: context.base64Decoder(output.bytes),
2524
- };
2525
- }
2526
- if (output.s3Location != null) {
2527
- return {
2528
- s3Location: _json(output.s3Location),
2529
- };
2530
- }
2531
- return { $unknown: Object.entries(output)[0] };
2532
- };
2533
- const de_InferenceConfiguration = (output, context) => {
2534
- return take(output, {
2535
- maximumLength: __expectInt32,
2536
- stopSequences: _json,
2537
- temperature: __limitedParseFloat32,
2538
- topK: __expectInt32,
2539
- topP: __limitedParseFloat32,
2540
- });
2541
- };
2542
- const de_InlineAgentFilePart = (output, context) => {
2543
- return take(output, {
2544
- files: (_) => de_OutputFiles(_, context),
2545
- });
2546
- };
2547
- const de_InlineAgentPayloadPart = (output, context) => {
2548
- return take(output, {
2549
- attribution: (_) => de_Attribution(_, context),
2550
- bytes: context.base64Decoder,
2551
- });
2552
- };
2553
- const de_InlineAgentTracePart = (output, context) => {
2554
- return take(output, {
2555
- callerChain: _json,
2556
- collaboratorName: __expectString,
2557
- eventTime: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
2558
- sessionId: __expectString,
2559
- trace: (_) => de_Trace(__expectUnion(_), context),
2560
- });
2561
- };
2562
- const de_InvocationInput = (output, context) => {
2563
- return take(output, {
2564
- actionGroupInvocationInput: _json,
2565
- agentCollaboratorInvocationInput: (_) => de_AgentCollaboratorInvocationInput(_, context),
2566
- codeInterpreterInvocationInput: _json,
2567
- invocationType: __expectString,
2568
- knowledgeBaseLookupInput: _json,
2569
- traceId: __expectString,
2570
- });
2571
- };
2572
- const de_InvocationResultMember = (output, context) => {
2573
- if (output.apiResult != null) {
2574
- return {
2575
- apiResult: de_ApiResult(output.apiResult, context),
2576
- };
2577
- }
2578
- if (output.functionResult != null) {
2579
- return {
2580
- functionResult: de_FunctionResult(output.functionResult, context),
2581
- };
2582
- }
2583
- return { $unknown: Object.entries(output)[0] };
2584
- };
2585
- const de_InvocationStep = (output, context) => {
2586
- return take(output, {
2587
- invocationId: __expectString,
2588
- invocationStepId: __expectString,
2589
- invocationStepTime: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
2590
- payload: (_) => de_InvocationStepPayload(__expectUnion(_), context),
2591
- sessionId: __expectString,
2592
- });
2593
- };
2594
- const de_InvocationStepPayload = (output, context) => {
2595
- if (output.contentBlocks != null) {
2596
- return {
2597
- contentBlocks: de_BedrockSessionContentBlocks(output.contentBlocks, context),
2598
- };
2599
- }
2600
- return { $unknown: Object.entries(output)[0] };
2601
- };
2602
- const de_InvocationStepSummaries = (output, context) => {
2603
- const retVal = (output || [])
2604
- .filter((e) => e != null)
2605
- .map((entry) => {
2606
- return de_InvocationStepSummary(entry, context);
2607
- });
2608
- return retVal;
2609
- };
2610
- const de_InvocationStepSummary = (output, context) => {
2611
- return take(output, {
2612
- invocationId: __expectString,
2613
- invocationStepId: __expectString,
2614
- invocationStepTime: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
2615
- sessionId: __expectString,
2616
- });
2617
- };
2618
- const de_InvocationSummaries = (output, context) => {
2619
- const retVal = (output || [])
2620
- .filter((e) => e != null)
2621
- .map((entry) => {
2622
- return de_InvocationSummary(entry, context);
2623
- });
2624
- return retVal;
2625
- };
2626
- const de_InvocationSummary = (output, context) => {
2627
- return take(output, {
2628
- createdAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
2629
- invocationId: __expectString,
2630
- sessionId: __expectString,
2631
- });
2632
- };
2633
- const de_KnowledgeBaseLookupOutput = (output, context) => {
2634
- return take(output, {
2635
- metadata: (_) => de_Metadata(_, context),
2636
- retrievedReferences: (_) => de_RetrievedReferences(_, context),
2637
- });
2638
- };
2639
- const de_KnowledgeBaseRetrievalResult = (output, context) => {
2640
- return take(output, {
2641
- content: _json,
2642
- location: _json,
2643
- metadata: (_) => de_RetrievalResultMetadata(_, context),
2644
- score: __limitedParseDouble,
2645
- });
2646
- };
2647
- const de_KnowledgeBaseRetrievalResults = (output, context) => {
2648
- const retVal = (output || [])
2649
- .filter((e) => e != null)
2650
- .map((entry) => {
2651
- return de_KnowledgeBaseRetrievalResult(entry, context);
2652
- });
2653
- return retVal;
2654
- };
2655
- const de_Memories = (output, context) => {
2656
- const retVal = (output || [])
2657
- .filter((e) => e != null)
2658
- .map((entry) => {
2659
- return de_Memory(__expectUnion(entry), context);
2660
- });
2661
- return retVal;
2662
- };
2663
- const de_Memory = (output, context) => {
2664
- if (output.sessionSummary != null) {
2665
- return {
2666
- sessionSummary: de_MemorySessionSummary(output.sessionSummary, context),
2667
- };
2668
- }
2669
- return { $unknown: Object.entries(output)[0] };
2670
- };
2671
- const de_MemorySessionSummary = (output, context) => {
2672
- return take(output, {
2673
- memoryId: __expectString,
2674
- sessionExpiryTime: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
2675
- sessionId: __expectString,
2676
- sessionStartTime: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
2677
- summaryText: __expectString,
2678
- });
2679
- };
2680
- const de_Metadata = (output, context) => {
2681
- return take(output, {
2682
- clientRequestId: __expectString,
2683
- endTime: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
2684
- operationTotalTimeMs: __expectLong,
2685
- startTime: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
2686
- totalTimeMs: __expectLong,
2687
- usage: _json,
2688
- });
2689
- };
2690
- const de_ModelInvocationInput = (output, context) => {
2691
- return take(output, {
2692
- foundationModel: __expectString,
2693
- inferenceConfiguration: (_) => de_InferenceConfiguration(_, context),
2694
- overrideLambda: __expectString,
2695
- parserMode: __expectString,
2696
- promptCreationMode: __expectString,
2697
- text: __expectString,
2698
- traceId: __expectString,
2699
- type: __expectString,
2700
- });
2701
- };
2702
- const de_NodeActionEvent = (output, context) => {
2703
- return take(output, {
2704
- nodeName: __expectString,
2705
- operationName: __expectString,
2706
- operationRequest: (_) => de_Document(_, context),
2707
- operationResponse: (_) => de_Document(_, context),
2708
- requestId: __expectString,
2709
- serviceName: __expectString,
2710
- timestamp: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
2711
- });
2712
- };
2713
- const de_NodeDependencyEvent = (output, context) => {
2714
- return take(output, {
2715
- nodeName: __expectString,
2716
- timestamp: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
2717
- traceElements: (_) => de_NodeTraceElements(__expectUnion(_), context),
2718
- });
2719
- };
2720
- const de_NodeExecutionContent = (output, context) => {
2721
- if (output.document != null) {
2722
- return {
2723
- document: de_Document(output.document, context),
2724
- };
2725
- }
2726
- return { $unknown: Object.entries(output)[0] };
2727
- };
2728
- const de_NodeFailureEvent = (output, context) => {
2729
- return take(output, {
2730
- errorCode: __expectString,
2731
- errorMessage: __expectString,
2732
- nodeName: __expectString,
2733
- timestamp: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
2734
- });
2735
- };
2736
- const de_NodeInputEvent = (output, context) => {
2737
- return take(output, {
2738
- fields: (_) => de_NodeInputFields(_, context),
2739
- nodeName: __expectString,
2740
- timestamp: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
2741
- });
2742
- };
2743
- const de_NodeInputField = (output, context) => {
2744
- return take(output, {
2745
- category: __expectString,
2746
- content: (_) => de_NodeExecutionContent(__expectUnion(_), context),
2747
- executionChain: _json,
2748
- name: __expectString,
2749
- source: _json,
2750
- type: __expectString,
2751
- });
2752
- };
2753
- const de_NodeInputFields = (output, context) => {
2754
- const retVal = (output || [])
2755
- .filter((e) => e != null)
2756
- .map((entry) => {
2757
- return de_NodeInputField(entry, context);
2758
- });
2759
- return retVal;
2760
- };
2761
- const de_NodeOutputEvent = (output, context) => {
2762
- return take(output, {
2763
- fields: (_) => de_NodeOutputFields(_, context),
2764
- nodeName: __expectString,
2765
- timestamp: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
2766
- });
2767
- };
2768
- const de_NodeOutputField = (output, context) => {
2769
- return take(output, {
2770
- content: (_) => de_NodeExecutionContent(__expectUnion(_), context),
2771
- name: __expectString,
2772
- next: _json,
2773
- type: __expectString,
2774
- });
2775
- };
2776
- const de_NodeOutputFields = (output, context) => {
2777
- const retVal = (output || [])
2778
- .filter((e) => e != null)
2779
- .map((entry) => {
2780
- return de_NodeOutputField(entry, context);
2781
- });
2782
- return retVal;
2783
- };
2784
- const de_NodeTraceElements = (output, context) => {
2785
- if (output.agentTraces != null) {
2786
- return {
2787
- agentTraces: de_AgentTraces(output.agentTraces, context),
2788
- };
2789
- }
2790
- return { $unknown: Object.entries(output)[0] };
2791
- };
2792
- const de_Observation = (output, context) => {
2793
- return take(output, {
2794
- actionGroupInvocationOutput: (_) => de_ActionGroupInvocationOutput(_, context),
2795
- agentCollaboratorInvocationOutput: (_) => de_AgentCollaboratorInvocationOutput(_, context),
2796
- codeInterpreterInvocationOutput: (_) => de_CodeInterpreterInvocationOutput(_, context),
2797
- finalResponse: (_) => de_FinalResponse(_, context),
2798
- knowledgeBaseLookupOutput: (_) => de_KnowledgeBaseLookupOutput(_, context),
2799
- repromptResponse: _json,
2800
- traceId: __expectString,
2801
- type: __expectString,
2802
- });
2803
- };
2804
- const de_OrchestrationModelInvocationOutput = (output, context) => {
2805
- return take(output, {
2806
- metadata: (_) => de_Metadata(_, context),
2807
- rawResponse: _json,
2808
- reasoningContent: (_) => de_ReasoningContentBlock(__expectUnion(_), context),
2809
- traceId: __expectString,
2810
- });
2811
- };
2812
- const de_OrchestrationTrace = (output, context) => {
2813
- if (output.invocationInput != null) {
2814
- return {
2815
- invocationInput: de_InvocationInput(output.invocationInput, context),
2816
- };
2817
- }
2818
- if (output.modelInvocationInput != null) {
2819
- return {
2820
- modelInvocationInput: de_ModelInvocationInput(output.modelInvocationInput, context),
2821
- };
2822
- }
2823
- if (output.modelInvocationOutput != null) {
2824
- return {
2825
- modelInvocationOutput: de_OrchestrationModelInvocationOutput(output.modelInvocationOutput, context),
2826
- };
2827
- }
2828
- if (output.observation != null) {
2829
- return {
2830
- observation: de_Observation(output.observation, context),
2831
- };
2832
- }
2833
- if (output.rationale != null) {
2834
- return {
2835
- rationale: _json(output.rationale),
2836
- };
2837
- }
2838
- return { $unknown: Object.entries(output)[0] };
2839
- };
2840
- const de_OutputFile = (output, context) => {
2841
- return take(output, {
2842
- bytes: context.base64Decoder,
2843
- name: __expectString,
2844
- type: __expectString,
2845
- });
2846
- };
2847
- const de_OutputFiles = (output, context) => {
2848
- const retVal = (output || [])
2849
- .filter((e) => e != null)
2850
- .map((entry) => {
2851
- return de_OutputFile(entry, context);
2852
- });
2853
- return retVal;
2854
- };
2855
- const de_PayloadPart = (output, context) => {
2856
- return take(output, {
2857
- attribution: (_) => de_Attribution(_, context),
2858
- bytes: context.base64Decoder,
2859
- });
2860
- };
2861
- const de_PostProcessingModelInvocationOutput = (output, context) => {
2862
- return take(output, {
2863
- metadata: (_) => de_Metadata(_, context),
2864
- parsedResponse: _json,
2865
- rawResponse: _json,
2866
- reasoningContent: (_) => de_ReasoningContentBlock(__expectUnion(_), context),
2867
- traceId: __expectString,
2868
- });
2869
- };
2870
- const de_PostProcessingTrace = (output, context) => {
2871
- if (output.modelInvocationInput != null) {
2872
- return {
2873
- modelInvocationInput: de_ModelInvocationInput(output.modelInvocationInput, context),
2874
- };
2875
- }
2876
- if (output.modelInvocationOutput != null) {
2877
- return {
2878
- modelInvocationOutput: de_PostProcessingModelInvocationOutput(output.modelInvocationOutput, context),
2879
- };
2880
- }
2881
- return { $unknown: Object.entries(output)[0] };
2882
- };
2883
- const de_PreProcessingModelInvocationOutput = (output, context) => {
2884
- return take(output, {
2885
- metadata: (_) => de_Metadata(_, context),
2886
- parsedResponse: _json,
2887
- rawResponse: _json,
2888
- reasoningContent: (_) => de_ReasoningContentBlock(__expectUnion(_), context),
2889
- traceId: __expectString,
2890
- });
2891
- };
2892
- const de_PreProcessingTrace = (output, context) => {
2893
- if (output.modelInvocationInput != null) {
2894
- return {
2895
- modelInvocationInput: de_ModelInvocationInput(output.modelInvocationInput, context),
2896
- };
2897
- }
2898
- if (output.modelInvocationOutput != null) {
2899
- return {
2900
- modelInvocationOutput: de_PreProcessingModelInvocationOutput(output.modelInvocationOutput, context),
2901
- };
2902
- }
2903
- return { $unknown: Object.entries(output)[0] };
2904
- };
2905
- const de_ReasoningContentBlock = (output, context) => {
2906
- if (output.reasoningText != null) {
2907
- return {
2908
- reasoningText: _json(output.reasoningText),
2909
- };
2910
- }
2911
- if (output.redactedContent != null) {
2912
- return {
2913
- redactedContent: context.base64Decoder(output.redactedContent),
2914
- };
2915
- }
2916
- return { $unknown: Object.entries(output)[0] };
2917
- };
2918
- const de_RerankDocument = (output, context) => {
2919
- return take(output, {
2920
- jsonDocument: (_) => de_Document(_, context),
2921
- textDocument: _json,
2922
- type: __expectString,
2923
- });
2924
- };
2925
- const de_RerankResult = (output, context) => {
2926
- return take(output, {
2927
- document: (_) => de_RerankDocument(_, context),
2928
- index: __expectInt32,
2929
- relevanceScore: __limitedParseFloat32,
2930
- });
2931
- };
2932
- const de_RerankResultsList = (output, context) => {
2933
- const retVal = (output || [])
2934
- .filter((e) => e != null)
2935
- .map((entry) => {
2936
- return de_RerankResult(entry, context);
2937
- });
2938
- return retVal;
2939
- };
2940
- const de_ResponseBody = (output, context) => {
2941
- return Object.entries(output).reduce((acc, [key, value]) => {
2942
- if (value === null) {
2943
- return acc;
2944
- }
2945
- acc[key] = de_ContentBody(value, context);
2946
- return acc;
2947
- }, {});
2948
- };
2949
- const de_RetrievalResultMetadata = (output, context) => {
2950
- return Object.entries(output).reduce((acc, [key, value]) => {
2951
- if (value === null) {
2952
- return acc;
2953
- }
2954
- acc[key] = de_RetrievalResultMetadataValue(value, context);
2955
- return acc;
2956
- }, {});
2957
- };
2958
- const de_RetrievalResultMetadataValue = (output, context) => {
2959
- return output;
2960
- };
2961
- const de_RetrievedReference = (output, context) => {
2962
- return take(output, {
2963
- content: _json,
2964
- location: _json,
2965
- metadata: (_) => de_RetrievalResultMetadata(_, context),
2966
- });
2967
- };
2968
- const de_RetrievedReferences = (output, context) => {
2969
- const retVal = (output || [])
2970
- .filter((e) => e != null)
2971
- .map((entry) => {
2972
- return de_RetrievedReference(entry, context);
2973
- });
2974
- return retVal;
2975
- };
2976
- const de_ReturnControlInvocationResults = (output, context) => {
2977
- const retVal = (output || [])
2978
- .filter((e) => e != null)
2979
- .map((entry) => {
2980
- return de_InvocationResultMember(__expectUnion(entry), context);
2981
- });
2982
- return retVal;
2983
- };
2984
- const de_ReturnControlResults = (output, context) => {
2985
- return take(output, {
2986
- invocationId: __expectString,
2987
- returnControlInvocationResults: (_) => de_ReturnControlInvocationResults(_, context),
2988
- });
2989
- };
2990
- const de_RoutingClassifierModelInvocationOutput = (output, context) => {
2991
- return take(output, {
2992
- metadata: (_) => de_Metadata(_, context),
2993
- rawResponse: _json,
2994
- traceId: __expectString,
2995
- });
2996
- };
2997
- const de_RoutingClassifierTrace = (output, context) => {
2998
- if (output.invocationInput != null) {
2999
- return {
3000
- invocationInput: de_InvocationInput(output.invocationInput, context),
3001
- };
3002
- }
3003
- if (output.modelInvocationInput != null) {
3004
- return {
3005
- modelInvocationInput: de_ModelInvocationInput(output.modelInvocationInput, context),
3006
- };
3007
- }
3008
- if (output.modelInvocationOutput != null) {
3009
- return {
3010
- modelInvocationOutput: de_RoutingClassifierModelInvocationOutput(output.modelInvocationOutput, context),
3011
- };
3012
- }
3013
- if (output.observation != null) {
3014
- return {
3015
- observation: de_Observation(output.observation, context),
3016
- };
3017
- }
3018
- return { $unknown: Object.entries(output)[0] };
3019
- };
3020
- const de_SessionSummaries = (output, context) => {
3021
- const retVal = (output || [])
3022
- .filter((e) => e != null)
3023
- .map((entry) => {
3024
- return de_SessionSummary(entry, context);
3025
- });
3026
- return retVal;
3027
- };
3028
- const de_SessionSummary = (output, context) => {
3029
- return take(output, {
3030
- createdAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
3031
- lastUpdatedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
3032
- sessionArn: __expectString,
3033
- sessionId: __expectString,
3034
- sessionStatus: __expectString,
3035
- });
3036
- };
3037
- const de_Trace = (output, context) => {
3038
- if (output.customOrchestrationTrace != null) {
3039
- return {
3040
- customOrchestrationTrace: _json(output.customOrchestrationTrace),
3041
- };
3042
- }
3043
- if (output.failureTrace != null) {
3044
- return {
3045
- failureTrace: de_FailureTrace(output.failureTrace, context),
3046
- };
3047
- }
3048
- if (output.guardrailTrace != null) {
3049
- return {
3050
- guardrailTrace: de_GuardrailTrace(output.guardrailTrace, context),
3051
- };
3052
- }
3053
- if (output.orchestrationTrace != null) {
3054
- return {
3055
- orchestrationTrace: de_OrchestrationTrace(__expectUnion(output.orchestrationTrace), context),
3056
- };
3057
- }
3058
- if (output.postProcessingTrace != null) {
3059
- return {
3060
- postProcessingTrace: de_PostProcessingTrace(__expectUnion(output.postProcessingTrace), context),
3061
- };
3062
- }
3063
- if (output.preProcessingTrace != null) {
3064
- return {
3065
- preProcessingTrace: de_PreProcessingTrace(__expectUnion(output.preProcessingTrace), context),
3066
- };
3067
- }
3068
- if (output.routingClassifierTrace != null) {
3069
- return {
3070
- routingClassifierTrace: de_RoutingClassifierTrace(__expectUnion(output.routingClassifierTrace), context),
3071
- };
3072
- }
3073
- return { $unknown: Object.entries(output)[0] };
3074
- };
3075
- const de_TraceElements = (output, context) => {
3076
- if (output.agentTraces != null) {
3077
- return {
3078
- agentTraces: de_AgentTraces(output.agentTraces, context),
3079
- };
3080
- }
3081
- return { $unknown: Object.entries(output)[0] };
3082
- };
3083
- const de_TracePart = (output, context) => {
3084
- return take(output, {
3085
- agentAliasId: __expectString,
3086
- agentId: __expectString,
3087
- agentVersion: __expectString,
3088
- callerChain: _json,
3089
- collaboratorName: __expectString,
3090
- eventTime: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
3091
- sessionId: __expectString,
3092
- trace: (_) => de_Trace(__expectUnion(_), context),
3093
- });
3094
- };
3095
- const de_Document = (output, context) => {
3096
- return output;
3097
- };
3098
- const deserializeMetadata = (output) => ({
3099
- httpStatusCode: output.statusCode,
3100
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
3101
- extendedRequestId: output.headers["x-amz-id-2"],
3102
- cfId: output.headers["x-amz-cf-id"],
3103
- });
3104
- const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
3105
- const _cT = "contentType";
3106
- const _eI = "executionId";
3107
- const _eT = "eventType";
3108
- const _fAI = "flowAliasIdentifier";
3109
- const _mI = "memoryId";
3110
- const _mIa = "maxItems";
3111
- const _mR = "maxResults";
3112
- const _mT = "memoryType";
3113
- const _nT = "nextToken";
3114
- const _sA = "sourceArn";
3115
- const _sI = "sessionId";
3116
- const _tK = "tagKeys";
3117
- const _xabact = "x-amzn-bedrock-agent-content-type";
3118
- const _xabami = "x-amz-bedrock-agent-memory-id";
3119
- const _xabasi = "x-amz-bedrock-agent-session-id";
3120
- const _xabfei = "x-amz-bedrock-flow-execution-id";
3121
- const _xabkbsi = "x-amzn-bedrock-knowledge-base-session-id";
3122
- const _xasa = "x-amz-source-arn";