@knowledge-stack/ksapi 1.61.0 → 1.61.2
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/.openapi-generator/FILES +2 -2
- package/README.md +4 -3
- package/dist/apis/ChunksApi.d.ts +54 -1
- package/dist/apis/ChunksApi.js +53 -0
- package/dist/apis/DocumentsApi.d.ts +1 -7
- package/dist/apis/DocumentsApi.js +0 -6
- package/dist/esm/apis/ChunksApi.d.ts +54 -1
- package/dist/esm/apis/ChunksApi.js +54 -1
- package/dist/esm/apis/DocumentsApi.d.ts +1 -7
- package/dist/esm/apis/DocumentsApi.js +0 -6
- package/dist/esm/models/ChunkMetadataInput.d.ts +0 -7
- package/dist/esm/models/ChunkMetadataInput.js +0 -3
- package/dist/esm/models/ChunkMetadataOutput.d.ts +0 -7
- package/dist/esm/models/ChunkMetadataOutput.js +0 -3
- package/dist/esm/models/ChunkNeighborsResponse.d.ts +57 -0
- package/dist/esm/models/ChunkNeighborsResponse.js +49 -0
- package/dist/esm/models/IngestionMode.d.ts +3 -2
- package/dist/esm/models/IngestionMode.js +3 -2
- package/dist/esm/models/PipelineState.d.ts +1 -8
- package/dist/esm/models/PipelineState.js +0 -3
- package/dist/esm/models/index.d.ts +1 -1
- package/dist/esm/models/index.js +1 -1
- package/dist/models/ChunkMetadataInput.d.ts +0 -7
- package/dist/models/ChunkMetadataInput.js +0 -3
- package/dist/models/ChunkMetadataOutput.d.ts +0 -7
- package/dist/models/ChunkMetadataOutput.js +0 -3
- package/dist/models/ChunkNeighborsResponse.d.ts +57 -0
- package/dist/models/ChunkNeighborsResponse.js +57 -0
- package/dist/models/IngestionMode.d.ts +3 -2
- package/dist/models/IngestionMode.js +3 -2
- package/dist/models/PipelineState.d.ts +1 -8
- package/dist/models/PipelineState.js +0 -3
- package/dist/models/index.d.ts +1 -1
- package/dist/models/index.js +1 -1
- package/docs/ChunkMetadataInput.md +0 -2
- package/docs/ChunkMetadataOutput.md +0 -2
- package/docs/ChunkNeighborsResponse.md +37 -0
- package/docs/ChunksApi.md +84 -0
- package/docs/DocumentsApi.md +4 -10
- package/docs/IngestionMode.md +1 -1
- package/docs/PipelineState.md +0 -2
- package/package.json +1 -1
- package/src/apis/ChunksApi.ts +109 -0
- package/src/apis/DocumentsApi.ts +0 -17
- package/src/models/ChunkMetadataInput.ts +0 -15
- package/src/models/ChunkMetadataOutput.ts +0 -15
- package/src/models/ChunkNeighborsResponse.ts +103 -0
- package/src/models/IngestionMode.ts +3 -2
- package/src/models/PipelineState.ts +1 -16
- package/src/models/index.ts +1 -1
- package/dist/esm/models/ConversionEngine.d.ts +0 -25
- package/dist/esm/models/ConversionEngine.js +0 -43
- package/dist/models/ConversionEngine.d.ts +0 -25
- package/dist/models/ConversionEngine.js +0 -51
- package/docs/ConversionEngine.md +0 -33
- package/src/models/ConversionEngine.ts +0 -53
package/docs/ChunksApi.md
CHANGED
|
@@ -7,6 +7,7 @@ All URIs are relative to *http://localhost:8000*
|
|
|
7
7
|
| [**createChunk**](ChunksApi.md#createchunkoperation) | **POST** /v1/chunks | Create Chunk Handler |
|
|
8
8
|
| [**deleteChunk**](ChunksApi.md#deletechunk) | **DELETE** /v1/chunks/{chunk_id} | Delete Chunk Handler |
|
|
9
9
|
| [**getChunk**](ChunksApi.md#getchunk) | **GET** /v1/chunks/{chunk_id} | Get Chunk Handler |
|
|
10
|
+
| [**getChunkNeighbors**](ChunksApi.md#getchunkneighbors) | **GET** /v1/chunks/{chunk_id}/neighbors | Get Chunk Neighbors Handler |
|
|
10
11
|
| [**getChunksBulk**](ChunksApi.md#getchunksbulk) | **GET** /v1/chunks/bulk | Get Chunks Bulk Handler |
|
|
11
12
|
| [**getVersionChunkIds**](ChunksApi.md#getversionchunkids) | **GET** /v1/chunks/version-chunk-ids | Get Version Chunk Ids Handler |
|
|
12
13
|
| [**searchChunks**](ChunksApi.md#searchchunks) | **POST** /v1/chunks/search | Search Chunks Handler |
|
|
@@ -240,6 +241,89 @@ No authorization required
|
|
|
240
241
|
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
241
242
|
|
|
242
243
|
|
|
244
|
+
## getChunkNeighbors
|
|
245
|
+
|
|
246
|
+
> ChunkNeighborsResponse getChunkNeighbors(chunkId, prev, next, chunksOnly, authorization, ksUat)
|
|
247
|
+
|
|
248
|
+
Get Chunk Neighbors Handler
|
|
249
|
+
|
|
250
|
+
Get neighboring siblings by traversing the sibling linked list. Walks the sibling chain backward (prev) and forward (next) from the anchor chunk. Returns sections and chunks in sibling order within the same parent. When ``chunks_only=true``, the traversal stops at the first non-CHUNK sibling in each direction, returning only chunk neighbors.
|
|
251
|
+
|
|
252
|
+
### Example
|
|
253
|
+
|
|
254
|
+
```ts
|
|
255
|
+
import {
|
|
256
|
+
Configuration,
|
|
257
|
+
ChunksApi,
|
|
258
|
+
} from '@knowledge-stack/ksapi';
|
|
259
|
+
import type { GetChunkNeighborsRequest } from '@knowledge-stack/ksapi';
|
|
260
|
+
|
|
261
|
+
async function example() {
|
|
262
|
+
console.log("🚀 Testing @knowledge-stack/ksapi SDK...");
|
|
263
|
+
const api = new ChunksApi();
|
|
264
|
+
|
|
265
|
+
const body = {
|
|
266
|
+
// string
|
|
267
|
+
chunkId: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
|
|
268
|
+
// number | Number of preceding siblings to include (optional)
|
|
269
|
+
prev: 56,
|
|
270
|
+
// number | Number of succeeding siblings to include (optional)
|
|
271
|
+
next: 56,
|
|
272
|
+
// boolean | When true, stop traversal at non-CHUNK siblings (default: false) (optional)
|
|
273
|
+
chunksOnly: true,
|
|
274
|
+
// string (optional)
|
|
275
|
+
authorization: authorization_example,
|
|
276
|
+
// string (optional)
|
|
277
|
+
ksUat: ksUat_example,
|
|
278
|
+
} satisfies GetChunkNeighborsRequest;
|
|
279
|
+
|
|
280
|
+
try {
|
|
281
|
+
const data = await api.getChunkNeighbors(body);
|
|
282
|
+
console.log(data);
|
|
283
|
+
} catch (error) {
|
|
284
|
+
console.error(error);
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
// Run the test
|
|
289
|
+
example().catch(console.error);
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
### Parameters
|
|
293
|
+
|
|
294
|
+
|
|
295
|
+
| Name | Type | Description | Notes |
|
|
296
|
+
|------------- | ------------- | ------------- | -------------|
|
|
297
|
+
| **chunkId** | `string` | | [Defaults to `undefined`] |
|
|
298
|
+
| **prev** | `number` | Number of preceding siblings to include | [Optional] [Defaults to `1`] |
|
|
299
|
+
| **next** | `number` | Number of succeeding siblings to include | [Optional] [Defaults to `1`] |
|
|
300
|
+
| **chunksOnly** | `boolean` | When true, stop traversal at non-CHUNK siblings (default: false) | [Optional] [Defaults to `false`] |
|
|
301
|
+
| **authorization** | `string` | | [Optional] [Defaults to `undefined`] |
|
|
302
|
+
| **ksUat** | `string` | | [Optional] [Defaults to `undefined`] |
|
|
303
|
+
|
|
304
|
+
### Return type
|
|
305
|
+
|
|
306
|
+
[**ChunkNeighborsResponse**](ChunkNeighborsResponse.md)
|
|
307
|
+
|
|
308
|
+
### Authorization
|
|
309
|
+
|
|
310
|
+
No authorization required
|
|
311
|
+
|
|
312
|
+
### HTTP request headers
|
|
313
|
+
|
|
314
|
+
- **Content-Type**: Not defined
|
|
315
|
+
- **Accept**: `application/json`
|
|
316
|
+
|
|
317
|
+
|
|
318
|
+
### HTTP response details
|
|
319
|
+
| Status code | Description | Response headers |
|
|
320
|
+
|-------------|-------------|------------------|
|
|
321
|
+
| **200** | Successful Response | - |
|
|
322
|
+
| **422** | Validation Error | - |
|
|
323
|
+
|
|
324
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
325
|
+
|
|
326
|
+
|
|
243
327
|
## getChunksBulk
|
|
244
328
|
|
|
245
329
|
> Array<ChunkBulkResponse> getChunksBulk(chunkIds, authorization, ksUat)
|
package/docs/DocumentsApi.md
CHANGED
|
@@ -241,7 +241,7 @@ No authorization required
|
|
|
241
241
|
|
|
242
242
|
## ingestDocument
|
|
243
243
|
|
|
244
|
-
> IngestDocumentResponse ingestDocument(file, pathPartId, authorization, ksUat, name, ingestionMode, chunkType, secondaryTaxonomy, pageDpi
|
|
244
|
+
> IngestDocumentResponse ingestDocument(file, pathPartId, authorization, ksUat, name, ingestionMode, chunkType, secondaryTaxonomy, pageDpi)
|
|
245
245
|
|
|
246
246
|
Ingest Document Handler
|
|
247
247
|
|
|
@@ -279,8 +279,6 @@ async function example() {
|
|
|
279
279
|
secondaryTaxonomy: ...,
|
|
280
280
|
// number | DPI for PDF page screenshots (default 72, min 36, max 216). (optional)
|
|
281
281
|
pageDpi: 56,
|
|
282
|
-
// ConversionEngine (optional)
|
|
283
|
-
conversionEngine: ...,
|
|
284
282
|
} satisfies IngestDocumentRequest;
|
|
285
283
|
|
|
286
284
|
try {
|
|
@@ -305,11 +303,10 @@ example().catch(console.error);
|
|
|
305
303
|
| **authorization** | `string` | | [Optional] [Defaults to `undefined`] |
|
|
306
304
|
| **ksUat** | `string` | | [Optional] [Defaults to `undefined`] |
|
|
307
305
|
| **name** | `string` | Document name (defaults to filename) | [Optional] [Defaults to `undefined`] |
|
|
308
|
-
| **ingestionMode** | `IngestionMode` | | [Optional] [Defaults to `undefined`] [Enum:
|
|
306
|
+
| **ingestionMode** | `IngestionMode` | | [Optional] [Defaults to `undefined`] [Enum: high_accuracy, standard, single_chunk] |
|
|
309
307
|
| **chunkType** | `ChunkType` | | [Optional] [Defaults to `undefined`] [Enum: TEXT, TABLE, IMAGE, HTML, UNKNOWN] |
|
|
310
308
|
| **secondaryTaxonomy** | `ImageTaxonomy` | | [Optional] [Defaults to `undefined`] [Enum: picture, flowchart] |
|
|
311
309
|
| **pageDpi** | `number` | DPI for PDF page screenshots (default 72, min 36, max 216). | [Optional] [Defaults to `72`] |
|
|
312
|
-
| **conversionEngine** | `ConversionEngine` | | [Optional] [Defaults to `undefined`] [Enum: standard, high_accuracy] |
|
|
313
310
|
|
|
314
311
|
### Return type
|
|
315
312
|
|
|
@@ -336,7 +333,7 @@ No authorization required
|
|
|
336
333
|
|
|
337
334
|
## ingestDocumentVersion
|
|
338
335
|
|
|
339
|
-
> IngestDocumentResponse ingestDocumentVersion(documentId, file, authorization, ksUat, ingestionMode, chunkType, secondaryTaxonomy, pageDpi
|
|
336
|
+
> IngestDocumentResponse ingestDocumentVersion(documentId, file, authorization, ksUat, ingestionMode, chunkType, secondaryTaxonomy, pageDpi)
|
|
340
337
|
|
|
341
338
|
Ingest Document Version Handler
|
|
342
339
|
|
|
@@ -372,8 +369,6 @@ async function example() {
|
|
|
372
369
|
secondaryTaxonomy: ...,
|
|
373
370
|
// number | DPI for PDF page screenshots (default 72, min 36, max 216). (optional)
|
|
374
371
|
pageDpi: 56,
|
|
375
|
-
// ConversionEngine (optional)
|
|
376
|
-
conversionEngine: ...,
|
|
377
372
|
} satisfies IngestDocumentVersionRequest;
|
|
378
373
|
|
|
379
374
|
try {
|
|
@@ -397,11 +392,10 @@ example().catch(console.error);
|
|
|
397
392
|
| **file** | `Blob` | | [Defaults to `undefined`] |
|
|
398
393
|
| **authorization** | `string` | | [Optional] [Defaults to `undefined`] |
|
|
399
394
|
| **ksUat** | `string` | | [Optional] [Defaults to `undefined`] |
|
|
400
|
-
| **ingestionMode** | `IngestionMode` | | [Optional] [Defaults to `undefined`] [Enum:
|
|
395
|
+
| **ingestionMode** | `IngestionMode` | | [Optional] [Defaults to `undefined`] [Enum: high_accuracy, standard, single_chunk] |
|
|
401
396
|
| **chunkType** | `ChunkType` | | [Optional] [Defaults to `undefined`] [Enum: TEXT, TABLE, IMAGE, HTML, UNKNOWN] |
|
|
402
397
|
| **secondaryTaxonomy** | `ImageTaxonomy` | | [Optional] [Defaults to `undefined`] [Enum: picture, flowchart] |
|
|
403
398
|
| **pageDpi** | `number` | DPI for PDF page screenshots (default 72, min 36, max 216). | [Optional] [Defaults to `72`] |
|
|
404
|
-
| **conversionEngine** | `ConversionEngine` | | [Optional] [Defaults to `undefined`] [Enum: standard, high_accuracy] |
|
|
405
399
|
|
|
406
400
|
### Return type
|
|
407
401
|
|
package/docs/IngestionMode.md
CHANGED
package/docs/PipelineState.md
CHANGED
|
@@ -17,7 +17,6 @@ Name | Type
|
|
|
17
17
|
`pageDpi` | number
|
|
18
18
|
`ingestionMode` | [IngestionMode](IngestionMode.md)
|
|
19
19
|
`chunkType` | [ChunkType](ChunkType.md)
|
|
20
|
-
`conversionEngine` | [ConversionEngine](ConversionEngine.md)
|
|
21
20
|
|
|
22
21
|
## Example
|
|
23
22
|
|
|
@@ -36,7 +35,6 @@ const example = {
|
|
|
36
35
|
"pageDpi": null,
|
|
37
36
|
"ingestionMode": null,
|
|
38
37
|
"chunkType": null,
|
|
39
|
-
"conversionEngine": null,
|
|
40
38
|
} satisfies PipelineState
|
|
41
39
|
|
|
42
40
|
console.log(example)
|
package/package.json
CHANGED
package/src/apis/ChunksApi.ts
CHANGED
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
import * as runtime from '../runtime';
|
|
17
17
|
import type {
|
|
18
18
|
ChunkBulkResponse,
|
|
19
|
+
ChunkNeighborsResponse,
|
|
19
20
|
ChunkResponse,
|
|
20
21
|
ChunkSearchRequest,
|
|
21
22
|
CreateChunkRequest,
|
|
@@ -28,6 +29,8 @@ import type {
|
|
|
28
29
|
import {
|
|
29
30
|
ChunkBulkResponseFromJSON,
|
|
30
31
|
ChunkBulkResponseToJSON,
|
|
32
|
+
ChunkNeighborsResponseFromJSON,
|
|
33
|
+
ChunkNeighborsResponseToJSON,
|
|
31
34
|
ChunkResponseFromJSON,
|
|
32
35
|
ChunkResponseToJSON,
|
|
33
36
|
ChunkSearchRequestFromJSON,
|
|
@@ -65,6 +68,15 @@ export interface GetChunkRequest {
|
|
|
65
68
|
ksUat?: string | null;
|
|
66
69
|
}
|
|
67
70
|
|
|
71
|
+
export interface GetChunkNeighborsRequest {
|
|
72
|
+
chunkId: string;
|
|
73
|
+
prev?: number;
|
|
74
|
+
next?: number;
|
|
75
|
+
chunksOnly?: boolean;
|
|
76
|
+
authorization?: string | null;
|
|
77
|
+
ksUat?: string | null;
|
|
78
|
+
}
|
|
79
|
+
|
|
68
80
|
export interface GetChunksBulkRequest {
|
|
69
81
|
chunkIds?: Array<string> | null;
|
|
70
82
|
authorization?: string | null;
|
|
@@ -190,6 +202,40 @@ export interface ChunksApiInterface {
|
|
|
190
202
|
*/
|
|
191
203
|
getChunk(requestParameters: GetChunkRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ChunkResponse>;
|
|
192
204
|
|
|
205
|
+
/**
|
|
206
|
+
* Creates request options for getChunkNeighbors without sending the request
|
|
207
|
+
* @param {string} chunkId
|
|
208
|
+
* @param {number} [prev] Number of preceding siblings to include
|
|
209
|
+
* @param {number} [next] Number of succeeding siblings to include
|
|
210
|
+
* @param {boolean} [chunksOnly] When true, stop traversal at non-CHUNK siblings (default: false)
|
|
211
|
+
* @param {string} [authorization]
|
|
212
|
+
* @param {string} [ksUat]
|
|
213
|
+
* @throws {RequiredError}
|
|
214
|
+
* @memberof ChunksApiInterface
|
|
215
|
+
*/
|
|
216
|
+
getChunkNeighborsRequestOpts(requestParameters: GetChunkNeighborsRequest): Promise<runtime.RequestOpts>;
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* Get neighboring siblings by traversing the sibling linked list. Walks the sibling chain backward (prev) and forward (next) from the anchor chunk. Returns sections and chunks in sibling order within the same parent. When ``chunks_only=true``, the traversal stops at the first non-CHUNK sibling in each direction, returning only chunk neighbors.
|
|
220
|
+
* @summary Get Chunk Neighbors Handler
|
|
221
|
+
* @param {string} chunkId
|
|
222
|
+
* @param {number} [prev] Number of preceding siblings to include
|
|
223
|
+
* @param {number} [next] Number of succeeding siblings to include
|
|
224
|
+
* @param {boolean} [chunksOnly] When true, stop traversal at non-CHUNK siblings (default: false)
|
|
225
|
+
* @param {string} [authorization]
|
|
226
|
+
* @param {string} [ksUat]
|
|
227
|
+
* @param {*} [options] Override http request option.
|
|
228
|
+
* @throws {RequiredError}
|
|
229
|
+
* @memberof ChunksApiInterface
|
|
230
|
+
*/
|
|
231
|
+
getChunkNeighborsRaw(requestParameters: GetChunkNeighborsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ChunkNeighborsResponse>>;
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* Get neighboring siblings by traversing the sibling linked list. Walks the sibling chain backward (prev) and forward (next) from the anchor chunk. Returns sections and chunks in sibling order within the same parent. When ``chunks_only=true``, the traversal stops at the first non-CHUNK sibling in each direction, returning only chunk neighbors.
|
|
235
|
+
* Get Chunk Neighbors Handler
|
|
236
|
+
*/
|
|
237
|
+
getChunkNeighbors(requestParameters: GetChunkNeighborsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ChunkNeighborsResponse>;
|
|
238
|
+
|
|
193
239
|
/**
|
|
194
240
|
* Creates request options for getChunksBulk without sending the request
|
|
195
241
|
* @param {Array<string>} [chunkIds] Chunk IDs to resolve (max 200)
|
|
@@ -499,6 +545,69 @@ export class ChunksApi extends runtime.BaseAPI implements ChunksApiInterface {
|
|
|
499
545
|
return await response.value();
|
|
500
546
|
}
|
|
501
547
|
|
|
548
|
+
/**
|
|
549
|
+
* Creates request options for getChunkNeighbors without sending the request
|
|
550
|
+
*/
|
|
551
|
+
async getChunkNeighborsRequestOpts(requestParameters: GetChunkNeighborsRequest): Promise<runtime.RequestOpts> {
|
|
552
|
+
if (requestParameters['chunkId'] == null) {
|
|
553
|
+
throw new runtime.RequiredError(
|
|
554
|
+
'chunkId',
|
|
555
|
+
'Required parameter "chunkId" was null or undefined when calling getChunkNeighbors().'
|
|
556
|
+
);
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
const queryParameters: any = {};
|
|
560
|
+
|
|
561
|
+
if (requestParameters['prev'] != null) {
|
|
562
|
+
queryParameters['prev'] = requestParameters['prev'];
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
if (requestParameters['next'] != null) {
|
|
566
|
+
queryParameters['next'] = requestParameters['next'];
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
if (requestParameters['chunksOnly'] != null) {
|
|
570
|
+
queryParameters['chunks_only'] = requestParameters['chunksOnly'];
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
574
|
+
|
|
575
|
+
if (requestParameters['authorization'] != null) {
|
|
576
|
+
headerParameters['authorization'] = String(requestParameters['authorization']);
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
|
|
580
|
+
let urlPath = `/v1/chunks/{chunk_id}/neighbors`;
|
|
581
|
+
urlPath = urlPath.replace(`{${"chunk_id"}}`, encodeURIComponent(String(requestParameters['chunkId'])));
|
|
582
|
+
|
|
583
|
+
return {
|
|
584
|
+
path: urlPath,
|
|
585
|
+
method: 'GET',
|
|
586
|
+
headers: headerParameters,
|
|
587
|
+
query: queryParameters,
|
|
588
|
+
};
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
/**
|
|
592
|
+
* Get neighboring siblings by traversing the sibling linked list. Walks the sibling chain backward (prev) and forward (next) from the anchor chunk. Returns sections and chunks in sibling order within the same parent. When ``chunks_only=true``, the traversal stops at the first non-CHUNK sibling in each direction, returning only chunk neighbors.
|
|
593
|
+
* Get Chunk Neighbors Handler
|
|
594
|
+
*/
|
|
595
|
+
async getChunkNeighborsRaw(requestParameters: GetChunkNeighborsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ChunkNeighborsResponse>> {
|
|
596
|
+
const requestOptions = await this.getChunkNeighborsRequestOpts(requestParameters);
|
|
597
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
598
|
+
|
|
599
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => ChunkNeighborsResponseFromJSON(jsonValue));
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
/**
|
|
603
|
+
* Get neighboring siblings by traversing the sibling linked list. Walks the sibling chain backward (prev) and forward (next) from the anchor chunk. Returns sections and chunks in sibling order within the same parent. When ``chunks_only=true``, the traversal stops at the first non-CHUNK sibling in each direction, returning only chunk neighbors.
|
|
604
|
+
* Get Chunk Neighbors Handler
|
|
605
|
+
*/
|
|
606
|
+
async getChunkNeighbors(requestParameters: GetChunkNeighborsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ChunkNeighborsResponse> {
|
|
607
|
+
const response = await this.getChunkNeighborsRaw(requestParameters, initOverrides);
|
|
608
|
+
return await response.value();
|
|
609
|
+
}
|
|
610
|
+
|
|
502
611
|
/**
|
|
503
612
|
* Creates request options for getChunksBulk without sending the request
|
|
504
613
|
*/
|
package/src/apis/DocumentsApi.ts
CHANGED
|
@@ -16,7 +16,6 @@
|
|
|
16
16
|
import * as runtime from '../runtime';
|
|
17
17
|
import type {
|
|
18
18
|
ChunkType,
|
|
19
|
-
ConversionEngine,
|
|
20
19
|
CreateDocumentRequest,
|
|
21
20
|
DocumentResponse,
|
|
22
21
|
HTTPValidationError,
|
|
@@ -30,8 +29,6 @@ import type {
|
|
|
30
29
|
import {
|
|
31
30
|
ChunkTypeFromJSON,
|
|
32
31
|
ChunkTypeToJSON,
|
|
33
|
-
ConversionEngineFromJSON,
|
|
34
|
-
ConversionEngineToJSON,
|
|
35
32
|
CreateDocumentRequestFromJSON,
|
|
36
33
|
CreateDocumentRequestToJSON,
|
|
37
34
|
DocumentResponseFromJSON,
|
|
@@ -81,7 +78,6 @@ export interface IngestDocumentRequest {
|
|
|
81
78
|
chunkType?: ChunkType;
|
|
82
79
|
secondaryTaxonomy?: ImageTaxonomy;
|
|
83
80
|
pageDpi?: number;
|
|
84
|
-
conversionEngine?: ConversionEngine;
|
|
85
81
|
}
|
|
86
82
|
|
|
87
83
|
export interface IngestDocumentVersionRequest {
|
|
@@ -93,7 +89,6 @@ export interface IngestDocumentVersionRequest {
|
|
|
93
89
|
chunkType?: ChunkType;
|
|
94
90
|
secondaryTaxonomy?: ImageTaxonomy;
|
|
95
91
|
pageDpi?: number;
|
|
96
|
-
conversionEngine?: ConversionEngine;
|
|
97
92
|
}
|
|
98
93
|
|
|
99
94
|
export interface ListDocumentsRequest {
|
|
@@ -217,7 +212,6 @@ export interface DocumentsApiInterface {
|
|
|
217
212
|
* @param {ChunkType} [chunkType]
|
|
218
213
|
* @param {ImageTaxonomy} [secondaryTaxonomy]
|
|
219
214
|
* @param {number} [pageDpi] DPI for PDF page screenshots (default 72, min 36, max 216).
|
|
220
|
-
* @param {ConversionEngine} [conversionEngine]
|
|
221
215
|
* @throws {RequiredError}
|
|
222
216
|
* @memberof DocumentsApiInterface
|
|
223
217
|
*/
|
|
@@ -235,7 +229,6 @@ export interface DocumentsApiInterface {
|
|
|
235
229
|
* @param {ChunkType} [chunkType]
|
|
236
230
|
* @param {ImageTaxonomy} [secondaryTaxonomy]
|
|
237
231
|
* @param {number} [pageDpi] DPI for PDF page screenshots (default 72, min 36, max 216).
|
|
238
|
-
* @param {ConversionEngine} [conversionEngine]
|
|
239
232
|
* @param {*} [options] Override http request option.
|
|
240
233
|
* @throws {RequiredError}
|
|
241
234
|
* @memberof DocumentsApiInterface
|
|
@@ -258,7 +251,6 @@ export interface DocumentsApiInterface {
|
|
|
258
251
|
* @param {ChunkType} [chunkType]
|
|
259
252
|
* @param {ImageTaxonomy} [secondaryTaxonomy]
|
|
260
253
|
* @param {number} [pageDpi] DPI for PDF page screenshots (default 72, min 36, max 216).
|
|
261
|
-
* @param {ConversionEngine} [conversionEngine]
|
|
262
254
|
* @throws {RequiredError}
|
|
263
255
|
* @memberof DocumentsApiInterface
|
|
264
256
|
*/
|
|
@@ -275,7 +267,6 @@ export interface DocumentsApiInterface {
|
|
|
275
267
|
* @param {ChunkType} [chunkType]
|
|
276
268
|
* @param {ImageTaxonomy} [secondaryTaxonomy]
|
|
277
269
|
* @param {number} [pageDpi] DPI for PDF page screenshots (default 72, min 36, max 216).
|
|
278
|
-
* @param {ConversionEngine} [conversionEngine]
|
|
279
270
|
* @param {*} [options] Override http request option.
|
|
280
271
|
* @throws {RequiredError}
|
|
281
272
|
* @memberof DocumentsApiInterface
|
|
@@ -589,10 +580,6 @@ export class DocumentsApi extends runtime.BaseAPI implements DocumentsApiInterfa
|
|
|
589
580
|
formParams.append('page_dpi', requestParameters['pageDpi'] as any);
|
|
590
581
|
}
|
|
591
582
|
|
|
592
|
-
if (requestParameters['conversionEngine'] != null) {
|
|
593
|
-
formParams.append('conversion_engine', requestParameters['conversionEngine'] as any);
|
|
594
|
-
}
|
|
595
|
-
|
|
596
583
|
|
|
597
584
|
let urlPath = `/v1/documents/ingest`;
|
|
598
585
|
|
|
@@ -687,10 +674,6 @@ export class DocumentsApi extends runtime.BaseAPI implements DocumentsApiInterfa
|
|
|
687
674
|
formParams.append('page_dpi', requestParameters['pageDpi'] as any);
|
|
688
675
|
}
|
|
689
676
|
|
|
690
|
-
if (requestParameters['conversionEngine'] != null) {
|
|
691
|
-
formParams.append('conversion_engine', requestParameters['conversionEngine'] as any);
|
|
692
|
-
}
|
|
693
|
-
|
|
694
677
|
|
|
695
678
|
let urlPath = `/v1/documents/{document_id}/ingest`;
|
|
696
679
|
urlPath = urlPath.replace(`{${"document_id"}}`, encodeURIComponent(String(requestParameters['documentId'])));
|
|
@@ -20,13 +20,6 @@ import {
|
|
|
20
20
|
ImageTaxonomyToJSON,
|
|
21
21
|
ImageTaxonomyToJSONTyped,
|
|
22
22
|
} from './ImageTaxonomy';
|
|
23
|
-
import type { IngestionMode } from './IngestionMode';
|
|
24
|
-
import {
|
|
25
|
-
IngestionModeFromJSON,
|
|
26
|
-
IngestionModeFromJSONTyped,
|
|
27
|
-
IngestionModeToJSON,
|
|
28
|
-
IngestionModeToJSONTyped,
|
|
29
|
-
} from './IngestionMode';
|
|
30
23
|
import type { PolygonReference } from './PolygonReference';
|
|
31
24
|
import {
|
|
32
25
|
PolygonReferenceFromJSON,
|
|
@@ -59,12 +52,6 @@ export interface ChunkMetadataInput {
|
|
|
59
52
|
* @memberof ChunkMetadataInput
|
|
60
53
|
*/
|
|
61
54
|
summary?: string | null;
|
|
62
|
-
/**
|
|
63
|
-
*
|
|
64
|
-
* @type {IngestionMode}
|
|
65
|
-
* @memberof ChunkMetadataInput
|
|
66
|
-
*/
|
|
67
|
-
ingestionMode?: IngestionMode;
|
|
68
55
|
/**
|
|
69
56
|
* S3 URI to extracted PDF text used for LLM grounding during enrichment
|
|
70
57
|
* @type {string}
|
|
@@ -155,7 +142,6 @@ export function ChunkMetadataInputFromJSONTyped(json: any, ignoreDiscriminator:
|
|
|
155
142
|
'polygons': json['polygons'] == null ? undefined : ((json['polygons'] as Array<any>).map(PolygonReferenceFromJSON)),
|
|
156
143
|
's3Urls': json['s3_urls'] == null ? undefined : json['s3_urls'],
|
|
157
144
|
'summary': json['summary'] == null ? undefined : json['summary'],
|
|
158
|
-
'ingestionMode': json['ingestion_mode'] == null ? undefined : IngestionModeFromJSON(json['ingestion_mode']),
|
|
159
145
|
'extractedTextS3Uri': json['extracted_text_s3_uri'] == null ? undefined : json['extracted_text_s3_uri'],
|
|
160
146
|
'secondaryTaxonomy': json['secondary_taxonomy'] == null ? undefined : ImageTaxonomyFromJSON(json['secondary_taxonomy']),
|
|
161
147
|
'sheetName': json['sheet_name'] == null ? undefined : json['sheet_name'],
|
|
@@ -184,7 +170,6 @@ export function ChunkMetadataInputToJSONTyped(value?: ChunkMetadataInput | null,
|
|
|
184
170
|
'polygons': value['polygons'] == null ? undefined : ((value['polygons'] as Array<any>).map(PolygonReferenceToJSON)),
|
|
185
171
|
's3_urls': value['s3Urls'],
|
|
186
172
|
'summary': value['summary'],
|
|
187
|
-
'ingestion_mode': IngestionModeToJSON(value['ingestionMode']),
|
|
188
173
|
'extracted_text_s3_uri': value['extractedTextS3Uri'],
|
|
189
174
|
'secondary_taxonomy': ImageTaxonomyToJSON(value['secondaryTaxonomy']),
|
|
190
175
|
'sheet_name': value['sheetName'],
|
|
@@ -20,13 +20,6 @@ import {
|
|
|
20
20
|
ImageTaxonomyToJSON,
|
|
21
21
|
ImageTaxonomyToJSONTyped,
|
|
22
22
|
} from './ImageTaxonomy';
|
|
23
|
-
import type { IngestionMode } from './IngestionMode';
|
|
24
|
-
import {
|
|
25
|
-
IngestionModeFromJSON,
|
|
26
|
-
IngestionModeFromJSONTyped,
|
|
27
|
-
IngestionModeToJSON,
|
|
28
|
-
IngestionModeToJSONTyped,
|
|
29
|
-
} from './IngestionMode';
|
|
30
23
|
import type { PolygonReference } from './PolygonReference';
|
|
31
24
|
import {
|
|
32
25
|
PolygonReferenceFromJSON,
|
|
@@ -59,12 +52,6 @@ export interface ChunkMetadataOutput {
|
|
|
59
52
|
* @memberof ChunkMetadataOutput
|
|
60
53
|
*/
|
|
61
54
|
summary?: string | null;
|
|
62
|
-
/**
|
|
63
|
-
*
|
|
64
|
-
* @type {IngestionMode}
|
|
65
|
-
* @memberof ChunkMetadataOutput
|
|
66
|
-
*/
|
|
67
|
-
ingestionMode?: IngestionMode;
|
|
68
55
|
/**
|
|
69
56
|
* S3 URI to extracted PDF text used for LLM grounding during enrichment
|
|
70
57
|
* @type {string}
|
|
@@ -155,7 +142,6 @@ export function ChunkMetadataOutputFromJSONTyped(json: any, ignoreDiscriminator:
|
|
|
155
142
|
'polygons': json['polygons'] == null ? undefined : ((json['polygons'] as Array<any>).map(PolygonReferenceFromJSON)),
|
|
156
143
|
's3Urls': json['s3_urls'] == null ? undefined : json['s3_urls'],
|
|
157
144
|
'summary': json['summary'] == null ? undefined : json['summary'],
|
|
158
|
-
'ingestionMode': json['ingestion_mode'] == null ? undefined : IngestionModeFromJSON(json['ingestion_mode']),
|
|
159
145
|
'extractedTextS3Uri': json['extracted_text_s3_uri'] == null ? undefined : json['extracted_text_s3_uri'],
|
|
160
146
|
'secondaryTaxonomy': json['secondary_taxonomy'] == null ? undefined : ImageTaxonomyFromJSON(json['secondary_taxonomy']),
|
|
161
147
|
'sheetName': json['sheet_name'] == null ? undefined : json['sheet_name'],
|
|
@@ -184,7 +170,6 @@ export function ChunkMetadataOutputToJSONTyped(value?: ChunkMetadataOutput | nul
|
|
|
184
170
|
'polygons': value['polygons'] == null ? undefined : ((value['polygons'] as Array<any>).map(PolygonReferenceToJSON)),
|
|
185
171
|
's3_urls': value['s3Urls'],
|
|
186
172
|
'summary': value['summary'],
|
|
187
|
-
'ingestion_mode': IngestionModeToJSON(value['ingestionMode']),
|
|
188
173
|
'extracted_text_s3_uri': value['extractedTextS3Uri'],
|
|
189
174
|
'secondary_taxonomy': ImageTaxonomyToJSON(value['secondaryTaxonomy']),
|
|
190
175
|
'sheet_name': value['sheetName'],
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Knowledge Stack API
|
|
5
|
+
* Knowledge Stack backend API for authentication and knowledge management
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 0.1.0
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { mapValues } from '../runtime';
|
|
16
|
+
import type { SectionContentItemOrChunkContentItem } from './SectionContentItemOrChunkContentItem';
|
|
17
|
+
import {
|
|
18
|
+
SectionContentItemOrChunkContentItemFromJSON,
|
|
19
|
+
SectionContentItemOrChunkContentItemFromJSONTyped,
|
|
20
|
+
SectionContentItemOrChunkContentItemToJSON,
|
|
21
|
+
SectionContentItemOrChunkContentItemToJSONTyped,
|
|
22
|
+
} from './SectionContentItemOrChunkContentItem';
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Response for chunk neighbor traversal.
|
|
26
|
+
*
|
|
27
|
+
* Returns items in the same ``SectionOrChunkItem`` discriminated union
|
|
28
|
+
* format used by the document version contents endpoint.
|
|
29
|
+
* @export
|
|
30
|
+
* @interface ChunkNeighborsResponse
|
|
31
|
+
*/
|
|
32
|
+
export interface ChunkNeighborsResponse {
|
|
33
|
+
/**
|
|
34
|
+
* Ordered siblings: preceding → anchor → succeeding
|
|
35
|
+
* @type {Array<SectionContentItemOrChunkContentItem>}
|
|
36
|
+
* @memberof ChunkNeighborsResponse
|
|
37
|
+
*/
|
|
38
|
+
items: Array<SectionContentItemOrChunkContentItem>;
|
|
39
|
+
/**
|
|
40
|
+
* Index of the anchor chunk in items
|
|
41
|
+
* @type {number}
|
|
42
|
+
* @memberof ChunkNeighborsResponse
|
|
43
|
+
*/
|
|
44
|
+
anchorIndex: number;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Check if a given object implements the ChunkNeighborsResponse interface.
|
|
49
|
+
*/
|
|
50
|
+
export function instanceOfChunkNeighborsResponse(value: object): value is ChunkNeighborsResponse {
|
|
51
|
+
if (!('items' in value) || value['items'] === undefined) return false;
|
|
52
|
+
if (!('anchorIndex' in value) || value['anchorIndex'] === undefined) return false;
|
|
53
|
+
return true;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export function ChunkNeighborsResponseFromJSON(json: any): ChunkNeighborsResponse {
|
|
57
|
+
return ChunkNeighborsResponseFromJSONTyped(json, false);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export function ChunkNeighborsResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): ChunkNeighborsResponse {
|
|
61
|
+
if (json == null) {
|
|
62
|
+
return json;
|
|
63
|
+
}
|
|
64
|
+
return {
|
|
65
|
+
|
|
66
|
+
'items': ((json['items'] as Array<any>).map(SectionContentItemOrChunkContentItemFromJSON)),
|
|
67
|
+
'anchorIndex': json['anchor_index'],
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export function ChunkNeighborsResponseToJSON(json: any): ChunkNeighborsResponse {
|
|
72
|
+
return ChunkNeighborsResponseToJSONTyped(json, false);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export function ChunkNeighborsResponseToJSONTyped(value?: ChunkNeighborsResponse | null, ignoreDiscriminator: boolean = false): any {
|
|
76
|
+
if (value == null) {
|
|
77
|
+
return value;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
return {
|
|
81
|
+
|
|
82
|
+
'items': ((value['items'] as Array<any>).map(SectionContentItemOrChunkContentItemToJSON)),
|
|
83
|
+
'anchor_index': value['anchorIndex'],
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export const ChunkNeighborsResponsePropertyValidationAttributesMap: {
|
|
88
|
+
[property: string]: {
|
|
89
|
+
maxLength?: number,
|
|
90
|
+
minLength?: number,
|
|
91
|
+
pattern?: string,
|
|
92
|
+
maximum?: number,
|
|
93
|
+
exclusiveMaximum?: boolean,
|
|
94
|
+
minimum?: number,
|
|
95
|
+
exclusiveMinimum?: boolean,
|
|
96
|
+
multipleOf?: number,
|
|
97
|
+
maxItems?: number,
|
|
98
|
+
minItems?: number,
|
|
99
|
+
uniqueItems?: boolean
|
|
100
|
+
}
|
|
101
|
+
} = {
|
|
102
|
+
}
|
|
103
|
+
|
|
@@ -14,11 +14,12 @@
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
17
|
+
* Ingestion pipeline mode — determines conversion and chunking strategy.
|
|
18
18
|
* @export
|
|
19
19
|
*/
|
|
20
20
|
export const IngestionMode = {
|
|
21
|
-
|
|
21
|
+
HighAccuracy: 'high_accuracy',
|
|
22
|
+
Standard: 'standard',
|
|
22
23
|
SingleChunk: 'single_chunk'
|
|
23
24
|
} as const;
|
|
24
25
|
export type IngestionMode = typeof IngestionMode[keyof typeof IngestionMode];
|
|
@@ -20,13 +20,6 @@ import {
|
|
|
20
20
|
PipelineStatusToJSON,
|
|
21
21
|
PipelineStatusToJSONTyped,
|
|
22
22
|
} from './PipelineStatus';
|
|
23
|
-
import type { ConversionEngine } from './ConversionEngine';
|
|
24
|
-
import {
|
|
25
|
-
ConversionEngineFromJSON,
|
|
26
|
-
ConversionEngineFromJSONTyped,
|
|
27
|
-
ConversionEngineToJSON,
|
|
28
|
-
ConversionEngineToJSONTyped,
|
|
29
|
-
} from './ConversionEngine';
|
|
30
23
|
import type { IngestionMode } from './IngestionMode';
|
|
31
24
|
import {
|
|
32
25
|
IngestionModeFromJSON,
|
|
@@ -67,7 +60,7 @@ export interface PipelineState {
|
|
|
67
60
|
*/
|
|
68
61
|
lastStateUpdateTimestamp?: Date | null;
|
|
69
62
|
/**
|
|
70
|
-
* Name of the last activity that executed (e.g., '
|
|
63
|
+
* Name of the last activity that executed (e.g., 'document_preparation')
|
|
71
64
|
* @type {string}
|
|
72
65
|
* @memberof PipelineState
|
|
73
66
|
*/
|
|
@@ -108,12 +101,6 @@ export interface PipelineState {
|
|
|
108
101
|
* @memberof PipelineState
|
|
109
102
|
*/
|
|
110
103
|
chunkType?: ChunkType;
|
|
111
|
-
/**
|
|
112
|
-
*
|
|
113
|
-
* @type {ConversionEngine}
|
|
114
|
-
* @memberof PipelineState
|
|
115
|
-
*/
|
|
116
|
-
conversionEngine?: ConversionEngine;
|
|
117
104
|
}
|
|
118
105
|
|
|
119
106
|
|
|
@@ -146,7 +133,6 @@ export function PipelineStateFromJSONTyped(json: any, ignoreDiscriminator: boole
|
|
|
146
133
|
'pageDpi': json['page_dpi'] == null ? undefined : json['page_dpi'],
|
|
147
134
|
'ingestionMode': json['ingestion_mode'] == null ? undefined : IngestionModeFromJSON(json['ingestion_mode']),
|
|
148
135
|
'chunkType': json['chunk_type'] == null ? undefined : ChunkTypeFromJSON(json['chunk_type']),
|
|
149
|
-
'conversionEngine': json['conversion_engine'] == null ? undefined : ConversionEngineFromJSON(json['conversion_engine']),
|
|
150
136
|
};
|
|
151
137
|
}
|
|
152
138
|
|
|
@@ -171,7 +157,6 @@ export function PipelineStateToJSONTyped(value?: PipelineState | null, ignoreDis
|
|
|
171
157
|
'page_dpi': value['pageDpi'],
|
|
172
158
|
'ingestion_mode': IngestionModeToJSON(value['ingestionMode']),
|
|
173
159
|
'chunk_type': ChunkTypeToJSON(value['chunkType']),
|
|
174
|
-
'conversion_engine': ConversionEngineToJSON(value['conversionEngine']),
|
|
175
160
|
};
|
|
176
161
|
}
|
|
177
162
|
|