@wildix/wim-wilma-client 0.0.3 → 0.0.5

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 (40) hide show
  1. package/dist-cjs/Wilma.js +14 -0
  2. package/dist-cjs/commands/CreateAgentCommand.js +21 -0
  3. package/dist-cjs/commands/DeleteAgentCommand.js +21 -0
  4. package/dist-cjs/commands/ExecuteAgentCommand.js +21 -0
  5. package/dist-cjs/commands/GetAgentCommand.js +21 -0
  6. package/dist-cjs/commands/ListAgentsCommand.js +21 -0
  7. package/dist-cjs/commands/ListAgentsNamesCommand.js +21 -0
  8. package/dist-cjs/commands/UpdateAgentCommand.js +21 -0
  9. package/dist-cjs/commands/index.js +7 -0
  10. package/dist-cjs/models/models_0.js +43 -14
  11. package/dist-cjs/protocols/Aws_restJson1.js +269 -6
  12. package/dist-es/Wilma.js +14 -0
  13. package/dist-es/commands/CreateAgentCommand.js +17 -0
  14. package/dist-es/commands/DeleteAgentCommand.js +17 -0
  15. package/dist-es/commands/ExecuteAgentCommand.js +17 -0
  16. package/dist-es/commands/GetAgentCommand.js +17 -0
  17. package/dist-es/commands/ListAgentsCommand.js +17 -0
  18. package/dist-es/commands/ListAgentsNamesCommand.js +17 -0
  19. package/dist-es/commands/UpdateAgentCommand.js +17 -0
  20. package/dist-es/commands/index.js +7 -0
  21. package/dist-es/models/models_0.js +41 -12
  22. package/dist-es/protocols/Aws_restJson1.js +254 -5
  23. package/dist-types/Wilma.d.ts +51 -0
  24. package/dist-types/WilmaClient.d.ts +9 -2
  25. package/dist-types/commands/CreateAgentCommand.d.ts +142 -0
  26. package/dist-types/commands/DeleteAgentCommand.d.ts +73 -0
  27. package/dist-types/commands/ExecuteAgentCommand.d.ts +84 -0
  28. package/dist-types/commands/GetAgentCommand.d.ts +113 -0
  29. package/dist-types/commands/GetChatCommand.d.ts +2 -0
  30. package/dist-types/commands/ListAgentsCommand.d.ts +112 -0
  31. package/dist-types/commands/ListAgentsNamesCommand.d.ts +80 -0
  32. package/dist-types/commands/ListChatsCommand.d.ts +2 -0
  33. package/dist-types/commands/UpdateAgentCommand.d.ts +145 -0
  34. package/dist-types/commands/index.d.ts +7 -0
  35. package/dist-types/models/models_0.d.ts +333 -5
  36. package/dist-types/protocols/Aws_restJson1.d.ts +63 -0
  37. package/dist-types/runtimeConfig.browser.d.ts +6 -1
  38. package/dist-types/runtimeConfig.d.ts +6 -1
  39. package/dist-types/runtimeConfig.native.d.ts +6 -1
  40. package/package.json +1 -1
package/dist-es/Wilma.js CHANGED
@@ -1,20 +1,34 @@
1
1
  import { WilmaClient, } from "./WilmaClient";
2
+ import { CreateAgentCommand, } from "./commands/CreateAgentCommand";
3
+ import { DeleteAgentCommand, } from "./commands/DeleteAgentCommand";
2
4
  import { DeleteChatCommand, } from "./commands/DeleteChatCommand";
3
5
  import { DislikeAnswerCommand, } from "./commands/DislikeAnswerCommand";
6
+ import { ExecuteAgentCommand, } from "./commands/ExecuteAgentCommand";
7
+ import { GetAgentCommand, } from "./commands/GetAgentCommand";
4
8
  import { GetChatCommand, } from "./commands/GetChatCommand";
5
9
  import { LikeAnswerCommand, } from "./commands/LikeAnswerCommand";
6
10
  import { ListAgentFeedbacksCommand, } from "./commands/ListAgentFeedbacksCommand";
