mavenagi 1.2.4 → 1.2.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 (167) hide show
  1. package/Client.js +2 -2
  2. package/README.md +390 -0
  3. package/api/resources/actions/client/Client.d.ts +11 -1
  4. package/api/resources/actions/client/Client.js +11 -1
  5. package/api/resources/actions/client/requests/ActionPatchRequest.d.ts +11 -1
  6. package/api/resources/agents/client/Client.d.ts +2 -2
  7. package/api/resources/agents/client/Client.js +5 -5
  8. package/api/resources/agents/client/index.d.ts +1 -0
  9. package/api/resources/agents/client/index.js +15 -0
  10. package/api/resources/agents/client/requests/AgentPatchRequest.d.ts +27 -0
  11. package/api/resources/agents/client/requests/index.d.ts +1 -0
  12. package/api/resources/agents/client/requests/index.js +2 -0
  13. package/api/resources/agents/types/Agent.d.ts +8 -0
  14. package/api/resources/agents/types/AgentPrompting.d.ts +23 -0
  15. package/api/resources/agents/types/index.d.ts +1 -1
  16. package/api/resources/agents/types/index.js +1 -1
  17. package/api/resources/analytics/types/ConversationBarChartRequest.d.ts +20 -0
  18. package/api/resources/analytics/types/ConversationDateHistogramRequest.d.ts +13 -1
  19. package/api/resources/analytics/types/ConversationPieChartRequest.d.ts +13 -1
  20. package/api/resources/commons/types/ActionResponse.d.ts +7 -0
  21. package/api/resources/commons/types/SimulationContext.d.ts +6 -0
  22. package/api/resources/conversation/client/Client.d.ts +18 -1
  23. package/api/resources/conversation/client/Client.js +91 -1
  24. package/api/resources/events/client/Client.d.ts +10 -0
  25. package/api/resources/events/client/Client.js +83 -0
  26. package/api/resources/index.d.ts +1 -0
  27. package/api/resources/index.js +1 -0
  28. package/api/resources/knowledge/client/Client.d.ts +32 -1
  29. package/api/resources/knowledge/client/Client.js +104 -1
  30. package/api/resources/knowledge/client/requests/KnowledgeBasePatchRequest.d.ts +11 -1
  31. package/api/resources/knowledge/types/BaseKnowledgeDocument.d.ts +0 -2
  32. package/api/resources/knowledge/types/KnowledgeBaseField.d.ts +1 -0
  33. package/api/resources/knowledge/types/KnowledgeBaseField.js +1 -0
  34. package/api/resources/knowledge/types/KnowledgeBaseFilter.d.ts +5 -0
  35. package/api/resources/knowledge/types/KnowledgeBaseRefreshRequest.d.ts +10 -0
  36. package/api/resources/knowledge/types/KnowledgeBaseRefreshRequest.js +3 -0
  37. package/api/resources/knowledge/types/KnowledgeBaseResponse.d.ts +29 -1
  38. package/api/resources/knowledge/types/KnowledgeBaseType.d.ts +8 -1
  39. package/api/resources/knowledge/types/KnowledgeBaseType.js +8 -1
  40. package/api/resources/knowledge/types/KnowledgeDocumentRequest.d.ts +2 -0
  41. package/api/resources/knowledge/types/KnowledgeDocumentSearchResponse.d.ts +2 -0
  42. package/api/resources/knowledge/types/index.d.ts +1 -0
  43. package/api/resources/knowledge/types/index.js +1 -0
  44. package/dist/Client.js +2 -2
  45. package/dist/api/resources/actions/client/Client.d.ts +11 -1
  46. package/dist/api/resources/actions/client/Client.js +11 -1
  47. package/dist/api/resources/actions/client/requests/ActionPatchRequest.d.ts +11 -1
  48. package/dist/api/resources/agents/client/Client.d.ts +2 -2
  49. package/dist/api/resources/agents/client/Client.js +5 -5
  50. package/dist/api/resources/agents/client/index.d.ts +1 -0
  51. package/dist/api/resources/agents/client/index.js +15 -0
  52. package/dist/api/resources/agents/client/requests/AgentPatchRequest.d.ts +27 -0
  53. package/dist/api/resources/agents/client/requests/AgentPatchRequest.js +3 -0
  54. package/dist/api/resources/agents/client/requests/index.d.ts +1 -0
  55. package/dist/api/resources/agents/client/requests/index.js +2 -0
  56. package/dist/api/resources/agents/types/Agent.d.ts +8 -0
  57. package/dist/api/resources/agents/types/AgentPrompting.d.ts +23 -0
  58. package/dist/api/resources/agents/types/AgentPrompting.js +3 -0
  59. package/dist/api/resources/agents/types/index.d.ts +1 -1
  60. package/dist/api/resources/agents/types/index.js +1 -1
  61. package/dist/api/resources/analytics/types/ConversationBarChartRequest.d.ts +20 -0
  62. package/dist/api/resources/analytics/types/ConversationDateHistogramRequest.d.ts +13 -1
  63. package/dist/api/resources/analytics/types/ConversationPieChartRequest.d.ts +13 -1
  64. package/dist/api/resources/commons/types/ActionResponse.d.ts +7 -0
  65. package/dist/api/resources/commons/types/SimulationContext.d.ts +6 -0
  66. package/dist/api/resources/conversation/client/Client.d.ts +18 -1
  67. package/dist/api/resources/conversation/client/Client.js +91 -1
  68. package/dist/api/resources/events/client/Client.d.ts +10 -0
  69. package/dist/api/resources/events/client/Client.js +83 -0
  70. package/dist/api/resources/index.d.ts +1 -0
  71. package/dist/api/resources/index.js +1 -0
  72. package/dist/api/resources/knowledge/client/Client.d.ts +32 -1
  73. package/dist/api/resources/knowledge/client/Client.js +104 -1
  74. package/dist/api/resources/knowledge/client/requests/KnowledgeBasePatchRequest.d.ts +11 -1
  75. package/dist/api/resources/knowledge/types/BaseKnowledgeDocument.d.ts +0 -2
  76. package/dist/api/resources/knowledge/types/KnowledgeBaseField.d.ts +1 -0
  77. package/dist/api/resources/knowledge/types/KnowledgeBaseField.js +1 -0
  78. package/dist/api/resources/knowledge/types/KnowledgeBaseFilter.d.ts +5 -0
  79. package/dist/api/resources/knowledge/types/KnowledgeBaseRefreshRequest.d.ts +10 -0
  80. package/dist/api/resources/knowledge/types/KnowledgeBaseRefreshRequest.js +3 -0
  81. package/dist/api/resources/knowledge/types/KnowledgeBaseResponse.d.ts +29 -1
  82. package/dist/api/resources/knowledge/types/KnowledgeBaseType.d.ts +8 -1
  83. package/dist/api/resources/knowledge/types/KnowledgeBaseType.js +8 -1
  84. package/dist/api/resources/knowledge/types/KnowledgeDocumentRequest.d.ts +2 -0
  85. package/dist/api/resources/knowledge/types/KnowledgeDocumentSearchResponse.d.ts +2 -0
  86. package/dist/api/resources/knowledge/types/index.d.ts +1 -0
  87. package/dist/api/resources/knowledge/types/index.js +1 -0
  88. package/dist/serialization/resources/agents/client/index.d.ts +1 -0
  89. package/dist/serialization/resources/agents/client/index.js +4 -0
  90. package/dist/serialization/resources/agents/client/requests/AgentPatchRequest.d.ts +21 -0
  91. package/dist/serialization/resources/agents/client/requests/AgentPatchRequest.js +53 -0
  92. package/dist/serialization/resources/agents/client/requests/index.d.ts +1 -0
  93. package/dist/serialization/resources/agents/client/requests/index.js +5 -0
  94. package/dist/serialization/resources/agents/types/Agent.d.ts +3 -0
  95. package/dist/serialization/resources/agents/types/Agent.js +3 -0
  96. package/dist/serialization/resources/agents/types/AgentPrompting.d.ts +14 -0
  97. package/dist/serialization/resources/agents/types/AgentPrompting.js +46 -0
  98. package/dist/serialization/resources/agents/types/index.d.ts +1 -1
  99. package/dist/serialization/resources/agents/types/index.js +1 -1
  100. package/dist/serialization/resources/commons/types/SimulationContext.d.ts +1 -0
  101. package/dist/serialization/resources/commons/types/SimulationContext.js +1 -0
  102. package/dist/serialization/resources/index.d.ts +1 -0
  103. package/dist/serialization/resources/index.js +1 -0
  104. package/dist/serialization/resources/knowledge/types/BaseKnowledgeDocument.d.ts +0 -1
  105. package/dist/serialization/resources/knowledge/types/BaseKnowledgeDocument.js +0 -1
  106. package/dist/serialization/resources/knowledge/types/KnowledgeBaseField.d.ts +1 -1
  107. package/dist/serialization/resources/knowledge/types/KnowledgeBaseField.js +1 -1
  108. package/dist/serialization/resources/knowledge/types/KnowledgeBaseFilter.d.ts +4 -0
  109. package/dist/serialization/resources/knowledge/types/KnowledgeBaseFilter.js +4 -0
  110. package/dist/serialization/resources/knowledge/types/KnowledgeBaseRefreshRequest.d.ts +9 -0
  111. package/dist/serialization/resources/{agents/types/AgentPatchRequest.js → knowledge/types/KnowledgeBaseRefreshRequest.js} +3 -8
  112. package/dist/serialization/resources/knowledge/types/KnowledgeBaseResponse.d.ts +4 -0
  113. package/dist/serialization/resources/knowledge/types/KnowledgeBaseResponse.js +4 -0
  114. package/dist/serialization/resources/knowledge/types/KnowledgeBaseType.d.ts +1 -1
  115. package/dist/serialization/resources/knowledge/types/KnowledgeBaseType.js +1 -1
  116. package/dist/serialization/resources/knowledge/types/KnowledgeDocumentRequest.d.ts +1 -0
  117. package/dist/serialization/resources/knowledge/types/KnowledgeDocumentRequest.js +1 -0
  118. package/dist/serialization/resources/knowledge/types/KnowledgeDocumentSearchResponse.d.ts +1 -0
  119. package/dist/serialization/resources/knowledge/types/KnowledgeDocumentSearchResponse.js +1 -0
  120. package/dist/serialization/resources/knowledge/types/index.d.ts +1 -0
  121. package/dist/serialization/resources/knowledge/types/index.js +1 -0
  122. package/dist/version.d.ts +1 -1
  123. package/dist/version.js +1 -1
  124. package/package.json +1 -1
  125. package/reference.md +237 -4
  126. package/serialization/resources/agents/client/index.d.ts +1 -0
  127. package/serialization/resources/agents/client/index.js +4 -0
  128. package/serialization/resources/agents/client/requests/AgentPatchRequest.d.ts +21 -0
  129. package/serialization/resources/agents/client/requests/AgentPatchRequest.js +53 -0
  130. package/serialization/resources/agents/client/requests/index.d.ts +1 -0
  131. package/serialization/resources/agents/client/requests/index.js +5 -0
  132. package/serialization/resources/agents/types/Agent.d.ts +3 -0
  133. package/serialization/resources/agents/types/Agent.js +3 -0
  134. package/serialization/resources/agents/types/AgentPrompting.d.ts +14 -0
  135. package/serialization/resources/agents/types/AgentPrompting.js +46 -0
  136. package/serialization/resources/agents/types/index.d.ts +1 -1
  137. package/serialization/resources/agents/types/index.js +1 -1
  138. package/serialization/resources/commons/types/SimulationContext.d.ts +1 -0
  139. package/serialization/resources/commons/types/SimulationContext.js +1 -0
  140. package/serialization/resources/index.d.ts +1 -0
  141. package/serialization/resources/index.js +1 -0
  142. package/serialization/resources/knowledge/types/BaseKnowledgeDocument.d.ts +0 -1
  143. package/serialization/resources/knowledge/types/BaseKnowledgeDocument.js +0 -1
  144. package/serialization/resources/knowledge/types/KnowledgeBaseField.d.ts +1 -1
  145. package/serialization/resources/knowledge/types/KnowledgeBaseField.js +1 -1
  146. package/serialization/resources/knowledge/types/KnowledgeBaseFilter.d.ts +4 -0
  147. package/serialization/resources/knowledge/types/KnowledgeBaseFilter.js +4 -0
  148. package/serialization/resources/knowledge/types/KnowledgeBaseRefreshRequest.d.ts +9 -0
  149. package/serialization/resources/{agents/types/AgentPatchRequest.js → knowledge/types/KnowledgeBaseRefreshRequest.js} +3 -8
  150. package/serialization/resources/knowledge/types/KnowledgeBaseResponse.d.ts +4 -0
  151. package/serialization/resources/knowledge/types/KnowledgeBaseResponse.js +4 -0
  152. package/serialization/resources/knowledge/types/KnowledgeBaseType.d.ts +1 -1
  153. package/serialization/resources/knowledge/types/KnowledgeBaseType.js +1 -1
  154. package/serialization/resources/knowledge/types/KnowledgeDocumentRequest.d.ts +1 -0
  155. package/serialization/resources/knowledge/types/KnowledgeDocumentRequest.js +1 -0
  156. package/serialization/resources/knowledge/types/KnowledgeDocumentSearchResponse.d.ts +1 -0
  157. package/serialization/resources/knowledge/types/KnowledgeDocumentSearchResponse.js +1 -0
  158. package/serialization/resources/knowledge/types/index.d.ts +1 -0
  159. package/serialization/resources/knowledge/types/index.js +1 -0
  160. package/version.d.ts +1 -1
  161. package/version.js +1 -1
  162. package/api/resources/agents/types/AgentPatchRequest.d.ts +0 -11
  163. package/dist/api/resources/agents/types/AgentPatchRequest.d.ts +0 -11
  164. package/dist/serialization/resources/agents/types/AgentPatchRequest.d.ts +0 -14
  165. package/serialization/resources/agents/types/AgentPatchRequest.d.ts +0 -14
  166. /package/api/resources/agents/{types → client/requests}/AgentPatchRequest.js +0 -0
  167. /package/{dist/api/resources/agents/types/AgentPatchRequest.js → api/resources/agents/types/AgentPrompting.js} +0 -0
