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.
- package/Client.js +2 -2
- package/README.md +390 -0
- package/api/resources/actions/client/Client.d.ts +11 -1
- package/api/resources/actions/client/Client.js +11 -1
- package/api/resources/actions/client/requests/ActionPatchRequest.d.ts +11 -1
- package/api/resources/agents/client/Client.d.ts +2 -2
- package/api/resources/agents/client/Client.js +5 -5
- package/api/resources/agents/client/index.d.ts +1 -0
- package/api/resources/agents/client/index.js +15 -0
- package/api/resources/agents/client/requests/AgentPatchRequest.d.ts +27 -0
- package/api/resources/agents/client/requests/index.d.ts +1 -0
- package/api/resources/agents/client/requests/index.js +2 -0
- package/api/resources/agents/types/Agent.d.ts +8 -0
- package/api/resources/agents/types/AgentPrompting.d.ts +23 -0
- package/api/resources/agents/types/index.d.ts +1 -1
- package/api/resources/agents/types/index.js +1 -1
- package/api/resources/analytics/types/ConversationBarChartRequest.d.ts +20 -0
- package/api/resources/analytics/types/ConversationDateHistogramRequest.d.ts +13 -1
- package/api/resources/analytics/types/ConversationPieChartRequest.d.ts +13 -1
- package/api/resources/commons/types/ActionResponse.d.ts +7 -0
- package/api/resources/commons/types/SimulationContext.d.ts +6 -0
- package/api/resources/conversation/client/Client.d.ts +18 -1
- package/api/resources/conversation/client/Client.js +91 -1
- package/api/resources/events/client/Client.d.ts +10 -0
- package/api/resources/events/client/Client.js +83 -0
- package/api/resources/index.d.ts +1 -0
- package/api/resources/index.js +1 -0
- package/api/resources/knowledge/client/Client.d.ts +32 -1
- package/api/resources/knowledge/client/Client.js +104 -1
- package/api/resources/knowledge/client/requests/KnowledgeBasePatchRequest.d.ts +11 -1
- package/api/resources/knowledge/types/BaseKnowledgeDocument.d.ts +0 -2
- package/api/resources/knowledge/types/KnowledgeBaseField.d.ts +1 -0
- package/api/resources/knowledge/types/KnowledgeBaseField.js +1 -0
- package/api/resources/knowledge/types/KnowledgeBaseFilter.d.ts +5 -0
- package/api/resources/knowledge/types/KnowledgeBaseRefreshRequest.d.ts +10 -0
- package/api/resources/knowledge/types/KnowledgeBaseRefreshRequest.js +3 -0
- package/api/resources/knowledge/types/KnowledgeBaseResponse.d.ts +29 -1
- package/api/resources/knowledge/types/KnowledgeBaseType.d.ts +8 -1
- package/api/resources/knowledge/types/KnowledgeBaseType.js +8 -1
- package/api/resources/knowledge/types/KnowledgeDocumentRequest.d.ts +2 -0
- package/api/resources/knowledge/types/KnowledgeDocumentSearchResponse.d.ts +2 -0
- package/api/resources/knowledge/types/index.d.ts +1 -0
- package/api/resources/knowledge/types/index.js +1 -0
- package/dist/Client.js +2 -2
- package/dist/api/resources/actions/client/Client.d.ts +11 -1
- package/dist/api/resources/actions/client/Client.js +11 -1
- package/dist/api/resources/actions/client/requests/ActionPatchRequest.d.ts +11 -1
- package/dist/api/resources/agents/client/Client.d.ts +2 -2
- package/dist/api/resources/agents/client/Client.js +5 -5
- package/dist/api/resources/agents/client/index.d.ts +1 -0
- package/dist/api/resources/agents/client/index.js +15 -0
- package/dist/api/resources/agents/client/requests/AgentPatchRequest.d.ts +27 -0
- package/dist/api/resources/agents/client/requests/AgentPatchRequest.js +3 -0
- package/dist/api/resources/agents/client/requests/index.d.ts +1 -0
- package/dist/api/resources/agents/client/requests/index.js +2 -0
- package/dist/api/resources/agents/types/Agent.d.ts +8 -0
- package/dist/api/resources/agents/types/AgentPrompting.d.ts +23 -0
- package/dist/api/resources/agents/types/AgentPrompting.js +3 -0
- package/dist/api/resources/agents/types/index.d.ts +1 -1
- package/dist/api/resources/agents/types/index.js +1 -1
- package/dist/api/resources/analytics/types/ConversationBarChartRequest.d.ts +20 -0
- package/dist/api/resources/analytics/types/ConversationDateHistogramRequest.d.ts +13 -1
- package/dist/api/resources/analytics/types/ConversationPieChartRequest.d.ts +13 -1
- package/dist/api/resources/commons/types/ActionResponse.d.ts +7 -0
- package/dist/api/resources/commons/types/SimulationContext.d.ts +6 -0
- package/dist/api/resources/conversation/client/Client.d.ts +18 -1
- package/dist/api/resources/conversation/client/Client.js +91 -1
- package/dist/api/resources/events/client/Client.d.ts +10 -0
- package/dist/api/resources/events/client/Client.js +83 -0
- package/dist/api/resources/index.d.ts +1 -0
- package/dist/api/resources/index.js +1 -0
- package/dist/api/resources/knowledge/client/Client.d.ts +32 -1
- package/dist/api/resources/knowledge/client/Client.js +104 -1
- package/dist/api/resources/knowledge/client/requests/KnowledgeBasePatchRequest.d.ts +11 -1
- package/dist/api/resources/knowledge/types/BaseKnowledgeDocument.d.ts +0 -2
- package/dist/api/resources/knowledge/types/KnowledgeBaseField.d.ts +1 -0
- package/dist/api/resources/knowledge/types/KnowledgeBaseField.js +1 -0
- package/dist/api/resources/knowledge/types/KnowledgeBaseFilter.d.ts +5 -0
- package/dist/api/resources/knowledge/types/KnowledgeBaseRefreshRequest.d.ts +10 -0
- package/dist/api/resources/knowledge/types/KnowledgeBaseRefreshRequest.js +3 -0
- package/dist/api/resources/knowledge/types/KnowledgeBaseResponse.d.ts +29 -1
- package/dist/api/resources/knowledge/types/KnowledgeBaseType.d.ts +8 -1
- package/dist/api/resources/knowledge/types/KnowledgeBaseType.js +8 -1
- package/dist/api/resources/knowledge/types/KnowledgeDocumentRequest.d.ts +2 -0
- package/dist/api/resources/knowledge/types/KnowledgeDocumentSearchResponse.d.ts +2 -0
- package/dist/api/resources/knowledge/types/index.d.ts +1 -0
- package/dist/api/resources/knowledge/types/index.js +1 -0
- package/dist/serialization/resources/agents/client/index.d.ts +1 -0
- package/dist/serialization/resources/agents/client/index.js +4 -0
- package/dist/serialization/resources/agents/client/requests/AgentPatchRequest.d.ts +21 -0
- package/dist/serialization/resources/agents/client/requests/AgentPatchRequest.js +53 -0
- package/dist/serialization/resources/agents/client/requests/index.d.ts +1 -0
- package/dist/serialization/resources/agents/client/requests/index.js +5 -0
- package/dist/serialization/resources/agents/types/Agent.d.ts +3 -0
- package/dist/serialization/resources/agents/types/Agent.js +3 -0
- package/dist/serialization/resources/agents/types/AgentPrompting.d.ts +14 -0
- package/dist/serialization/resources/agents/types/AgentPrompting.js +46 -0
- package/dist/serialization/resources/agents/types/index.d.ts +1 -1
- package/dist/serialization/resources/agents/types/index.js +1 -1
- package/dist/serialization/resources/commons/types/SimulationContext.d.ts +1 -0
- package/dist/serialization/resources/commons/types/SimulationContext.js +1 -0
- package/dist/serialization/resources/index.d.ts +1 -0
- package/dist/serialization/resources/index.js +1 -0
- package/dist/serialization/resources/knowledge/types/BaseKnowledgeDocument.d.ts +0 -1
- package/dist/serialization/resources/knowledge/types/BaseKnowledgeDocument.js +0 -1
- package/dist/serialization/resources/knowledge/types/KnowledgeBaseField.d.ts +1 -1
- package/dist/serialization/resources/knowledge/types/KnowledgeBaseField.js +1 -1
- package/dist/serialization/resources/knowledge/types/KnowledgeBaseFilter.d.ts +4 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeBaseFilter.js +4 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeBaseRefreshRequest.d.ts +9 -0
- package/dist/serialization/resources/{agents/types/AgentPatchRequest.js → knowledge/types/KnowledgeBaseRefreshRequest.js} +3 -8
- package/dist/serialization/resources/knowledge/types/KnowledgeBaseResponse.d.ts +4 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeBaseResponse.js +4 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeBaseType.d.ts +1 -1
- package/dist/serialization/resources/knowledge/types/KnowledgeBaseType.js +1 -1
- package/dist/serialization/resources/knowledge/types/KnowledgeDocumentRequest.d.ts +1 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeDocumentRequest.js +1 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeDocumentSearchResponse.d.ts +1 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeDocumentSearchResponse.js +1 -0
- package/dist/serialization/resources/knowledge/types/index.d.ts +1 -0
- package/dist/serialization/resources/knowledge/types/index.js +1 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/reference.md +237 -4
- package/serialization/resources/agents/client/index.d.ts +1 -0
- package/serialization/resources/agents/client/index.js +4 -0
- package/serialization/resources/agents/client/requests/AgentPatchRequest.d.ts +21 -0
- package/serialization/resources/agents/client/requests/AgentPatchRequest.js +53 -0
- package/serialization/resources/agents/client/requests/index.d.ts +1 -0
- package/serialization/resources/agents/client/requests/index.js +5 -0
- package/serialization/resources/agents/types/Agent.d.ts +3 -0
- package/serialization/resources/agents/types/Agent.js +3 -0
- package/serialization/resources/agents/types/AgentPrompting.d.ts +14 -0
- package/serialization/resources/agents/types/AgentPrompting.js +46 -0
- package/serialization/resources/agents/types/index.d.ts +1 -1
- package/serialization/resources/agents/types/index.js +1 -1
- package/serialization/resources/commons/types/SimulationContext.d.ts +1 -0
- package/serialization/resources/commons/types/SimulationContext.js +1 -0
- package/serialization/resources/index.d.ts +1 -0
- package/serialization/resources/index.js +1 -0
- package/serialization/resources/knowledge/types/BaseKnowledgeDocument.d.ts +0 -1
- package/serialization/resources/knowledge/types/BaseKnowledgeDocument.js +0 -1
- package/serialization/resources/knowledge/types/KnowledgeBaseField.d.ts +1 -1
- package/serialization/resources/knowledge/types/KnowledgeBaseField.js +1 -1
- package/serialization/resources/knowledge/types/KnowledgeBaseFilter.d.ts +4 -0
- package/serialization/resources/knowledge/types/KnowledgeBaseFilter.js +4 -0
- package/serialization/resources/knowledge/types/KnowledgeBaseRefreshRequest.d.ts +9 -0
- package/serialization/resources/{agents/types/AgentPatchRequest.js → knowledge/types/KnowledgeBaseRefreshRequest.js} +3 -8
- package/serialization/resources/knowledge/types/KnowledgeBaseResponse.d.ts +4 -0
- package/serialization/resources/knowledge/types/KnowledgeBaseResponse.js +4 -0
- package/serialization/resources/knowledge/types/KnowledgeBaseType.d.ts +1 -1
- package/serialization/resources/knowledge/types/KnowledgeBaseType.js +1 -1
- package/serialization/resources/knowledge/types/KnowledgeDocumentRequest.d.ts +1 -0
- package/serialization/resources/knowledge/types/KnowledgeDocumentRequest.js +1 -0
- package/serialization/resources/knowledge/types/KnowledgeDocumentSearchResponse.d.ts +1 -0
- package/serialization/resources/knowledge/types/KnowledgeDocumentSearchResponse.js +1 -0
- package/serialization/resources/knowledge/types/index.d.ts +1 -0
- package/serialization/resources/knowledge/types/index.js +1 -0
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/api/resources/agents/types/AgentPatchRequest.d.ts +0 -11
- package/dist/api/resources/agents/types/AgentPatchRequest.d.ts +0 -11
- package/dist/serialization/resources/agents/types/AgentPatchRequest.d.ts +0 -14
- package/serialization/resources/agents/types/AgentPatchRequest.d.ts +0 -14
- /package/api/resources/agents/{types → client/requests}/AgentPatchRequest.js +0 -0
- /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.
|
|
63
|
-
"User-Agent": "mavenagi/1.2.
|
|
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("
|
|
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("
|
|
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
|
|
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(
|
|
469
|
-
return __awaiter(this,
|
|
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,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";
|
|
@@ -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
|
-
/**
|
|
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;
|