11
+ import { ListAgentsCommand, } from "./commands/ListAgentsCommand";
12
+ import { ListAgentsNamesCommand, } from "./commands/ListAgentsNamesCommand";
7
13
  import { ListChatsCommand, } from "./commands/ListChatsCommand";
8
14
  import { ListFeedbacksCommand, } from "./commands/ListFeedbacksCommand";
15
+ import { UpdateAgentCommand, } from "./commands/UpdateAgentCommand";
9
16
  import { createAggregatedClient } from "@smithy/smithy-client";
10
17
  const commands = {
18
+ CreateAgentCommand,
19
+ DeleteAgentCommand,
11
20
  DeleteChatCommand,
12
21
  DislikeAnswerCommand,
22
+ ExecuteAgentCommand,
23
+ GetAgentCommand,
13
24
  GetChatCommand,
14
25
  LikeAnswerCommand,
15
26
  ListAgentFeedbacksCommand,
27
+ ListAgentsCommand,
28
+ ListAgentsNamesCommand,
16
29
  ListChatsCommand,
17
30
  ListFeedbacksCommand,
31
+ UpdateAgentCommand,
18
32
  };
19
33
  export class Wilma extends WilmaClient {
20
34
  }
@@ -0,0 +1,17 @@
1
+ import { de_CreateAgentCommand, se_CreateAgentCommand, } from "../protocols/Aws_restJson1";
2
+ import { getSerdePlugin } from "@smithy/middleware-serde";
3
+ import { Command as $Command } from "@smithy/smithy-client";
4
+ export { $Command };
5
+ export class CreateAgentCommand extends $Command.classBuilder()
6
+ .m(function (Command, cs, config, o) {
7
+ return [
8
+ getSerdePlugin(config, this.serialize, this.deserialize),
9
+ ];
10
+ })
11
+ .s("Wilma", "CreateAgent", {})
12
+ .n("WilmaClient", "CreateAgentCommand")
13
+ .f(void 0, void 0)
14
+ .ser(se_CreateAgentCommand)
15
+ .de(de_CreateAgentCommand)
16
+ .build() {
17
+ }
@@ -0,0 +1,17 @@
1
+ import { de_DeleteAgentCommand, se_DeleteAgentCommand, } from "../protocols/Aws_restJson1";
2
+ import { getSerdePlugin } from "@smithy/middleware-serde";
3
+ import { Command as $Command } from "@smithy/smithy-client";
4
+ export { $Command };
5
+ export class DeleteAgentCommand extends $Command.classBuilder()
6
+ .m(function (Command, cs, config, o) {
7
+ return [
8
+ getSerdePlugin(config, this.serialize, this.deserialize),
9
+ ];
10
+ })
11
+ .s("Wilma", "DeleteAgent", {})
12
+ .n("WilmaClient", "DeleteAgentCommand")
13
+ .f(void 0, void 0)
14
+ .ser(se_DeleteAgentCommand)
15
+ .de(de_DeleteAgentCommand)
16
+ .build() {
17
+ }
@@ -0,0 +1,17 @@
1
+ import { de_ExecuteAgentCommand, se_ExecuteAgentCommand, } from "../protocols/Aws_restJson1";
2
+ import { getSerdePlugin } from "@smithy/middleware-serde";
3
+ import { Command as $Command } from "@smithy/smithy-client";
4
+ export { $Command };
5
+ export class ExecuteAgentCommand extends $Command.classBuilder()
6
+ .m(function (Command, cs, config, o) {
7
+ return [
8
+ getSerdePlugin(config, this.serialize, this.deserialize),
9
+ ];
10
+ })
11
+ .s("Wilma", "ExecuteAgent", {})
12
+ .n("WilmaClient", "ExecuteAgentCommand")
13
+ .f(void 0, void 0)
14
+ .ser(se_ExecuteAgentCommand)
15
+ .de(de_ExecuteAgentCommand)
16
+ .build() {
17
+ }
@@ -0,0 +1,17 @@
1
+ import { de_GetAgentCommand, se_GetAgentCommand, } from "../protocols/Aws_restJson1";
2
+ import { getSerdePlugin } from "@smithy/middleware-serde";
3
+ import { Command as $Command } from "@smithy/smithy-client";
4
+ export { $Command };
5
+ export class GetAgentCommand extends $Command.classBuilder()
6
+ .m(function (Command, cs, config, o) {
7
+ return [
8
+ getSerdePlugin(config, this.serialize, this.deserialize),
9
+ ];
10
+ })
11
+ .s("Wilma", "GetAgent", {})
12
+ .n("WilmaClient", "GetAgentCommand")
13
+ .f(void 0, void 0)
14
+ .ser(se_GetAgentCommand)
15
+ .de(de_GetAgentCommand)
16
+ .build() {
17
+ }
@@ -0,0 +1,17 @@
1
+ import { de_ListAgentsCommand, se_ListAgentsCommand, } from "../protocols/Aws_restJson1";
2
+ import { getSerdePlugin } from "@smithy/middleware-serde";
3
+ import { Command as $Command } from "@smithy/smithy-client";
4
+ export { $Command };
5
+ export class ListAgentsCommand extends $Command.classBuilder()
6
+ .m(function (Command, cs, config, o) {
7
+ return [
8
+ getSerdePlugin(config, this.serialize, this.deserialize),
9
+ ];
10
+ })
11
+ .s("Wilma", "ListAgents", {})
12
+ .n("WilmaClient", "ListAgentsCommand")
13
+ .f(void 0, void 0)
14
+ .ser(se_ListAgentsCommand)
15
+ .de(de_ListAgentsCommand)
16
+ .build() {
17
+ }
@@ -0,0 +1,17 @@
1
+ import { de_ListAgentsNamesCommand, se_ListAgentsNamesCommand, } from "../protocols/Aws_restJson1";
2
+ import { getSerdePlugin } from "@smithy/middleware-serde";
3
+ import { Command as $Command } from "@smithy/smithy-client";
4
+ export { $Command };
5
+ export class ListAgentsNamesCommand extends $Command.classBuilder()
6
+ .m(function (Command, cs, config, o) {
7
+ return [
8
+ getSerdePlugin(config, this.serialize, this.deserialize),
9
+ ];
10
+ })
11
+ .s("Wilma", "ListAgentsNames", {})
12
+ .n("WilmaClient", "ListAgentsNamesCommand")
13
+ .f(void 0, void 0)
14
+ .ser(se_ListAgentsNamesCommand)
15
+ .de(de_ListAgentsNamesCommand)
16
+ .build() {
17
+ }
@@ -0,0 +1,17 @@
1
+ import { de_UpdateAgentCommand, se_UpdateAgentCommand, } from "../protocols/Aws_restJson1";
2
+ import { getSerdePlugin } from "@smithy/middleware-serde";
3
+ import { Command as $Command } from "@smithy/smithy-client";
4
+ export { $Command };
5
+ export class UpdateAgentCommand extends $Command.classBuilder()
6
+ .m(function (Command, cs, config, o) {
7
+ return [
8
+ getSerdePlugin(config, this.serialize, this.deserialize),
9
+ ];
10
+ })
11
+ .s("Wilma", "UpdateAgent", {})
12
+ .n("WilmaClient", "UpdateAgentCommand")
13
+ .f(void 0, void 0)
14
+ .ser(se_UpdateAgentCommand)
15
+ .de(de_UpdateAgentCommand)
16
+ .build() {
17
+ }
@@ -1,7 +1,14 @@
1
+ export * from "./CreateAgentCommand";
2
+ export * from "./DeleteAgentCommand";
1
3
  export * from "./DeleteChatCommand";