package/Client.js CHANGED
@@ -59,8 +59,8 @@ class MavenAGIClient {
59
59
  "X-Agent-Id": _options === null || _options === void 0 ? void 0 : _options.agentId,
60
60
  "X-Fern-Language": "JavaScript",
61
61
  "X-Fern-SDK-Name": "mavenagi",
62
- "X-Fern-SDK-Version": "1.2.4",
63
- "User-Agent": "mavenagi/1.2.4",
62
+ "X-Fern-SDK-Version": "1.2.5",
63
+ "User-Agent": "mavenagi/1.2.5",
64
64
  "X-Fern-Runtime": core.RUNTIME.type,
65
65
  "X-Fern-Runtime-Version": core.RUNTIME.version,
66
66
  }, _options === null || _options === void 0 ? void 0 : _options.headers) });
package/README.md CHANGED
@@ -102,6 +102,396 @@ try {
102
102
  }
103
103
  ```
104
104
 
105
+ ## Binary Response
106
+
107
+ You can consume binary data from endpoints using the `BinaryResponse` type which lets you choose how to consume the data:
108
+
109
+ ```typescript
110
+ const response = await client.conversation.export(...);
111
+ const stream: ReadableStream<Uint8Array> = response.stream();
112
+ // const arrayBuffer: ArrayBuffer = await response.arrayBuffer();
113
+ // const blob: Blob = response.blob();
114
+ // const bytes: Uint8Array = response.bytes();
115
+ // You can only use the response body once, so you must choose one of the above methods.
116
+ // If you want to check if the response body has been used, you can use the following property.
117
+ const bodyUsed = response.bodyUsed;
118
+ ```
119
+
120
+ <details>
121
+ <summary>Save binary response to a file</summary>
122
+
123
+ <blockquote>
124
+ <details>
125
+ <summary>Node.js</summary>
126
+
127
+ <blockquote>
128
+ <details>
129
+ <summary>ReadableStream (most-efficient)</summary>
130
+
131
+ ```ts
132
+ import { createWriteStream } from 'fs';
133
+ import { Readable } from 'stream';
134
+ import { pipeline } from 'stream/promises';
135
+
136
+ const response = await client.conversation.export(...);
137
+
138
+ const stream = response.stream();
139
+ const nodeStream = Readable.fromWeb(stream);
140
+ const writeStream = createWriteStream('path/to/file');
141
+
142
+ await pipeline(nodeStream, writeStream);
143
+ ```
144
+
145
+ </details>
146
+ </blockquote>
147
+
148
+ <blockquote>
149
+ <details>
150
+ <summary>ArrayBuffer</summary>
151
+
152
+ ```ts
153
+ import { writeFile } from 'fs/promises';
154
+
155
+ const response = await client.conversation.export(...);
156
+
157
+ const arrayBuffer = await response.arrayBuffer();
158
+ await writeFile('path/to/file', Buffer.from(arrayBuffer));
159
+ ```
160
+
161
+ </details>
162
+ </blockquote>
163
+
164
+ <blockquote>
165
+ <details>
166
+ <summary>Blob</summary>
167
+
168
+ ```ts
169
+ import { writeFile } from 'fs/promises';
170
+
171
+ const response = await client.conversation.export(...);
172
+
173
+ const blob = await response.blob();
174
+ const arrayBuffer = await blob.arrayBuffer();
175
+ await writeFile('output.bin', Buffer.from(arrayBuffer));
176
+ ```
177
+
178
+ </details>
179
+ </blockquote>
180
+
181
+ <blockquote>
182
+ <details>
183
+ <summary>Bytes (UIntArray8)</summary>
184
+
185
+ ```ts
186
+ import { writeFile } from 'fs/promises';
187
+
188
+ const response = await client.conversation.export(...);
189
+
190
+ const bytes = await response.bytes();
191
+ await writeFile('path/to/file', bytes);
192
+ ```
193
+
194
+ </details>
195
+ </blockquote>
196
+
197
+ </details>
198
+ </blockquote>
199
+
200
+ <blockquote>
201
+ <details>
202
+ <summary>Bun</summary>
203
+
204
+ <blockquote>
205
+ <details>
206
+ <summary>ReadableStream (most-efficient)</summary>
207
+
208
+ ```ts
209
+ const response = await client.conversation.export(...);
210
+
211
+ const stream = response.stream();
212
+ await Bun.write('path/to/file', stream);
213
+ ```
214
+
215
+ </details>
216
+ </blockquote>
217
+
218
+ <blockquote>
219
+ <details>
220
+ <summary>ArrayBuffer</summary>
221
+
222
+ ```ts
223
+ const response = await client.conversation.export(...);
224
+
225
+ const arrayBuffer = await response.arrayBuffer();
226
+ await Bun.write('path/to/file', arrayBuffer);
227
+ ```
228
+
229
+ </details>
230
+ </blockquote>
231
+
232
+ <blockquote>
233
+ <details>
234
+ <summary>Blob</summary>
235
+
236
+ ```ts
237
+ const response = await client.conversation.export(...);
238
+
239
+ const blob = await response.blob();
240
+ await Bun.write('path/to/file', blob);
241
+ ```
242
+
243
+ </details>
244
+ </blockquote>
245
+
246
+ <blockquote>
247
+ <details>
248
+ <summary>Bytes (UIntArray8)</summary>
249
+
250
+ ```ts
251
+ const response = await client.conversation.export(...);
252
+
253
+ const bytes = await response.bytes();
254
+ await Bun.write('path/to/file', bytes);
255
+ ```
256
+
257
+ </details>
258
+ </blockquote>
259
+
260
+ </details>
261
+ </blockquote>
262
+
263
+ <blockquote>
264
+ <details>
265
+ <summary>Deno</summary>
266
+
267
+ <blockquote>
268
+ <details>
269
+ <summary>ReadableStream (most-efficient)</summary>
270
+
271
+ ```ts
272
+ const response = await client.conversation.export(...);
273
+
274
+ const stream = response.stream();
275
+ const file = await Deno.open('path/to/file', { write: true, create: true });
276
+ await stream.pipeTo(file.writable);
277
+ ```
278
+
279
+ </details>
280
+ </blockquote>
281
+
282
+ <blockquote>
283
+ <details>
284
+ <summary>ArrayBuffer</summary>
285
+
286
+ ```ts
287
+ const response = await client.conversation.export(...);
288
+
289
+ const arrayBuffer = await response.arrayBuffer();
290
+ await Deno.writeFile('path/to/file', new Uint8Array(arrayBuffer));
291
+ ```
292
+
293
+ </details>
294
+ </blockquote>
295
+
296
+ <blockquote>
297
+ <details>
298
+ <summary>Blob</summary>
299
+
300
+ ```ts
301
+ const response = await client.conversation.export(...);
302
+
303
+ const blob = await response.blob();
304
+ const arrayBuffer = await blob.arrayBuffer();
305
+ await Deno.writeFile('path/to/file', new Uint8Array(arrayBuffer));
306
+ ```
307
+
308
+ </details>
309
+ </blockquote>
310
+
311
+ <blockquote>
312
+ <details>
313
+ <summary>Bytes (UIntArray8)</summary>
314
+
315
+ ```ts
316
+ const response = await client.conversation.export(...);
317
+
318
+ const bytes = await response.bytes();
319
+ await Deno.writeFile('path/to/file', bytes);
320
+ ```
321
+
322
+ </details>
323
+ </blockquote>
324
+
325
+ </details>
326
+ </blockquote>
327
+
328
+ <blockquote>
329
+ <details>
330
+ <summary>Browser</summary>
331
+
332
+ <blockquote>
333
+ <details>
334
+ <summary>Blob (most-efficient)</summary>
335
+
336
+ ```ts
337
+ const response = await client.conversation.export(...);
338
+
339
+ const blob = await response.blob();
340
+ const url = URL.createObjectURL(blob);
341
+
342
+ // trigger download
343
+ const a = document.createElement('a');
344
+ a.href = url;
345
+ a.download = 'filename';
346
+ a.click();
347
+ URL.revokeObjectURL(url);
348
+ ```
349
+
350
+ </details>
351
+ </blockquote>
352
+
353
+ <blockquote>
354
+ <details>
355
+ <summary>ReadableStream</summary>
356
+
357
+ ```ts
358
+ const response = await client.conversation.export(...);
359
+
360
+ const stream = response.stream();
361
+ const reader = stream.getReader();
362
+ const chunks = [];
363
+
364
+ while (true) {
365
+ const { done, value } = await reader.read();
366
+ if (done) break;
367
+ chunks.push(value);
368
+ }
369
+
370
+ const blob = new Blob(chunks);
371
+ const url = URL.createObjectURL(blob);
372
+
373
+ // trigger download
374
+ const a = document.createElement('a');
375
+ a.href = url;
376
+ a.download = 'filename';
377
+ a.click();
378
+ URL.revokeObjectURL(url);
379
+ ```
380
+
381
+ </details>
382
+ </blockquote>
383
+
384
+ <blockquote>
385
+ <details>
386
+ <summary>ArrayBuffer</summary>
387
+
388
+ ```ts
389
+ const response = await client.conversation.export(...);
390
+
391
+ const arrayBuffer = await response.arrayBuffer();
392
+ const blob = new Blob([arrayBuffer]);
393
+ const url = URL.createObjectURL(blob);
394
+
395
+ // trigger download
396
+ const a = document.createElement('a');
397
+ a.href = url;
398
+ a.download = 'filename';
399
+ a.click();
400
+ URL.revokeObjectURL(url);
401
+ ```
402
+
403
+ </details>
404
+ </blockquote>
405
+
406
+ <blockquote>
407
+ <details>
408
+ <summary>Bytes (UIntArray8)</summary>
409
+
410
+ ```ts
411
+ const response = await client.conversation.export(...);
412
+
413
+ const bytes = await response.bytes();
414
+ const blob = new Blob([bytes]);
415
+ const url = URL.createObjectURL(blob);
416
+
417
+ // trigger download
418
+ const a = document.createElement('a');
419
+ a.href = url;
420
+ a.download = 'filename';
421
+ a.click();
422
+ URL.revokeObjectURL(url);
423
+ ```
424
+
425
+ </details>
426
+ </blockquote>
427
+
428
+ </details>
429
+ </blockquote>
430
+
431
+ </details>
432
+ </blockquote>
433
+
434
+ <details>
435
+ <summary>Convert binary response to text</summary>
436
+
437
+ <blockquote>
438
+ <details>
439
+ <summary>ReadableStream</summary>
440
+
441
+ ```ts
442
+ const response = await client.conversation.export(...);
443
+
444
+ const stream = response.stream();
445
+ const text = await new Response(stream).text();
446
+ ```
447
+
448
+ </details>
449
+ </blockquote>
450
+
451
+ <blockquote>
452
+ <details>
453
+ <summary>ArrayBuffer</summary>
454
+
455
+ ```ts
456
+ const response = await client.conversation.export(...);
457
+
458
+ const arrayBuffer = await response.arrayBuffer();
459
+ const text = new TextDecoder().decode(arrayBuffer);
460
+ ```
461
+
462
+ </details>
463
+ </blockquote>
464
+
465
+ <blockquote>
466
+ <details>
467
+ <summary>Blob</summary>
468
+
469
+ ```ts
470
+ const response = await client.conversation.export(...);
471
+
472
+ const blob = await response.blob();
473
+ const text = await blob.text();
474
+ ```
475
+
476
+ </details>
477
+ </blockquote>
478
+
479
+ <blockquote>
480
+ <details>
481
+ <summary>Bytes (UIntArray8)</summary>
482
+
483
+ ```ts
484
+ const response = await client.conversation.export(...);
485
+
486
+ const bytes = await response.bytes();
487
+ const text = new TextDecoder().decode(bytes);
488
+ ```
489
+
490
+ </details>
491
+ </blockquote>
492
+
493
+ </details>
494
+
105
495
  ## Advanced
106
496
 
107
497
  ### Additional Headers
@@ -115,7 +115,17 @@ export declare class Actions {
115
115
  * @throws {@link MavenAGI.ServerError}
116
116
  *
117
117
  * @example
118
- * await client.actions.patch("actionReferenceId")
118
+ * await client.actions.patch("get-balance", {
119
+ * instructions: "Use this action when the user asks about their account balance or remaining credits.",
120
+ * llmInclusionStatus: "WHEN_RELEVANT",
121
+ * segmentId: {
122
+ * referenceId: "premium-users",
123
+ * appId: "my-billing-system",
124
+ * organizationId: "acme",
125
+ * agentId: "support",
126
+ * type: "SEGMENT"
127
+ * }
128
+ * })
119
129
  */
120
130
  patch(actionReferenceId: string, request?: MavenAGI.ActionPatchRequest, requestOptions?: Actions.RequestOptions): core.HttpResponsePromise<MavenAGI.ActionResponse>;
121
131
  private __patch;
@@ -375,7 +375,17 @@ class Actions {
375
375
  * @throws {@link MavenAGI.ServerError}
376
376
  *
377
377
  * @example
378
- * await client.actions.patch("actionReferenceId")
378
+ * await client.actions.patch("get-balance", {
379
+ * instructions: "Use this action when the user asks about their account balance or remaining credits.",
380
+ * llmInclusionStatus: "WHEN_RELEVANT",
381
+ * segmentId: {
382
+ * referenceId: "premium-users",
383
+ * appId: "my-billing-system",
384
+ * organizationId: "acme",
385
+ * agentId: "support",
386
+ * type: "SEGMENT"
387
+ * }
388
+ * })
379
389
  */
380
390
  patch(actionReferenceId, request = {}, requestOptions) {
381
391
  return core.HttpResponsePromise.fromPromise(this.__patch(actionReferenceId, request, requestOptions));
@@ -1,7 +1,17 @@
1
1
  import * as MavenAGI from "../../../../index";
2
2
  /**
3
3
  * @example
4
- * {}
4
+ * {
5
+ * instructions: "Use this action when the user asks about their account balance or remaining credits.",
6
+ * llmInclusionStatus: "WHEN_RELEVANT",
7
+ * segmentId: {
8
+ * referenceId: "premium-users",
9
+ * appId: "my-billing-system",
10
+ * organizationId: "acme",
11
+ * agentId: "support",
12
+ * type: "SEGMENT"
13
+ * }
14
+ * }
5
15
  */
6
16
  export interface ActionPatchRequest {
7
17
  /** The App ID of the action to patch. If not provided the ID of the calling app will be used. */
@@ -128,9 +128,9 @@ export declare class Agents {
128
128
  * @throws {@link MavenAGI.ServerError}
129
129
  *
130
130
  * @example
131
- * await client.agents.patch("organizationReferenceId", "agentReferenceId", {})
131
+ * await client.agents.patch("organizationReferenceId", "agentReferenceId")
132
132
  */
133
- patch(organizationReferenceId: string, agentReferenceId: string, request: MavenAGI.AgentPatchRequest, requestOptions?: Agents.RequestOptions): core.HttpResponsePromise<MavenAGI.Agent>;
133
+ patch(organizationReferenceId: string, agentReferenceId: string, request?: MavenAGI.AgentPatchRequest, requestOptions?: Agents.RequestOptions): core.HttpResponsePromise<MavenAGI.Agent>;
134
134
  private __patch;
135
135
  /**
136
136
  * Delete an agent.
@@ -460,13 +460,13 @@ class Agents {
460
460
  * @throws {@link MavenAGI.ServerError}
461
461
  *
462
462
  * @example
463
- * await client.agents.patch("organizationReferenceId", "agentReferenceId", {})
463
+ * await client.agents.patch("organizationReferenceId", "agentReferenceId")
464
464
  */
465
- patch(organizationReferenceId, agentReferenceId, request, requestOptions) {
465
+ patch(organizationReferenceId, agentReferenceId, request = {}, requestOptions) {
466
466
  return core.HttpResponsePromise.fromPromise(this.__patch(organizationReferenceId, agentReferenceId, request, requestOptions));
467
467
  }
468
- __patch(organizationReferenceId, agentReferenceId, request, requestOptions) {
469
- return __awaiter(this, void 0, void 0, function* () {
468
+ __patch(organizationReferenceId_1, agentReferenceId_1) {
469
+ return __awaiter(this, arguments, void 0, function* (organizationReferenceId, agentReferenceId, request = {}, requestOptions) {
470
470
  var _a, _b, _c, _d, _e, _f, _g, _h;
471
471
  let _headers = (0, headers_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
472
472
  Authorization: yield this._getAuthorizationHeader(),
@@ -477,7 +477,7 @@ class Agents {
477
477
  url: core.url.join((_h = (_g = (yield core.Supplier.get(this._options.baseUrl))) !== null && _g !== void 0 ? _g : (yield core.Supplier.get(this._options.environment))) !== null && _h !== void 0 ? _h : environments.MavenAGIEnvironment.Production, `/v1/organizations/${encodeURIComponent(organizationReferenceId)}/agents/${encodeURIComponent(agentReferenceId)}`),
478
478
  method: "PATCH",
479
479
  headers: _headers,
480
- contentType: "application/json",
480
+ contentType: "application/merge-patch+json",
481
481
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
482
482
  requestType: "json",
483
483
  body: serializers.AgentPatchRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -1 +1,2 @@
1
1
  export {};
2
+ export * from "./requests";
@@ -1,2 +1,17 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
2
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./requests"), exports);
@@ -0,0 +1,27 @@
1
+ import * as MavenAGI from "../../../../index";
2
+ /**
3
+ * @example
4
+ * {}
5
+ */
6
+ export interface AgentPatchRequest {
7
+ /** The name of the agent. */
8
+ name?: string;
9
+ /** The environment of the agent. */
10
+ environment?: MavenAGI.AgentEnvironment;
11
+ /** The agent's default timezone. This is used when a timezone is not set on a conversation. */
12
+ defaultTimezone?: string;
13
+ /** The PII categories that are enabled for the agent. */
14
+ enabledPiiCategories?: Set<MavenAGI.PiiCategory>;
15
+ /** The system fallback message. */
16
+ systemFallbackMessage?: string | null;
17
+ /** The overall persona of the agent. */
18
+ persona?: MavenAGI.LlmPersona;
19
+ /** Additional text directly appended to the prompt. */
20
+ additionalPromptText?: string | null;
21
+ /** LLM prompt for category generation. */
22
+ categoryGenerationPromptText?: string | null;
23
+ /** LLM prompt for generating a response when the user's question has been detected as unsafe. */
24
+ contentSafetyViolationResponsePromptText?: string | null;
25
+ /** Return the system fallback message on all questions that have no relevant knowledge bases or actions. */
26
+ rejectQuestionsWithoutKnowledge?: boolean;
27
+ }
@@ -0,0 +1 @@
1
+ export { type AgentPatchRequest } from "./AgentPatchRequest";
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -20,4 +20,12 @@ export interface Agent {
20
20
  * `UsUkPassportNumber`, `UsSocialSecurityNumber`.
21
21
  */
22
22
  enabledPiiCategories: Set<MavenAGI.PiiCategory>;
23
+ /**
24
+ * Text shown to end users when the system encounters an error while generating a bot response message.
25
+ *
26
+ * This text is also used when a content safety violation is detected, unless `contentSafetyViolationPromptText` is set.
27
+ */
28
+ systemFallbackMessage?: string;
29
+ /** Agent prompting settings. */
30
+ prompting: MavenAGI.AgentPrompting;
23
31
  }
@@ -0,0 +1,23 @@
1
+ import * as MavenAGI from "../../../index";
2
+ export interface AgentPrompting {
3
+ /** The overall persona of the agent. */
4
+ persona: MavenAGI.LlmPersona;
5
+ /** Additional text directly appended to the prompt. This field is replaced by Knowledge Documents with `llmInclusionsStatus` set to `ALWAYS`. */
6
+ additionalPromptText?: string;
7
+ /**
8
+ * LLM prompt for category generation.
9
+ *
10
+ * Use this to specify a fixed set of categories that an LLM should choose from when analyzing a conversation.
11
+ * When not set uses a default prompt which gives the LLM flexibility to determine appropriate categories on its own.
12
+ */
13
+ categoryGenerationPromptText?: string;
14
+ /**
15
+ * LLM prompt for generating a response when the user's question has been detected as unsafe.
16
+ *
17
+ * Use this to provide custom LLM generated replies when dealing with content safety violations.
18
+ * When not set, the system fallback message will be used and replies will not be personalized by the LLM as it will not be involved.
19
+ */
20
+ contentSafetyViolationResponsePromptText?: string;
21
+ /** Return the system fallback message on all questions that have no relevant knowledge bases or actions. */
22
+ rejectQuestionsWithoutKnowledge: boolean;
23
+ }
@@ -2,8 +2,8 @@ export * from "./PiiCategory";
2
2
  export * from "./AgentEnvironment";
3
3
  export * from "./Agent";
4
4
  export * from "./CreateAgentRequest";
5
- export * from "./AgentPatchRequest";
6
5
  export * from "./AgentsSearchRequest";
7
6
  export * from "./AgentField";
8
7
  export * from "./AgentFilter";
9
8
  export * from "./AgentsSearchResponse";
9
+ export * from "./AgentPrompting";
@@ -18,8 +18,8 @@ __exportStar(require("./PiiCategory"), exports);
18
18
  __exportStar(require("./AgentEnvironment"), exports);
19
19
  __exportStar(require("./Agent"), exports);
20
20
  __exportStar(require("./CreateAgentRequest"), exports);
21
- __exportStar(require("./AgentPatchRequest"), exports);
22
21
  __exportStar(require("./AgentsSearchRequest"), exports);
23
22
  __exportStar(require("./AgentField"), exports);
24
23
  __exportStar(require("./AgentFilter"), exports);
25
24
  __exportStar(require("./AgentsSearchResponse"), exports);
25
+ __exportStar(require("./AgentPrompting"), exports);
@@ -3,6 +3,16 @@ export interface ConversationBarChartRequest extends MavenAGI.ConversationAnalyt
3
3
  /**
4
4
  * Determines how data is grouped along the x-axis. Each unique value forms a separate bar.
5
5
  * The name of the bar is derived from the grouping field's value or range.
6
+ *
7
+ * **Label Formats by Field:**
8
+ * - `Sources`: Document title (e.g., "Product Documentation")
9
+ * - `Actions`: "Action Name - App Name" (e.g., "Create Ticket - Freshdesk")
10
+ * - `IncompleteActions`: "Action Name - App Name" (e.g., "Search Documents - Zendesk")
11
+ * - `Users`: User identifier value (e.g., "user@example.com")
12
+ * - `InboxItems`: Inbox item title
13
+ * - `HumanAgents`: Human agent display name
14
+ * - `HumanAgentsWithInserts`: Human agent display name (for agents who made inserts)
15
+ * - Other fields: Field value as stored (e.g., "GOOD", "NEEDS_IMPROVEMENT" for Quality)
6
16
  */
7
17
  barDefinition: MavenAGI.ConversationGroupBy;
8
18
  /** Metric defining the y-axis values for the bar chart. */
@@ -10,6 +20,16 @@ export interface ConversationBarChartRequest extends MavenAGI.ConversationAnalyt
10
20
  /**
11
21
  * Optionally defines vertical grouping within each bar, producing multiple series.
12
22
  * If omitted, a single series is generated.
23
+ *
24
+ * **Series Name Formats by Field:**
25
+ * - `Sources`: Document title (e.g., "Product Documentation")
26
+ * - `Actions`: "Action Name - App Name" (e.g., "Create Ticket - Freshdesk")
27
+ * - `IncompleteActions`: "Action Name - App Name" (e.g., "Search Documents - Zendesk")
28
+ * - `Users`: User identifier value (e.g., "user@example.com")
29
+ * - `InboxItems`: Inbox item title
30
+ * - `HumanAgents`: Human agent display name
31
+ * - `HumanAgentsWithInserts`: Human agent display name (for agents who made inserts)
32
+ * - Other fields: Field value as stored (e.g., "GOOD", "NEEDS_IMPROVEMENT" for Quality)
13
33
  */
14
34
  verticalGrouping?: MavenAGI.ConversationGroupBy;
15
35
  }
@@ -2,7 +2,19 @@ import * as MavenAGI from "../../../index";
2
2
  export interface ConversationDateHistogramRequest extends MavenAGI.ConversationAnalyticsRequest {
3
3
  /** Time-based grouping interval (e.g., HOUR, DAY, WEEK) for the date histogram. */
4
4
  timeInterval: MavenAGI.TimeInterval;
5
- /** Groups data before applying calculations, forming a separate time series for each group. */
5
+ /**
6
+ * Groups data before applying calculations, forming a separate time series for each group.
7
+ *
8
+ * **Series Name Formats by Field:**
9
+ * - `Sources`: Document title (e.g., "Product Documentation")
10
+ * - `Actions`: "Action Name - App Name" (e.g., "Create Ticket - Freshdesk")
11
+ * - `IncompleteActions`: "Action Name - App Name" (e.g., "Search Documents - Zendesk")
12
+ * - `Users`: User identifier value (e.g., "user@example.com")
13
+ * - `InboxItems`: Inbox item title
14
+ * - `HumanAgents`: Human agent display name
15
+ * - `HumanAgentsWithInserts`: Human agent display name (for agents who made inserts)
16
+ * - Other fields: Field value as stored (e.g., "GOOD", "NEEDS_IMPROVEMENT" for Quality)
17
+ */
6
18
  groupBy?: MavenAGI.ConversationGroupBy;
7
19
  /** Defines the y-axis values for the date histogram. */
8
20
  metric: MavenAGI.ConversationMetric;