@caitlyn-ai/sdk 0.0.0-stage → 0.0.1
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/LICENSE +201 -0
- package/NOTICE +4 -0
- package/README.md +164 -2
- package/dist-browser/sdk/index.mjs +1923 -0
- package/dist-browser/sdk/index.mjs.map +7 -0
- package/dist-cjs/sdk/index.cjs +1974 -0
- package/dist-cjs/sdk/index.cjs.map +7 -0
- package/dist-es/sdk/index.mjs +1925 -0
- package/dist-es/sdk/index.mjs.map +7 -0
- package/dist-types/Caitlyn.d.ts +76 -0
- package/dist-types/CaitlynClient.d.ts +160 -0
- package/dist-types/auth/httpAuthExtensionConfiguration.d.ts +29 -0
- package/dist-types/auth/httpAuthSchemeProvider.d.ts +81 -0
- package/dist-types/commandBuilder.d.ts +18 -0
- package/dist-types/commands/CreateDocumentCommand.d.ts +190 -0
- package/dist-types/commands/CreateUploadCommand.d.ts +165 -0
- package/dist-types/commands/GetAgentVersionCommand.d.ts +177 -0
- package/dist-types/commands/ListDocumentsCommand.d.ts +176 -0
- package/dist-types/commands/ResumeConversationStreamCommand.d.ts +146 -0
- package/dist-types/commands/SendMessageCommand.d.ts +183 -0
- package/dist-types/commands/UpdateDraftVersionCommand.d.ts +202 -0
- package/dist-types/commands/index.d.ts +7 -0
- package/dist-types/endpoint/EndpointParameters.d.ts +32 -0
- package/dist-types/endpoint/bdd.d.ts +2 -0
- package/dist-types/endpoint/endpointResolver.d.ts +8 -0
- package/dist-types/extensionConfiguration.d.ts +8 -0
- package/dist-types/index.d.ts +22 -0
- package/dist-types/models/CaitlynServiceException.d.ts +15 -0
- package/dist-types/models/enums.d.ts +148 -0
- package/dist-types/models/errors.d.ts +659 -0
- package/dist-types/models/models_0.d.ts +754 -0
- package/dist-types/pagination/Interfaces.d.ts +8 -0
- package/dist-types/pagination/ListDocumentsPaginator.d.ts +7 -0
- package/dist-types/pagination/index.d.ts +2 -0
- package/dist-types/runtimeConfig.browser.d.ts +50 -0
- package/dist-types/runtimeConfig.d.ts +50 -0
- package/dist-types/runtimeConfig.native.d.ts +49 -0
- package/dist-types/runtimeConfig.shared.d.ts +36 -0
- package/dist-types/runtimeExtensions.d.ts +17 -0
- package/dist-types/schemas/schemas_0.d.ts +51 -0
- package/dist-types/sdk/client.d.ts +47 -0
- package/dist-types/sdk/events.d.ts +163 -0
- package/dist-types/sdk/index.d.ts +8 -0
- package/dist-types/sdk/operations.d.ts +70 -0
- package/package.json +49 -5
|
@@ -0,0 +1,754 @@
|
|
|
1
|
+
import type { DocumentType as __DocumentType, StreamingBlobTypes } from "@smithy/types";
|
|
2
|
+
import type { ClearableDraftField, DocumentStatus, OperationKind, OperationStatus, UploadStatus, VersionSource } from "./enums";
|
|
3
|
+
/**
|
|
4
|
+
* One problem with one request member or query parameter.
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
7
|
+
export interface FieldError {
|
|
8
|
+
/**
|
|
9
|
+
* A JSON Pointer (RFC 6901) into the request body, for example `/context/0/label`. Absent when
|
|
10
|
+
* the problem is with a query parameter.
|
|
11
|
+
* @public
|
|
12
|
+
*/
|
|
13
|
+
pointer?: string | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* The query parameter at fault, for example `filter[staus][eq]`. Absent when the problem is in
|
|
16
|
+
* the body.
|
|
17
|
+
* @public
|
|
18
|
+
*/
|
|
19
|
+
parameter?: string | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* The code for this field's problem, from the same catalogue as the response's own code.
|
|
22
|
+
* @public
|
|
23
|
+
*/
|
|
24
|
+
code: string;
|
|
25
|
+
/**
|
|
26
|
+
* What is wrong with the field, written for the integrator.
|
|
27
|
+
* @public
|
|
28
|
+
*/
|
|
29
|
+
detail?: string | undefined;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Chat attachment settings.
|
|
33
|
+
* @public
|
|
34
|
+
*/
|
|
35
|
+
export interface AttachmentSettings {
|
|
36
|
+
/**
|
|
37
|
+
* Whether people may attach files in chat. Defaults to false.
|
|
38
|
+
* @public
|
|
39
|
+
*/
|
|
40
|
+
enabled?: boolean | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* The most files one message may carry, from 1 to 20.
|
|
43
|
+
* @public
|
|
44
|
+
*/
|
|
45
|
+
maxFiles?: number | undefined;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* The content safety setting on a version.
|
|
49
|
+
* @public
|
|
50
|
+
*/
|
|
51
|
+
export interface ContentSafety {
|
|
52
|
+
/**
|
|
53
|
+
* The guardrail applied, from the guardrails list. Absent means none.
|
|
54
|
+
* @public
|
|
55
|
+
*/
|
|
56
|
+
guardrailId?: string | undefined;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* One knowledge base an agent searches, and how.
|
|
60
|
+
* @public
|
|
61
|
+
*/
|
|
62
|
+
export interface KnowledgeBaseBinding {
|
|
63
|
+
/**
|
|
64
|
+
* The knowledge base searched.
|
|
65
|
+
* @public
|
|
66
|
+
*/
|
|
67
|
+
knowledgeBaseId: string;
|
|
68
|
+
/**
|
|
69
|
+
* How many passages to retrieve per search, from 1 to 100. Absent means the server default.
|
|
70
|
+
* @public
|
|
71
|
+
*/
|
|
72
|
+
numberOfResults?: number | undefined;
|
|
73
|
+
/**
|
|
74
|
+
* The lowest relevance score a passage needs to be used, from 0 to 1. Absent means the server
|
|
75
|
+
* default.
|
|
76
|
+
* @public
|
|
77
|
+
*/
|
|
78
|
+
minimumScore?: number | undefined;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* @public
|
|
82
|
+
*/
|
|
83
|
+
export interface UpdateDraftVersionInput {
|
|
84
|
+
/**
|
|
85
|
+
* The agent whose draft is edited.
|
|
86
|
+
* @public
|
|
87
|
+
*/
|
|
88
|
+
agentId: string;
|
|
89
|
+
/**
|
|
90
|
+
* The draft's current ETag, from a Get or an earlier update. A stale value is refused with
|
|
91
|
+
* 412; a missing one with 428.
|
|
92
|
+
* @public
|
|
93
|
+
*/
|
|
94
|
+
ifMatch: string;
|
|
95
|
+
/**
|
|
96
|
+
* The agent's identity statement, at most 4,000 characters.
|
|
97
|
+
* @public
|
|
98
|
+
*/
|
|
99
|
+
identity?: string | undefined;
|
|
100
|
+
/**
|
|
101
|
+
* The agent's instructions, at most 100,000 characters.
|
|
102
|
+
* @public
|
|
103
|
+
*/
|
|
104
|
+
instructions?: string | undefined;
|
|
105
|
+
/**
|
|
106
|
+
* The model the agent answers with, from the agent models list.
|
|
107
|
+
* @public
|
|
108
|
+
*/
|
|
109
|
+
model?: string | undefined;
|
|
110
|
+
/**
|
|
111
|
+
* The knowledge bases the agent searches. Replaces the whole list.
|
|
112
|
+
* @public
|
|
113
|
+
*/
|
|
114
|
+
knowledgeBases?: KnowledgeBaseBinding[] | undefined;
|
|
115
|
+
/**
|
|
116
|
+
* Whether people may attach files in chat, and how many.
|
|
117
|
+
* @public
|
|
118
|
+
*/
|
|
119
|
+
attachments?: AttachmentSettings | undefined;
|
|
120
|
+
/**
|
|
121
|
+
* The content safety setting applied to uploads and answers.
|
|
122
|
+
* @public
|
|
123
|
+
*/
|
|
124
|
+
contentSafety?: ContentSafety | undefined;
|
|
125
|
+
/**
|
|
126
|
+
* When true, the answer stream tells the caller which documents were withheld from them.
|
|
127
|
+
* Defaults to false.
|
|
128
|
+
* @public
|
|
129
|
+
*/
|
|
130
|
+
deniedDocuments?: boolean | undefined;
|
|
131
|
+
/**
|
|
132
|
+
* Draft members to return to their default.
|
|
133
|
+
* @public
|
|
134
|
+
*/
|
|
135
|
+
clear?: ClearableDraftField[] | undefined;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* An agent version's configuration.
|
|
139
|
+
* @public
|
|
140
|
+
*/
|
|
141
|
+
export interface AgentConfiguration {
|
|
142
|
+
/**
|
|
143
|
+
* The agent's identity statement. Absent when it was never set or was cleared.
|
|
144
|
+
* @public
|
|
145
|
+
*/
|
|
146
|
+
identity?: string | undefined;
|
|
147
|
+
/**
|
|
148
|
+
* The agent's instructions. Empty when none are set.
|
|
149
|
+
* @public
|
|
150
|
+
*/
|
|
151
|
+
instructions: string;
|
|
152
|
+
/**
|
|
153
|
+
* The model the agent answers with.
|
|
154
|
+
* @public
|
|
155
|
+
*/
|
|
156
|
+
model?: string | undefined;
|
|
157
|
+
/**
|
|
158
|
+
* The knowledge bases the agent searches, in no particular order.
|
|
159
|
+
* @public
|
|
160
|
+
*/
|
|
161
|
+
knowledgeBases?: KnowledgeBaseBinding[] | undefined;
|
|
162
|
+
/**
|
|
163
|
+
* Whether people may attach files in chat, and how many.
|
|
164
|
+
* @public
|
|
165
|
+
*/
|
|
166
|
+
attachments?: AttachmentSettings | undefined;
|
|
167
|
+
/**
|
|
168
|
+
* The content safety setting applied to uploads and answers.
|
|
169
|
+
* @public
|
|
170
|
+
*/
|
|
171
|
+
contentSafety?: ContentSafety | undefined;
|
|
172
|
+
/**
|
|
173
|
+
* When true, the answer stream tells the caller which documents were withheld from them.
|
|
174
|
+
* Defaults to false.
|
|
175
|
+
* @public
|
|
176
|
+
*/
|
|
177
|
+
deniedDocuments?: boolean | undefined;
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Headers every v3 response carries. Every operation output uses this mixin.
|
|
181
|
+
* @public
|
|
182
|
+
*/
|
|
183
|
+
export interface UpdateDraftVersionOutput {
|
|
184
|
+
/**
|
|
185
|
+
* The request's identifier. The same value is in every error body; quote it to support.
|
|
186
|
+
* @public
|
|
187
|
+
*/
|
|
188
|
+
requestId?: string | undefined;
|
|
189
|
+
/**
|
|
190
|
+
* The server's model version, for example `5.120.0`. The SDKs keep the latest value they have
|
|
191
|
+
* seen and refuse to call operations or send members newer than it.
|
|
192
|
+
* @public
|
|
193
|
+
*/
|
|
194
|
+
apiVersion?: string | undefined;
|
|
195
|
+
/**
|
|
196
|
+
* The version's current ETag; send it as `If-Match` to change it.
|
|
197
|
+
* @public
|
|
198
|
+
*/
|
|
199
|
+
etag: string;
|
|
200
|
+
/**
|
|
201
|
+
* The agent the version belongs to.
|
|
202
|
+
* @public
|
|
203
|
+
*/
|
|
204
|
+
agentId: string;
|
|
205
|
+
/**
|
|
206
|
+
* `draft`, `production` or the version's name.
|
|
207
|
+
* @public
|
|
208
|
+
*/
|
|
209
|
+
name: string;
|
|
210
|
+
/**
|
|
211
|
+
* How a pinned or published version was made. Absent on the draft.
|
|
212
|
+
* @public
|
|
213
|
+
*/
|
|
214
|
+
source?: VersionSource | undefined;
|
|
215
|
+
/**
|
|
216
|
+
* The version this one was made from, where there is one.
|
|
217
|
+
* @public
|
|
218
|
+
*/
|
|
219
|
+
basedOn?: string | undefined;
|
|
220
|
+
/**
|
|
221
|
+
* True when this version's configuration is the one production currently answers with.
|
|
222
|
+
* Defaults to false.
|
|
223
|
+
* @public
|
|
224
|
+
*/
|
|
225
|
+
matchesProduction?: boolean | undefined;
|
|
226
|
+
/**
|
|
227
|
+
* When the version was made; for the draft, when it was first created.
|
|
228
|
+
* @public
|
|
229
|
+
*/
|
|
230
|
+
createdAt: Date;
|
|
231
|
+
/**
|
|
232
|
+
* The note written when the version was pinned or published.
|
|
233
|
+
* @public
|
|
234
|
+
*/
|
|
235
|
+
note?: string | undefined;
|
|
236
|
+
/**
|
|
237
|
+
* The version's configuration.
|
|
238
|
+
* @public
|
|
239
|
+
*/
|
|
240
|
+
configuration: AgentConfiguration;
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* @public
|
|
244
|
+
*/
|
|
245
|
+
export interface GetAgentVersionInput {
|
|
246
|
+
/**
|
|
247
|
+
* The agent's identifier.
|
|
248
|
+
* @public
|
|
249
|
+
*/
|
|
250
|
+
agentId: string;
|
|
251
|
+
/**
|
|
252
|
+
* `draft`, `production` or a version name.
|
|
253
|
+
* @public
|
|
254
|
+
*/
|
|
255
|
+
version: string;
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* Headers every v3 response carries. Every operation output uses this mixin.
|
|
259
|
+
* @public
|
|
260
|
+
*/
|
|
261
|
+
export interface GetAgentVersionOutput {
|
|
262
|
+
/**
|
|
263
|
+
* The request's identifier. The same value is in every error body; quote it to support.
|
|
264
|
+
* @public
|
|
265
|
+
*/
|
|
266
|
+
requestId?: string | undefined;
|
|
267
|
+
/**
|
|
268
|
+
* The server's model version, for example `5.120.0`. The SDKs keep the latest value they have
|
|
269
|
+
* seen and refuse to call operations or send members newer than it.
|
|
270
|
+
* @public
|
|
271
|
+
*/
|
|
272
|
+
apiVersion?: string | undefined;
|
|
273
|
+
/**
|
|
274
|
+
* The version's current ETag; send it as `If-Match` to change it.
|
|
275
|
+
* @public
|
|
276
|
+
*/
|
|
277
|
+
etag: string;
|
|
278
|
+
/**
|
|
279
|
+
* The agent the version belongs to.
|
|
280
|
+
* @public
|
|
281
|
+
*/
|
|
282
|
+
agentId: string;
|
|
283
|
+
/**
|
|
284
|
+
* `draft`, `production` or the version's name.
|
|
285
|
+
* @public
|
|
286
|
+
*/
|
|
287
|
+
name: string;
|
|
288
|
+
/**
|
|
289
|
+
* How a pinned or published version was made. Absent on the draft.
|
|
290
|
+
* @public
|
|
291
|
+
*/
|
|
292
|
+
source?: VersionSource | undefined;
|
|
293
|
+
/**
|
|
294
|
+
* The version this one was made from, where there is one.
|
|
295
|
+
* @public
|
|
296
|
+
*/
|
|
297
|
+
basedOn?: string | undefined;
|
|
298
|
+
/**
|
|
299
|
+
* True when this version's configuration is the one production currently answers with.
|
|
300
|
+
* Defaults to false.
|
|
301
|
+
* @public
|
|
302
|
+
*/
|
|
303
|
+
matchesProduction?: boolean | undefined;
|
|
304
|
+
/**
|
|
305
|
+
* When the version was made; for the draft, when it was first created.
|
|
306
|
+
* @public
|
|
307
|
+
*/
|
|
308
|
+
createdAt: Date;
|
|
309
|
+
/**
|
|
310
|
+
* The note written when the version was pinned or published.
|
|
311
|
+
* @public
|
|
312
|
+
*/
|
|
313
|
+
note?: string | undefined;
|
|
314
|
+
/**
|
|
315
|
+
* The version's configuration.
|
|
316
|
+
* @public
|
|
317
|
+
*/
|
|
318
|
+
configuration: AgentConfiguration;
|
|
319
|
+
}
|
|
320
|
+
/**
|
|
321
|
+
* @public
|
|
322
|
+
*/
|
|
323
|
+
export interface ResumeConversationStreamInput {
|
|
324
|
+
/**
|
|
325
|
+
* The conversation whose answer to re-attach to.
|
|
326
|
+
* @public
|
|
327
|
+
*/
|
|
328
|
+
conversationId: string;
|
|
329
|
+
/**
|
|
330
|
+
* The `id` of the last event received. Absent means from the start of the answer.
|
|
331
|
+
* @public
|
|
332
|
+
*/
|
|
333
|
+
lastEventId?: string | undefined;
|
|
334
|
+
}
|
|
335
|
+
/**
|
|
336
|
+
* Headers every v3 response carries. Every operation output uses this mixin.
|
|
337
|
+
* @public
|
|
338
|
+
*/
|
|
339
|
+
export interface ResumeConversationStreamOutput {
|
|
340
|
+
/**
|
|
341
|
+
* The request's identifier. The same value is in every error body; quote it to support.
|
|
342
|
+
* @public
|
|
343
|
+
*/
|
|
344
|
+
requestId?: string | undefined;
|
|
345
|
+
/**
|
|
346
|
+
* The server's model version, for example `5.120.0`. The SDKs keep the latest value they have
|
|
347
|
+
* seen and refuse to call operations or send members newer than it.
|
|
348
|
+
* @public
|
|
349
|
+
*/
|
|
350
|
+
apiVersion?: string | undefined;
|
|
351
|
+
/**
|
|
352
|
+
* The rest of the answer, as a stream of `ConversationEvent` events.
|
|
353
|
+
* @public
|
|
354
|
+
*/
|
|
355
|
+
events: StreamingBlobTypes;
|
|
356
|
+
}
|
|
357
|
+
/**
|
|
358
|
+
* One item of structured context, for example the page or record the person is looking at.
|
|
359
|
+
* @public
|
|
360
|
+
*/
|
|
361
|
+
export interface ContextItem {
|
|
362
|
+
/**
|
|
363
|
+
* What kind of thing the item describes, for example `page`.
|
|
364
|
+
* @public
|
|
365
|
+
*/
|
|
366
|
+
type: string;
|
|
367
|
+
/**
|
|
368
|
+
* A short label the agent can refer to.
|
|
369
|
+
* @public
|
|
370
|
+
*/
|
|
371
|
+
label: string;
|
|
372
|
+
/**
|
|
373
|
+
* Where the item lives, when it has an address.
|
|
374
|
+
* @public
|
|
375
|
+
*/
|
|
376
|
+
uri?: string | undefined;
|
|
377
|
+
/**
|
|
378
|
+
* The item's data, as JSON. Counts towards the 16 KB limit.
|
|
379
|
+
* @public
|
|
380
|
+
*/
|
|
381
|
+
data?: __DocumentType | undefined;
|
|
382
|
+
}
|
|
383
|
+
/**
|
|
384
|
+
* @public
|
|
385
|
+
*/
|
|
386
|
+
export interface SendMessageInput {
|
|
387
|
+
/**
|
|
388
|
+
* The conversation to send to.
|
|
389
|
+
* @public
|
|
390
|
+
*/
|
|
391
|
+
conversationId: string;
|
|
392
|
+
/**
|
|
393
|
+
* The message, at most 32,000 characters.
|
|
394
|
+
* @public
|
|
395
|
+
*/
|
|
396
|
+
message: string;
|
|
397
|
+
/**
|
|
398
|
+
* Structured context for this message only, at most 20 items and 16 KB in total. Not
|
|
399
|
+
* stored on the conversation.
|
|
400
|
+
* @public
|
|
401
|
+
*/
|
|
402
|
+
context?: ContextItem[] | undefined;
|
|
403
|
+
}
|
|
404
|
+
/**
|
|
405
|
+
* Headers every v3 response carries. Every operation output uses this mixin.
|
|
406
|
+
* @public
|
|
407
|
+
*/
|
|
408
|
+
export interface SendMessageOutput {
|
|
409
|
+
/**
|
|
410
|
+
* The request's identifier. The same value is in every error body; quote it to support.
|
|
411
|
+
* @public
|
|
412
|
+
*/
|
|
413
|
+
requestId?: string | undefined;
|
|
414
|
+
/**
|
|
415
|
+
* The server's model version, for example `5.120.0`. The SDKs keep the latest value they have
|
|
416
|
+
* seen and refuse to call operations or send members newer than it.
|
|
417
|
+
* @public
|
|
418
|
+
*/
|
|
419
|
+
apiVersion?: string | undefined;
|
|
420
|
+
/**
|
|
421
|
+
* The answer, as a stream of `ConversationEvent` events.
|
|
422
|
+
* @public
|
|
423
|
+
*/
|
|
424
|
+
events: StreamingBlobTypes;
|
|
425
|
+
}
|
|
426
|
+
/**
|
|
427
|
+
* @public
|
|
428
|
+
*/
|
|
429
|
+
export interface CreateDocumentInput {
|
|
430
|
+
/**
|
|
431
|
+
* The knowledge base to add the document to.
|
|
432
|
+
* @public
|
|
433
|
+
*/
|
|
434
|
+
knowledgeBaseId: string;
|
|
435
|
+
/**
|
|
436
|
+
* Makes the request safe to retry. The SDKs generate one per call when the caller does not
|
|
437
|
+
* supply one.
|
|
438
|
+
* @public
|
|
439
|
+
*/
|
|
440
|
+
idempotencyKey?: string | undefined;
|
|
441
|
+
/**
|
|
442
|
+
* The upload holding the document's bytes. Each upload can be used once.
|
|
443
|
+
* @public
|
|
444
|
+
*/
|
|
445
|
+
uploadId: string;
|
|
446
|
+
/**
|
|
447
|
+
* The folder to put the document in.
|
|
448
|
+
* @public
|
|
449
|
+
*/
|
|
450
|
+
folder: string;
|
|
451
|
+
/**
|
|
452
|
+
* The document's name. Absent means the uploaded file's name.
|
|
453
|
+
* @public
|
|
454
|
+
*/
|
|
455
|
+
name?: string | undefined;
|
|
456
|
+
}
|
|
457
|
+
/**
|
|
458
|
+
* An enrichment that did not complete. It never fails the document.
|
|
459
|
+
* @public
|
|
460
|
+
*/
|
|
461
|
+
export interface PartialFailure {
|
|
462
|
+
/**
|
|
463
|
+
* The part of the document the enrichment was for, where there is one.
|
|
464
|
+
* @public
|
|
465
|
+
*/
|
|
466
|
+
targetId?: string | undefined;
|
|
467
|
+
/**
|
|
468
|
+
* What went wrong, as a stable code.
|
|
469
|
+
* @public
|
|
470
|
+
*/
|
|
471
|
+
code: string;
|
|
472
|
+
/**
|
|
473
|
+
* What went wrong, written for the integrator.
|
|
474
|
+
* @public
|
|
475
|
+
*/
|
|
476
|
+
detail?: string | undefined;
|
|
477
|
+
}
|
|
478
|
+
/**
|
|
479
|
+
* One document in a knowledge base, stable across new uploads of new bytes.
|
|
480
|
+
* @public
|
|
481
|
+
*/
|
|
482
|
+
export interface Document {
|
|
483
|
+
/**
|
|
484
|
+
* The document's identifier.
|
|
485
|
+
* @public
|
|
486
|
+
*/
|
|
487
|
+
id: string;
|
|
488
|
+
/**
|
|
489
|
+
* The knowledge base the document is in.
|
|
490
|
+
* @public
|
|
491
|
+
*/
|
|
492
|
+
knowledgeBaseId: string;
|
|
493
|
+
/**
|
|
494
|
+
* The document's name, as people see it.
|
|
495
|
+
* @public
|
|
496
|
+
*/
|
|
497
|
+
name: string;
|
|
498
|
+
/**
|
|
499
|
+
* The folder the document is in.
|
|
500
|
+
* @public
|
|
501
|
+
*/
|
|
502
|
+
folder: string;
|
|
503
|
+
/**
|
|
504
|
+
* Where the document is in its lifecycle.
|
|
505
|
+
* @public
|
|
506
|
+
*/
|
|
507
|
+
status: DocumentStatus;
|
|
508
|
+
/**
|
|
509
|
+
* While `processing`, what the server is doing, for display only.
|
|
510
|
+
* @public
|
|
511
|
+
*/
|
|
512
|
+
stage?: string | undefined;
|
|
513
|
+
/**
|
|
514
|
+
* The media type of the current bytes.
|
|
515
|
+
* @public
|
|
516
|
+
*/
|
|
517
|
+
contentType?: string | undefined;
|
|
518
|
+
/**
|
|
519
|
+
* The size of the current bytes, in bytes.
|
|
520
|
+
* @public
|
|
521
|
+
*/
|
|
522
|
+
byteSize?: number | undefined;
|
|
523
|
+
/**
|
|
524
|
+
* The base64-encoded SHA-256 of the current bytes.
|
|
525
|
+
* @public
|
|
526
|
+
*/
|
|
527
|
+
sha256?: string | undefined;
|
|
528
|
+
/**
|
|
529
|
+
* When the document was created.
|
|
530
|
+
* @public
|
|
531
|
+
*/
|
|
532
|
+
createdAt: Date;
|
|
533
|
+
/**
|
|
534
|
+
* When the document or its bytes last changed.
|
|
535
|
+
* @public
|
|
536
|
+
*/
|
|
537
|
+
updatedAt: Date;
|
|
538
|
+
/**
|
|
539
|
+
* Enrichments that did not complete (a picture description, metadata extraction, a table).
|
|
540
|
+
* They never fail the document. At most the first 100.
|
|
541
|
+
* @public
|
|
542
|
+
*/
|
|
543
|
+
partialFailures?: PartialFailure[] | undefined;
|
|
544
|
+
}
|
|
545
|
+
/**
|
|
546
|
+
* Background work that continues after the request that started it. Read it, wait on it or watch
|
|
547
|
+
* it; never start the work again to find out how it went.
|
|
548
|
+
* @public
|
|
549
|
+
*/
|
|
550
|
+
export interface Operation {
|
|
551
|
+
/**
|
|
552
|
+
* The Operation's identifier.
|
|
553
|
+
* @public
|
|
554
|
+
*/
|
|
555
|
+
id: string;
|
|
556
|
+
/**
|
|
557
|
+
* What kind of work it is.
|
|
558
|
+
* @public
|
|
559
|
+
*/
|
|
560
|
+
kind: OperationKind;
|
|
561
|
+
/**
|
|
562
|
+
* Where the work is.
|
|
563
|
+
* @public
|
|
564
|
+
*/
|
|
565
|
+
status: OperationStatus;
|
|
566
|
+
/**
|
|
567
|
+
* When the work was requested.
|
|
568
|
+
* @public
|
|
569
|
+
*/
|
|
570
|
+
createdAt: Date;
|
|
571
|
+
}
|
|
572
|
+
/**
|
|
573
|
+
* Headers every v3 response carries. Every operation output uses this mixin.
|
|
574
|
+
* @public
|
|
575
|
+
*/
|
|
576
|
+
export interface CreateDocumentOutput {
|
|
577
|
+
/**
|
|
578
|
+
* The request's identifier. The same value is in every error body; quote it to support.
|
|
579
|
+
* @public
|
|
580
|
+
*/
|
|
581
|
+
requestId?: string | undefined;
|
|
582
|
+
/**
|
|
583
|
+
* The server's model version, for example `5.120.0`. The SDKs keep the latest value they have
|
|
584
|
+
* seen and refuse to call operations or send members newer than it.
|
|
585
|
+
* @public
|
|
586
|
+
*/
|
|
587
|
+
apiVersion?: string | undefined;
|
|
588
|
+
/**
|
|
589
|
+
* The Operation that tracks ingestion, as `/api/v3/operations/\{operationId\}`.
|
|
590
|
+
* @public
|
|
591
|
+
*/
|
|
592
|
+
location?: string | undefined;
|
|
593
|
+
/**
|
|
594
|
+
* The document in its initial state.
|
|
595
|
+
* @public
|
|
596
|
+
*/
|
|
597
|
+
document: Document;
|
|
598
|
+
/**
|
|
599
|
+
* The Operation that tracks ingestion.
|
|
600
|
+
* @public
|
|
601
|
+
*/
|
|
602
|
+
operation: Operation;
|
|
603
|
+
}
|
|
604
|
+
/**
|
|
605
|
+
* @public
|
|
606
|
+
*/
|
|
607
|
+
export interface ListDocumentsInput {
|
|
608
|
+
/**
|
|
609
|
+
* The knowledge base to list.
|
|
610
|
+
* @public
|
|
611
|
+
*/
|
|
612
|
+
knowledgeBaseId: string;
|
|
613
|
+
/**
|
|
614
|
+
* The most documents to return, from 1 to 100. Defaults to 20.
|
|
615
|
+
* @public
|
|
616
|
+
*/
|
|
617
|
+
limit?: number | undefined;
|
|
618
|
+
/**
|
|
619
|
+
* The `nextCursor` from the previous page. Absent for the first page.
|
|
620
|
+
* @public
|
|
621
|
+
*/
|
|
622
|
+
cursor?: string | undefined;
|
|
623
|
+
/**
|
|
624
|
+
* The order: `name`, `updatedAt` or `byteSize`, comma-separated, with a leading `-` for
|
|
625
|
+
* descending (for example `-updatedAt`). Any other field is refused with 400 `UNKNOWN_SORT`.
|
|
626
|
+
* @public
|
|
627
|
+
*/
|
|
628
|
+
sort?: string | undefined;
|
|
629
|
+
/**
|
|
630
|
+
* Only documents directly in this folder.
|
|
631
|
+
* @public
|
|
632
|
+
*/
|
|
633
|
+
folder?: string | undefined;
|
|
634
|
+
/**
|
|
635
|
+
* Only documents with this status.
|
|
636
|
+
* @public
|
|
637
|
+
*/
|
|
638
|
+
status?: DocumentStatus | undefined;
|
|
639
|
+
/**
|
|
640
|
+
* Only documents whose name starts with this text.
|
|
641
|
+
* @public
|
|
642
|
+
*/
|
|
643
|
+
namePrefix?: string | undefined;
|
|
644
|
+
}
|
|
645
|
+
/**
|
|
646
|
+
* Headers every v3 response carries. Every operation output uses this mixin.
|
|
647
|
+
* @public
|
|
648
|
+
*/
|
|
649
|
+
export interface ListDocumentsOutput {
|
|
650
|
+
/**
|
|
651
|
+
* The request's identifier. The same value is in every error body; quote it to support.
|
|
652
|
+
* @public
|
|
653
|
+
*/
|
|
654
|
+
requestId?: string | undefined;
|
|
655
|
+
/**
|
|
656
|
+
* The server's model version, for example `5.120.0`. The SDKs keep the latest value they have
|
|
657
|
+
* seen and refuse to call operations or send members newer than it.
|
|
658
|
+
* @public
|
|
659
|
+
*/
|
|
660
|
+
apiVersion?: string | undefined;
|
|
661
|
+
/**
|
|
662
|
+
* This page of documents.
|
|
663
|
+
* @public
|
|
664
|
+
*/
|
|
665
|
+
items: Document[];
|
|
666
|
+
/**
|
|
667
|
+
* The cursor for the next page. Absent on the last page.
|
|
668
|
+
* @public
|
|
669
|
+
*/
|
|
670
|
+
nextCursor?: string | undefined;
|
|
671
|
+
}
|
|
672
|
+
/**
|
|
673
|
+
* @public
|
|
674
|
+
*/
|
|
675
|
+
export interface CreateUploadInput {
|
|
676
|
+
/**
|
|
677
|
+
* Makes the request safe to retry. The SDKs generate one per call when the caller does not
|
|
678
|
+
* supply one.
|
|
679
|
+
* @public
|
|
680
|
+
*/
|
|
681
|
+
idempotencyKey?: string | undefined;
|
|
682
|
+
/**
|
|
683
|
+
* The file's name on the caller's machine.
|
|
684
|
+
* @public
|
|
685
|
+
*/
|
|
686
|
+
fileName: string;
|
|
687
|
+
/**
|
|
688
|
+
* The file's media type.
|
|
689
|
+
* @public
|
|
690
|
+
*/
|
|
691
|
+
contentType: string;
|
|
692
|
+
/**
|
|
693
|
+
* The file's size in bytes.
|
|
694
|
+
* @public
|
|
695
|
+
*/
|
|
696
|
+
byteSize: number;
|
|
697
|
+
/**
|
|
698
|
+
* The base64-encoded SHA-256 of the file's bytes. The upload URL accepts only these bytes.
|
|
699
|
+
* @public
|
|
700
|
+
*/
|
|
701
|
+
sha256: string;
|
|
702
|
+
}
|
|
703
|
+
/**
|
|
704
|
+
* Headers every v3 response carries. Every operation output uses this mixin.
|
|
705
|
+
* @public
|
|
706
|
+
*/
|
|
707
|
+
export interface CreateUploadOutput {
|
|
708
|
+
/**
|
|
709
|
+
* The request's identifier. The same value is in every error body; quote it to support.
|
|
710
|
+
* @public
|
|
711
|
+
*/
|
|
712
|
+
requestId?: string | undefined;
|
|
713
|
+
/**
|
|
714
|
+
* The server's model version, for example `5.120.0`. The SDKs keep the latest value they have
|
|
715
|
+
* seen and refuse to call operations or send members newer than it.
|
|
716
|
+
* @public
|
|
717
|
+
*/
|
|
718
|
+
apiVersion?: string | undefined;
|
|
719
|
+
/**
|
|
720
|
+
* The upload, as `/api/v3/uploads/\{uploadId\}`.
|
|
721
|
+
* @public
|
|
722
|
+
*/
|
|
723
|
+
location?: string | undefined;
|
|
724
|
+
/**
|
|
725
|
+
* The upload's identifier, passed to the operation that uses it.
|
|
726
|
+
* @public
|
|
727
|
+
*/
|
|
728
|
+
id: string;
|
|
729
|
+
/**
|
|
730
|
+
* Where to send the bytes. Expires at `expiresAt`.
|
|
731
|
+
* @public
|
|
732
|
+
*/
|
|
733
|
+
uploadUrl: string;
|
|
734
|
+
/**
|
|
735
|
+
* The HTTP method to send the bytes with, usually `PUT`.
|
|
736
|
+
* @public
|
|
737
|
+
*/
|
|
738
|
+
uploadMethod: string;
|
|
739
|
+
/**
|
|
740
|
+
* Headers that must be sent with the bytes, exactly as given.
|
|
741
|
+
* @public
|
|
742
|
+
*/
|
|
743
|
+
requiredHeaders: Record<string, string>;
|
|
744
|
+
/**
|
|
745
|
+
* When the upload URL stops working.
|
|
746
|
+
* @public
|
|
747
|
+
*/
|
|
748
|
+
expiresAt: Date;
|
|
749
|
+
/**
|
|
750
|
+
* Where the upload is in its lifecycle.
|
|
751
|
+
* @public
|
|
752
|
+
*/
|
|
753
|
+
status: UploadStatus;
|
|
754
|
+
}
|