2
4
  export * from "./DislikeAnswerCommand";
5
+ export * from "./ExecuteAgentCommand";
6
+ export * from "./GetAgentCommand";
3
7
  export * from "./GetChatCommand";
4
8
  export * from "./LikeAnswerCommand";
5
9
  export * from "./ListAgentFeedbacksCommand";
10
+ export * from "./ListAgentsCommand";
11
+ export * from "./ListAgentsNamesCommand";
6
12
  export * from "./ListChatsCommand";
7
13
  export * from "./ListFeedbacksCommand";
14
+ export * from "./UpdateAgentCommand";
@@ -1,40 +1,69 @@
1
1
  import { WilmaServiceException as __BaseException } from "./WilmaServiceException";
2
- export class NotFoundException extends __BaseException {
3
- name = "NotFoundException";
2
+ export class ForbiddenException extends __BaseException {
3
+ name = "ForbiddenException";
4
4
  $fault = "client";
5
5
  constructor(opts) {
6
6
  super({
7
- name: "NotFoundException",
7
+ name: "ForbiddenException",
8
8
  $fault: "client",
9
9
  ...opts
10
10
  });
11
- Object.setPrototypeOf(this, NotFoundException.prototype);
11
+ Object.setPrototypeOf(this, ForbiddenException.prototype);
12
12
  }
13
13
  }
14
- export class ValidationException extends __BaseException {
15
- name = "ValidationException";
14
+ export class NotFoundException extends __BaseException {
15
+ name = "NotFoundException";
16
16
  $fault = "client";
17
17
  constructor(opts) {
18
18
  super({
19
- name: "ValidationException",
19
+ name: "NotFoundException",
20
20
  $fault: "client",
21
21
  ...opts
22
22
  });
23
- Object.setPrototypeOf(this, ValidationException.prototype);
23
+ Object.setPrototypeOf(this, NotFoundException.prototype);
24
24
  }
25
25
  }
26
- export class ForbiddenException extends __BaseException {
27
- name = "ForbiddenException";
26
+ export class ValidationException extends __BaseException {
27
+ name = "ValidationException";
28
28
  $fault = "client";
29
29
  constructor(opts) {
30
30
  super({
31
- name: "ForbiddenException",
31
+ name: "ValidationException",
32
32
  $fault: "client",
33
33
  ...opts
34
34
  });
35
- Object.setPrototypeOf(this, ForbiddenException.prototype);
35
+ Object.setPrototypeOf(this, ValidationException.prototype);
36
36
  }
37
37
  }
38
+ export var AgentToolVariableHandler;
39
+ (function (AgentToolVariableHandler) {
40
+ AgentToolVariableHandler.visit = (value, visitor) => {
41
+ if (value.auto !== undefined)
42
+ return visitor.auto(value.auto);
43
+ if (value.guided !== undefined)
44
+ return visitor.guided(value.guided);
45
+ if (value.predefined !== undefined)
46
+ return visitor.predefined(value.predefined);
47
+ return visitor._(value.$unknown[0], value.$unknown[1]);
48
+ };
49
+ })(AgentToolVariableHandler || (AgentToolVariableHandler = {}));
50
+ export var AgentCapability;
51
+ (function (AgentCapability) {
52
+ AgentCapability.visit = (value, visitor) => {
53
+ if (value.tool !== undefined)
54
+ return visitor.tool(value.tool);
55
+ if (value.kb !== undefined)
56
+ return visitor.kb(value.kb);
57
+ return visitor._(value.$unknown[0], value.$unknown[1]);
58
+ };
59
+ })(AgentCapability || (AgentCapability = {}));
60
+ export const AgentVariableType = {
61
+ BOOLEAN: "boolean",
62
+ NUMBER: "number",
63
+ NUMBER_ARRAY: "number_array",
64
+ STRING: "string",
65
+ STRING_ARRAY: "string_array",
66
+ };
38
67
  export const ChatFeedbackScore = {
39
68
  DISLIKE: "DISLIKE",
40
69
  LIKE: "LIKE",
@@ -3,6 +3,44 @@ import { ForbiddenException, NotFoundException, ValidationException, } from "../
3
3
  import { loadRestJsonErrorCode, parseJsonBody as parseBody, parseJsonErrorBody as parseErrorBody, } from "@aws-sdk/core";
4
4
  import { requestBuilder as rb } from "@smithy/core";
5
5
  import { decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, _json, collectBody, map, take, withBaseException, } from "@smithy/smithy-client";
6
+ export const se_CreateAgentCommand = async (input, context) => {
7
+ const b = rb(input, context);
8
+ const headers = {
9
+ 'content-type': 'application/json',
10
+ };
11
+ b.bp("/v1/wilma/agents/agents");
12
+ const query = map({
13
+ [_c]: [, input[_c]],
14
+ });
15
+ let body;
16
+ body = JSON.stringify(take(input, {
17
+ 'capabilities': _ => _json(_),
18
+ 'instructions': [],
19
+ 'model': [],
20
+ 'name': [],
21
+ 'variables': _ => _json(_),
22
+ }));
23
+ b.m("POST")
24
+ .h(headers)
25
+ .q(query)
26
+ .b(body);
27
+ return b.build();
28
+ };
29
+ export const se_DeleteAgentCommand = async (input, context) => {
30
+ const b = rb(input, context);
31
+ const headers = {};
32
+ b.bp("/v1/wilma/agents/{agentId}");
33
+ b.p('agentId', () => input.agentId, '{agentId}', false);
34
+ const query = map({
35
+ [_c]: [, input[_c]],
36
+ });
37
+ let body;
38
+ b.m("DELETE")
39
+ .h(headers)
40
+ .q(query)
41
+ .b(body);
42
+ return b.build();
43
+ };
6
44
  export const se_DeleteChatCommand = async (input, context) => {
7
45
  const b = rb(input, context);
8
46
  const headers = {};
@@ -41,6 +79,44 @@ export const se_DislikeAnswerCommand = async (input, context) => {
41
79
  .b(body);
42
80
  return b.build();
43
81
  };
82
+ export const se_ExecuteAgentCommand = async (input, context) => {
83
+ const b = rb(input, context);
84
+ const headers = {
85
+ 'content-type': 'application/json',
86
+ };
87
+ b.bp("/v1/wilma/agents/agents/{agentId}/execute");
88
+ b.p('agentId', () => input.agentId, '{agentId}', false);
89
+ const query = map({
90
+ [_c]: [, input[_c]],
91
+ });
92
+ let body;
93
+ body = JSON.stringify(take(input, {
94
+ 'data': [],
95
+ 'service': [],
96
+ 'user': [],
97
+ 'variables': _ => se_Document(_, context),
98
+ }));
99
+ b.m("POST")
100
+ .h(headers)
101
+ .q(query)
102
+ .b(body);
103
+ return b.build();
104
+ };
105
+ export const se_GetAgentCommand = async (input, context) => {
106
+ const b = rb(input, context);
107
+ const headers = {};
108
+ b.bp("/v1/wilma/agents/agents/{agentId}");
109
+ b.p('agentId', () => input.agentId, '{agentId}', false);
110
+ const query = map({
111
+ [_c]: [, input[_c]],
112
+ });
113
+ let body;
114
+ b.m("GET")
115
+ .h(headers)
116
+ .q(query)
117
+ .b(body);
118
+ return b.build();
119
+ };
44
120
  export const se_GetChatCommand = async (input, context) => {
45
121
  const b = rb(input, context);
46
122
  const headers = {};
@@ -95,6 +171,34 @@ export const se_ListAgentFeedbacksCommand = async (input, context) => {
95
171
  .b(body);
96
172
  return b.build();
97
173
  };
174
+ export const se_ListAgentsCommand = async (input, context) => {
175
+ const b = rb(input, context);
176
+ const headers = {};
177
+ b.bp("/v1/wilma/agents");
178
+ const query = map({
179
+ [_c]: [, input[_c]],
180
+ });
181
+ let body;
182
+ b.m("GET")
183
+ .h(headers)
184
+ .q(query)
185
+ .b(body);
186
+ return b.build();
187
+ };
188
+ export const se_ListAgentsNamesCommand = async (input, context) => {
189
+ const b = rb(input, context);
190
+ const headers = {};
191
+ b.bp("/v1/wilma/agents-names");
192
+ const query = map({
193
+ [_c]: [, input[_c]],
194
+ });
195
+ let body;
196
+ b.m("GET")
197
+ .h(headers)
198
+ .q(query)
199
+ .b(body);
200
+ return b.build();
201
+ };
98
202
  export const se_ListChatsCommand = async (input, context) => {
99
203
  const b = rb(input, context);
100
204
  const headers = {};
@@ -126,6 +230,54 @@ export const se_ListFeedbacksCommand = async (input, context) => {
126
230
  .b(body);
127
231
  return b.build();
128
232
  };
233
+ export const se_UpdateAgentCommand = async (input, context) => {
234
+ const b = rb(input, context);
235
+ const headers = {
236
+ 'content-type': 'application/json',
237
+ };
238
+ b.bp("/v1/wilma/agents/{agentId}");
239
+ b.p('agentId', () => input.agentId, '{agentId}', false);
240
+ const query = map({
241
+ [_c]: [, input[_c]],
242
+ });
243
+ let body;
244
+ body = JSON.stringify(take(input, {
245
+ 'capabilities': _ => _json(_),
246
+ 'instructions': [],
247
+ 'model': [],
248
+ 'name': [],
249
+ 'variables': _ => _json(_),
250
+ }));
251
+ b.m("PUT")
252
+ .h(headers)
253
+ .q(query)
254
+ .b(body);
255
+ return b.build();
256
+ };
257
+ export const de_CreateAgentCommand = async (output, context) => {
258
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
259
+ return de_CommandError(output, context);
260
+ }
261
+ const contents = map({
262
+ $metadata: deserializeMetadata(output),
263
+ });
264
+ const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
265
+ const doc = take(data, {
266
+ 'agent': _json,
267
+ });
268
+ Object.assign(contents, doc);
269
+ return contents;
270
+ };
271
+ export const de_DeleteAgentCommand = async (output, context) => {
272
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
273
+ return de_CommandError(output, context);
274
+ }
275
+ const contents = map({
276
+ $metadata: deserializeMetadata(output),
277
+ });
278
+ await collectBody(output.body, context);
279
+ return contents;
280
+ };
129
281
  export const de_DeleteChatCommand = async (output, context) => {
130
282
  if (output.statusCode !== 200 && output.statusCode >= 300) {
131
283
  return de_CommandError(output, context);
@@ -146,6 +298,34 @@ export const de_DislikeAnswerCommand = async (output, context) => {
146
298
  await collectBody(output.body, context);
147
299
  return contents;
148
300
  };
301
+ export const de_ExecuteAgentCommand = async (output, context) => {
302
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
303
+ return de_CommandError(output, context);
304
+ }
305
+ const contents = map({
306
+ $metadata: deserializeMetadata(output),
307
+ });
308
+ const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
309
+ const doc = take(data, {
310
+ 'result': _ => de_AgentExecutionResult(_, context),
311
+ });
312
+ Object.assign(contents, doc);
313
+ return contents;
314
+ };
315
+ export const de_GetAgentCommand = async (output, context) => {
316
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
317
+ return de_CommandError(output, context);
318
+ }
319
+ const contents = map({
320
+ $metadata: deserializeMetadata(output),
321
+ });
322
+ const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
323
+ const doc = take(data, {
324
+ 'agent': _json,
325
+ });
326
+ Object.assign(contents, doc);
327
+ return contents;
328
+ };
149
329
  export const de_GetChatCommand = async (output, context) => {
150
330
  if (output.statusCode !== 200 && output.statusCode >= 300) {
151
331
  return de_CommandError(output, context);
@@ -155,7 +335,7 @@ export const de_GetChatCommand = async (output, context) => {
155
335
  });
156
336
  const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
157
337
  const doc = take(data, {
158
- 'chat': _json,
338
+ 'chat': _ => de_Chat(_, context),
159
339
  'history': _ => de_ChatHistory(_, context),
160
340
  });
161
341
  Object.assign(contents, doc);
@@ -186,6 +366,34 @@ export const de_ListAgentFeedbacksCommand = async (output, context) => {
186
366
  Object.assign(contents, doc);
187
367
  return contents;
188
368
  };
369
+ export const de_ListAgentsCommand = async (output, context) => {
370
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
371
+ return de_CommandError(output, context);
372
+ }
373
+ const contents = map({
374
+ $metadata: deserializeMetadata(output),
375
+ });
376
+ const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
377
+ const doc = take(data, {
378
+ 'agents': _json,
379
+ });
380
+ Object.assign(contents, doc);
381
+ return contents;
382
+ };
383
+ export const de_ListAgentsNamesCommand = async (output, context) => {
384
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
385
+ return de_CommandError(output, context);
386
+ }
387
+ const contents = map({
388
+ $metadata: deserializeMetadata(output),
389
+ });
390
+ const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
391
+ const doc = take(data, {
392
+ 'agents': _json,
393
+ });
394
+ Object.assign(contents, doc);
395
+ return contents;
396
+ };
189
397
  export const de_ListChatsCommand = async (output, context) => {
190
398
  if (output.statusCode !== 200 && output.statusCode >= 300) {
191
399
  return de_CommandError(output, context);
@@ -195,7 +403,7 @@ export const de_ListChatsCommand = async (output, context) => {
195
403
  });
196
404
  const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
197
405
  const doc = take(data, {
198
- 'chats': _json,
406
+ 'chats': _ => de_ChatsList(_, context),
199
407
  'lastEvaluatedKey': __expectString,
200
408
  });
201
409
  Object.assign(contents, doc);
@@ -216,6 +424,20 @@ export const de_ListFeedbacksCommand = async (output, context) => {
216
424
  Object.assign(contents, doc);
217
425
  return contents;
218
426
  };
427
+ export const de_UpdateAgentCommand = async (output, context) => {
428
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
429
+ return de_CommandError(output, context);
430
+ }
431
+ const contents = map({
432
+ $metadata: deserializeMetadata(output),
433
+ });
434
+ const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
435
+ const doc = take(data, {
436
+ 'agent': _json,
437
+ });
438
+ Object.assign(contents, doc);
439
+ return contents;
440
+ };
219
441
  const de_CommandError = async (output, context) => {
220
442
  const parsedOutput = {
221
443
  ...output,
@@ -223,12 +445,12 @@ const de_CommandError = async (output, context) => {
223
445
  };
224
446
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
225
447
  switch (errorCode) {
226
- case "ForbiddenException":
227
- case "smithy.framework#ForbiddenException":
228
- throw await de_ForbiddenExceptionRes(parsedOutput, context);
229
448
  case "ValidationException":
230
449
  case "smithy.framework#ValidationException":
231
450
  throw await de_ValidationExceptionRes(parsedOutput, context);
451
+ case "ForbiddenException":
452
+ case "smithy.framework#ForbiddenException":
453
+ throw await de_ForbiddenExceptionRes(parsedOutput, context);
232
454
  case "NotFoundException":
233
455
  case "smithy.framework#NotFoundException":
234
456
  throw await de_NotFoundExceptionRes(parsedOutput, context);
@@ -281,9 +503,30 @@ const de_ValidationExceptionRes = async (parsedOutput, context) => {
281
503
  });
282
504
  return __decorateServiceException(exception, parsedOutput.body);
283
505
  };
506
+ const se_Document = (input, context) => {
507
+ return input;
508
+ };
284
509
  const de_Document = (output, context) => {
285
510
  return output;
286
511
  };
512
+ const de_AgentExecutionResult = (output, context) => {
513
+ return take(output, {
514
+ 'error': _json,
515
+ 'output': (_) => de_Document(_, context),
516
+ });
517
+ };
518
+ const de_Chat = (output, context) => {
519
+ return take(output, {
520
+ 'agentId': __expectString,
521
+ 'createdAt': __expectString,
522
+ 'id': __expectString,
523
+ 'mentions': (_) => de_Document(_, context),
524
+ 'options': (_) => de_Document(_, context),
525
+ 'target': __expectString,
526
+ 'title': __expectString,
527
+ 'updatedAt': __expectString,
528
+ });
529
+ };
287
530
  const de_ChatHistory = (output, context) => {
288
531
  return take(output, {
289
532
  'mentions': (_) => de_ChatMentionsList(_, context),
@@ -303,6 +546,12 @@ const de_ChatMessagesList = (output, context) => {
303
546
  });
304
547
  return retVal;
305
548
  };
549
+ const de_ChatsList = (output, context) => {
550
+ const retVal = (output || []).filter((e) => e != null).map((entry) => {
551
+ return de_Chat(entry, context);
552
+ });
553
+ return retVal;
554
+ };
306
555
  const deserializeMetadata = (output) => ({
307
556
  httpStatusCode: output.statusCode,
308
557
  requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],