@knowledge-stack/ksapi 1.24.0 → 1.25.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/.openapi-generator/FILES +8 -0
- package/README.md +10 -2
- package/dist/apis/ChunksApi.d.ts +87 -5
- package/dist/apis/ChunksApi.js +85 -2
- package/dist/apis/PathPartsApi.d.ts +86 -1
- package/dist/apis/PathPartsApi.js +85 -0
- package/dist/esm/apis/ChunksApi.d.ts +87 -5
- package/dist/esm/apis/ChunksApi.js +86 -3
- package/dist/esm/apis/PathPartsApi.d.ts +86 -1
- package/dist/esm/apis/PathPartsApi.js +86 -1
- package/dist/esm/models/ChunkBulkResponse.d.ts +139 -0
- package/dist/esm/models/ChunkBulkResponse.js +100 -0
- package/dist/esm/models/ChunkContentItem.d.ts +1 -1
- package/dist/esm/models/ChunkContentItem.js +3 -1
- package/dist/esm/models/ChunkSearchRequest.d.ts +17 -5
- package/dist/esm/models/ChunkSearchRequest.js +12 -4
- package/dist/esm/models/DocumentResponse.d.ts +1 -1
- package/dist/esm/models/DocumentResponse.js +3 -1
- package/dist/esm/models/FolderResponse.d.ts +1 -1
- package/dist/esm/models/FolderResponse.js +3 -1
- package/dist/esm/models/SectionContentItem.d.ts +1 -1
- package/dist/esm/models/SectionContentItem.js +3 -1
- package/dist/esm/models/SubtreeChunkGroup.d.ts +62 -0
- package/dist/esm/models/SubtreeChunkGroup.js +52 -0
- package/dist/esm/models/SubtreeChunksResponse.d.ts +48 -0
- package/dist/esm/models/SubtreeChunksResponse.js +45 -0
- package/dist/esm/models/VersionChunkIdsResponse.d.ts +47 -0
- package/dist/esm/models/VersionChunkIdsResponse.js +44 -0
- package/dist/esm/models/index.d.ts +4 -0
- package/dist/esm/models/index.js +4 -0
- package/dist/models/ChunkBulkResponse.d.ts +139 -0
- package/dist/models/ChunkBulkResponse.js +108 -0
- package/dist/models/ChunkContentItem.d.ts +1 -1
- package/dist/models/ChunkContentItem.js +3 -1
- package/dist/models/ChunkSearchRequest.d.ts +17 -5
- package/dist/models/ChunkSearchRequest.js +12 -4
- package/dist/models/DocumentResponse.d.ts +1 -1
- package/dist/models/DocumentResponse.js +3 -1
- package/dist/models/FolderResponse.d.ts +1 -1
- package/dist/models/FolderResponse.js +3 -1
- package/dist/models/SectionContentItem.d.ts +1 -1
- package/dist/models/SectionContentItem.js +3 -1
- package/dist/models/SubtreeChunkGroup.d.ts +62 -0
- package/dist/models/SubtreeChunkGroup.js +60 -0
- package/dist/models/SubtreeChunksResponse.d.ts +48 -0
- package/dist/models/SubtreeChunksResponse.js +53 -0
- package/dist/models/VersionChunkIdsResponse.d.ts +47 -0
- package/dist/models/VersionChunkIdsResponse.js +52 -0
- package/dist/models/index.d.ts +4 -0
- package/dist/models/index.js +4 -0
- package/docs/ChunkBulkResponse.md +65 -0
- package/docs/ChunkSearchRequest.md +8 -4
- package/docs/ChunksApi.md +145 -1
- package/docs/PathPartsApi.md +147 -0
- package/docs/SubtreeChunkGroup.md +39 -0
- package/docs/SubtreeChunksResponse.md +35 -0
- package/docs/VersionChunkIdsResponse.md +35 -0
- package/package.json +1 -1
- package/src/apis/ChunksApi.ts +165 -4
- package/src/apis/PathPartsApi.ts +166 -0
- package/src/models/ChunkBulkResponse.ts +232 -0
- package/src/models/ChunkContentItem.ts +3 -2
- package/src/models/ChunkSearchRequest.ts +29 -9
- package/src/models/DocumentResponse.ts +3 -2
- package/src/models/FolderResponse.ts +3 -2
- package/src/models/SectionContentItem.ts +3 -2
- package/src/models/SubtreeChunkGroup.ts +104 -0
- package/src/models/SubtreeChunksResponse.ts +91 -0
- package/src/models/VersionChunkIdsResponse.ts +83 -0
- package/src/models/index.ts +4 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Knowledge Stack API
|
|
3
|
+
* Knowledge Stack backend API for authentication and knowledge management
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 0.1.0
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Response containing chunk IDs for a document version.
|
|
14
|
+
* @export
|
|
15
|
+
* @interface VersionChunkIdsResponse
|
|
16
|
+
*/
|
|
17
|
+
export interface VersionChunkIdsResponse {
|
|
18
|
+
/**
|
|
19
|
+
*
|
|
20
|
+
* @type {Array<string>}
|
|
21
|
+
* @memberof VersionChunkIdsResponse
|
|
22
|
+
*/
|
|
23
|
+
chunkIds: Array<string>;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Check if a given object implements the VersionChunkIdsResponse interface.
|
|
27
|
+
*/
|
|
28
|
+
export declare function instanceOfVersionChunkIdsResponse(value: object): value is VersionChunkIdsResponse;
|
|
29
|
+
export declare function VersionChunkIdsResponseFromJSON(json: any): VersionChunkIdsResponse;
|
|
30
|
+
export declare function VersionChunkIdsResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): VersionChunkIdsResponse;
|
|
31
|
+
export declare function VersionChunkIdsResponseToJSON(json: any): VersionChunkIdsResponse;
|
|
32
|
+
export declare function VersionChunkIdsResponseToJSONTyped(value?: VersionChunkIdsResponse | null, ignoreDiscriminator?: boolean): any;
|
|
33
|
+
export declare const VersionChunkIdsResponsePropertyValidationAttributesMap: {
|
|
34
|
+
[property: string]: {
|
|
35
|
+
maxLength?: number;
|
|
36
|
+
minLength?: number;
|
|
37
|
+
pattern?: string;
|
|
38
|
+
maximum?: number;
|
|
39
|
+
exclusiveMaximum?: boolean;
|
|
40
|
+
minimum?: number;
|
|
41
|
+
exclusiveMinimum?: boolean;
|
|
42
|
+
multipleOf?: number;
|
|
43
|
+
maxItems?: number;
|
|
44
|
+
minItems?: number;
|
|
45
|
+
uniqueItems?: boolean;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* Knowledge Stack API
|
|
6
|
+
* Knowledge Stack backend API for authentication and knowledge management
|
|
7
|
+
*
|
|
8
|
+
* The version of the OpenAPI document: 0.1.0
|
|
9
|
+
*
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.VersionChunkIdsResponsePropertyValidationAttributesMap = void 0;
|
|
17
|
+
exports.instanceOfVersionChunkIdsResponse = instanceOfVersionChunkIdsResponse;
|
|
18
|
+
exports.VersionChunkIdsResponseFromJSON = VersionChunkIdsResponseFromJSON;
|
|
19
|
+
exports.VersionChunkIdsResponseFromJSONTyped = VersionChunkIdsResponseFromJSONTyped;
|
|
20
|
+
exports.VersionChunkIdsResponseToJSON = VersionChunkIdsResponseToJSON;
|
|
21
|
+
exports.VersionChunkIdsResponseToJSONTyped = VersionChunkIdsResponseToJSONTyped;
|
|
22
|
+
/**
|
|
23
|
+
* Check if a given object implements the VersionChunkIdsResponse interface.
|
|
24
|
+
*/
|
|
25
|
+
function instanceOfVersionChunkIdsResponse(value) {
|
|
26
|
+
if (!('chunkIds' in value) || value['chunkIds'] === undefined)
|
|
27
|
+
return false;
|
|
28
|
+
return true;
|
|
29
|
+
}
|
|
30
|
+
function VersionChunkIdsResponseFromJSON(json) {
|
|
31
|
+
return VersionChunkIdsResponseFromJSONTyped(json, false);
|
|
32
|
+
}
|
|
33
|
+
function VersionChunkIdsResponseFromJSONTyped(json, ignoreDiscriminator) {
|
|
34
|
+
if (json == null) {
|
|
35
|
+
return json;
|
|
36
|
+
}
|
|
37
|
+
return {
|
|
38
|
+
'chunkIds': json['chunk_ids'],
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
function VersionChunkIdsResponseToJSON(json) {
|
|
42
|
+
return VersionChunkIdsResponseToJSONTyped(json, false);
|
|
43
|
+
}
|
|
44
|
+
function VersionChunkIdsResponseToJSONTyped(value, ignoreDiscriminator = false) {
|
|
45
|
+
if (value == null) {
|
|
46
|
+
return value;
|
|
47
|
+
}
|
|
48
|
+
return {
|
|
49
|
+
'chunk_ids': value['chunkIds'],
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
exports.VersionChunkIdsResponsePropertyValidationAttributesMap = {};
|
package/dist/models/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export * from './BulkTagRequest';
|
|
2
|
+
export * from './ChunkBulkResponse';
|
|
2
3
|
export * from './ChunkContentItem';
|
|
3
4
|
export * from './ChunkLineageResponse';
|
|
4
5
|
export * from './ChunkMetadataInput';
|
|
@@ -74,6 +75,8 @@ export * from './SectionContentItem';
|
|
|
74
75
|
export * from './SectionContentItemOrChunkContentItem';
|
|
75
76
|
export * from './SectionResponse';
|
|
76
77
|
export * from './SignInRequest';
|
|
78
|
+
export * from './SubtreeChunkGroup';
|
|
79
|
+
export * from './SubtreeChunksResponse';
|
|
77
80
|
export * from './TagResponse';
|
|
78
81
|
export * from './TenantResponse';
|
|
79
82
|
export * from './TenantUserEditRequest';
|
|
@@ -93,6 +96,7 @@ export * from './UpdateThreadRequest';
|
|
|
93
96
|
export * from './UpdateUserRequest';
|
|
94
97
|
export * from './UserResponse';
|
|
95
98
|
export * from './ValidationError';
|
|
99
|
+
export * from './VersionChunkIdsResponse';
|
|
96
100
|
export * from './WorkflowAction';
|
|
97
101
|
export * from './WorkflowActionResponse';
|
|
98
102
|
export * from './WorkflowDetailResponse';
|
package/dist/models/index.js
CHANGED
|
@@ -17,6 +17,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
/* tslint:disable */
|
|
18
18
|
/* eslint-disable */
|
|
19
19
|
__exportStar(require("./BulkTagRequest"), exports);
|
|
20
|
+
__exportStar(require("./ChunkBulkResponse"), exports);
|
|
20
21
|
__exportStar(require("./ChunkContentItem"), exports);
|
|
21
22
|
__exportStar(require("./ChunkLineageResponse"), exports);
|
|
22
23
|
__exportStar(require("./ChunkMetadataInput"), exports);
|
|
@@ -92,6 +93,8 @@ __exportStar(require("./SectionContentItem"), exports);
|
|
|
92
93
|
__exportStar(require("./SectionContentItemOrChunkContentItem"), exports);
|
|
93
94
|
__exportStar(require("./SectionResponse"), exports);
|
|
94
95
|
__exportStar(require("./SignInRequest"), exports);
|
|
96
|
+
__exportStar(require("./SubtreeChunkGroup"), exports);
|
|
97
|
+
__exportStar(require("./SubtreeChunksResponse"), exports);
|
|
95
98
|
__exportStar(require("./TagResponse"), exports);
|
|
96
99
|
__exportStar(require("./TenantResponse"), exports);
|
|
97
100
|
__exportStar(require("./TenantUserEditRequest"), exports);
|
|
@@ -111,6 +114,7 @@ __exportStar(require("./UpdateThreadRequest"), exports);
|
|
|
111
114
|
__exportStar(require("./UpdateUserRequest"), exports);
|
|
112
115
|
__exportStar(require("./UserResponse"), exports);
|
|
113
116
|
__exportStar(require("./ValidationError"), exports);
|
|
117
|
+
__exportStar(require("./VersionChunkIdsResponse"), exports);
|
|
114
118
|
__exportStar(require("./WorkflowAction"), exports);
|
|
115
119
|
__exportStar(require("./WorkflowActionResponse"), exports);
|
|
116
120
|
__exportStar(require("./WorkflowDetailResponse"), exports);
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
|
|
2
|
+
# ChunkBulkResponse
|
|
3
|
+
|
|
4
|
+
Chunk response with ancestor path part IDs for Qdrant payload construction.
|
|
5
|
+
|
|
6
|
+
## Properties
|
|
7
|
+
|
|
8
|
+
Name | Type
|
|
9
|
+
------------ | -------------
|
|
10
|
+
`id` | string
|
|
11
|
+
`pathPartId` | string
|
|
12
|
+
`contentId` | string
|
|
13
|
+
`content` | string
|
|
14
|
+
`chunkType` | [ChunkType](ChunkType.md)
|
|
15
|
+
`chunkMetadata` | [ChunkMetadataOutput](ChunkMetadataOutput.md)
|
|
16
|
+
`parentPathId` | string
|
|
17
|
+
`prevSiblingPathId` | string
|
|
18
|
+
`nextSiblingPathId` | string
|
|
19
|
+
`materializedPath` | string
|
|
20
|
+
`systemManaged` | boolean
|
|
21
|
+
`tenantId` | string
|
|
22
|
+
`createdAt` | Date
|
|
23
|
+
`updatedAt` | Date
|
|
24
|
+
`assetS3Url` | string
|
|
25
|
+
`pathPartIdSegments` | Array<string>
|
|
26
|
+
|
|
27
|
+
## Example
|
|
28
|
+
|
|
29
|
+
```typescript
|
|
30
|
+
import type { ChunkBulkResponse } from '@knowledge-stack/ksapi'
|
|
31
|
+
|
|
32
|
+
// TODO: Update the object below with actual values
|
|
33
|
+
const example = {
|
|
34
|
+
"id": null,
|
|
35
|
+
"pathPartId": null,
|
|
36
|
+
"contentId": null,
|
|
37
|
+
"content": null,
|
|
38
|
+
"chunkType": null,
|
|
39
|
+
"chunkMetadata": null,
|
|
40
|
+
"parentPathId": null,
|
|
41
|
+
"prevSiblingPathId": null,
|
|
42
|
+
"nextSiblingPathId": null,
|
|
43
|
+
"materializedPath": null,
|
|
44
|
+
"systemManaged": null,
|
|
45
|
+
"tenantId": null,
|
|
46
|
+
"createdAt": null,
|
|
47
|
+
"updatedAt": null,
|
|
48
|
+
"assetS3Url": null,
|
|
49
|
+
"pathPartIdSegments": null,
|
|
50
|
+
} satisfies ChunkBulkResponse
|
|
51
|
+
|
|
52
|
+
console.log(example)
|
|
53
|
+
|
|
54
|
+
// Convert the instance to a JSON string
|
|
55
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
56
|
+
console.log(exampleJSON)
|
|
57
|
+
|
|
58
|
+
// Parse the JSON string back to an object
|
|
59
|
+
const exampleParsed = JSON.parse(exampleJSON) as ChunkBulkResponse
|
|
60
|
+
console.log(exampleParsed)
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
64
|
+
|
|
65
|
+
|
|
@@ -10,8 +10,10 @@ Name | Type
|
|
|
10
10
|
`query` | string
|
|
11
11
|
`model` | [EmbeddingModel](EmbeddingModel.md)
|
|
12
12
|
`parentPathIds` | Array<string>
|
|
13
|
-
`
|
|
14
|
-
`
|
|
13
|
+
`tagIds` | Array<string>
|
|
14
|
+
`chunkTypes` | [Array<ChunkType>](ChunkType.md)
|
|
15
|
+
`ingestionTimeAfter` | Date
|
|
16
|
+
`activeVersionOnly` | boolean
|
|
15
17
|
`topK` | number
|
|
16
18
|
`scoreThreshold` | number
|
|
17
19
|
|
|
@@ -25,8 +27,10 @@ const example = {
|
|
|
25
27
|
"query": null,
|
|
26
28
|
"model": null,
|
|
27
29
|
"parentPathIds": null,
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
+
"tagIds": null,
|
|
31
|
+
"chunkTypes": null,
|
|
32
|
+
"ingestionTimeAfter": null,
|
|
33
|
+
"activeVersionOnly": null,
|
|
30
34
|
"topK": null,
|
|
31
35
|
"scoreThreshold": null,
|
|
32
36
|
} satisfies ChunkSearchRequest
|
package/docs/ChunksApi.md
CHANGED
|
@@ -7,6 +7,8 @@ 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
|
+
| [**getChunksBulk**](ChunksApi.md#getchunksbulk) | **GET** /v1/chunks/bulk | Get Chunks Bulk Handler |
|
|
11
|
+
| [**getVersionChunkIds**](ChunksApi.md#getversionchunkids) | **GET** /v1/chunks/version-chunk-ids | Get Version Chunk Ids Handler |
|
|
10
12
|
| [**searchChunks**](ChunksApi.md#searchchunks) | **POST** /v1/chunks/search | Search Chunks Handler |
|
|
11
13
|
| [**updateChunkContent**](ChunksApi.md#updatechunkcontentoperation) | **PATCH** /v1/chunks/{chunk_id}/content | Update Chunk Content Handler |
|
|
12
14
|
| [**updateChunkMetadata**](ChunksApi.md#updatechunkmetadataoperation) | **PATCH** /v1/chunks/{chunk_id} | Update Chunk Metadata Handler |
|
|
@@ -226,13 +228,155 @@ No authorization required
|
|
|
226
228
|
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
227
229
|
|
|
228
230
|
|
|
231
|
+
## getChunksBulk
|
|
232
|
+
|
|
233
|
+
> Array<ChunkBulkResponse> getChunksBulk(chunkIds, ksUat)
|
|
234
|
+
|
|
235
|
+
Get Chunks Bulk Handler
|
|
236
|
+
|
|
237
|
+
Batch-fetch chunks with their full ancestor path part IDs. Returns standard chunk data plus path_part_id_segments (the ordered ancestor chain from root to chunk) for each requested chunk. Non-existent IDs are silently skipped. Limited to 200 IDs per call.
|
|
238
|
+
|
|
239
|
+
### Example
|
|
240
|
+
|
|
241
|
+
```ts
|
|
242
|
+
import {
|
|
243
|
+
Configuration,
|
|
244
|
+
ChunksApi,
|
|
245
|
+
} from '@knowledge-stack/ksapi';
|
|
246
|
+
import type { GetChunksBulkRequest } from '@knowledge-stack/ksapi';
|
|
247
|
+
|
|
248
|
+
async function example() {
|
|
249
|
+
console.log("🚀 Testing @knowledge-stack/ksapi SDK...");
|
|
250
|
+
const api = new ChunksApi();
|
|
251
|
+
|
|
252
|
+
const body = {
|
|
253
|
+
// Array<string> | Chunk IDs to resolve (max 200) (optional)
|
|
254
|
+
chunkIds: ...,
|
|
255
|
+
// string (optional)
|
|
256
|
+
ksUat: ksUat_example,
|
|
257
|
+
} satisfies GetChunksBulkRequest;
|
|
258
|
+
|
|
259
|
+
try {
|
|
260
|
+
const data = await api.getChunksBulk(body);
|
|
261
|
+
console.log(data);
|
|
262
|
+
} catch (error) {
|
|
263
|
+
console.error(error);
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
// Run the test
|
|
268
|
+
example().catch(console.error);
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
### Parameters
|
|
272
|
+
|
|
273
|
+
|
|
274
|
+
| Name | Type | Description | Notes |
|
|
275
|
+
|------------- | ------------- | ------------- | -------------|
|
|
276
|
+
| **chunkIds** | `Array<string>` | Chunk IDs to resolve (max 200) | [Optional] |
|
|
277
|
+
| **ksUat** | `string` | | [Optional] [Defaults to `undefined`] |
|
|
278
|
+
|
|
279
|
+
### Return type
|
|
280
|
+
|
|
281
|
+
[**Array<ChunkBulkResponse>**](ChunkBulkResponse.md)
|
|
282
|
+
|
|
283
|
+
### Authorization
|
|
284
|
+
|
|
285
|
+
No authorization required
|
|
286
|
+
|
|
287
|
+
### HTTP request headers
|
|
288
|
+
|
|
289
|
+
- **Content-Type**: Not defined
|
|
290
|
+
- **Accept**: `application/json`
|
|
291
|
+
|
|
292
|
+
|
|
293
|
+
### HTTP response details
|
|
294
|
+
| Status code | Description | Response headers |
|
|
295
|
+
|-------------|-------------|------------------|
|
|
296
|
+
| **200** | Successful Response | - |
|
|
297
|
+
| **422** | Validation Error | - |
|
|
298
|
+
|
|
299
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
300
|
+
|
|
301
|
+
|
|
302
|
+
## getVersionChunkIds
|
|
303
|
+
|
|
304
|
+
> VersionChunkIdsResponse getVersionChunkIds(documentVersionId, ksUat)
|
|
305
|
+
|
|
306
|
+
Get Version Chunk Ids Handler
|
|
307
|
+
|
|
308
|
+
Get all chunk IDs belonging to a document version. Used by the embedding pipeline to discover chunks for a version.
|
|
309
|
+
|
|
310
|
+
### Example
|
|
311
|
+
|
|
312
|
+
```ts
|
|
313
|
+
import {
|
|
314
|
+
Configuration,
|
|
315
|
+
ChunksApi,
|
|
316
|
+
} from '@knowledge-stack/ksapi';
|
|
317
|
+
import type { GetVersionChunkIdsRequest } from '@knowledge-stack/ksapi';
|
|
318
|
+
|
|
319
|
+
async function example() {
|
|
320
|
+
console.log("🚀 Testing @knowledge-stack/ksapi SDK...");
|
|
321
|
+
const api = new ChunksApi();
|
|
322
|
+
|
|
323
|
+
const body = {
|
|
324
|
+
// string | Document version ID
|
|
325
|
+
documentVersionId: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
|
|
326
|
+
// string (optional)
|
|
327
|
+
ksUat: ksUat_example,
|
|
328
|
+
} satisfies GetVersionChunkIdsRequest;
|
|
329
|
+
|
|
330
|
+
try {
|
|
331
|
+
const data = await api.getVersionChunkIds(body);
|
|
332
|
+
console.log(data);
|
|
333
|
+
} catch (error) {
|
|
334
|
+
console.error(error);
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
// Run the test
|
|
339
|
+
example().catch(console.error);
|
|
340
|
+
```
|
|
341
|
+
|
|
342
|
+
### Parameters
|
|
343
|
+
|
|
344
|
+
|
|
345
|
+
| Name | Type | Description | Notes |
|
|
346
|
+
|------------- | ------------- | ------------- | -------------|
|
|
347
|
+
| **documentVersionId** | `string` | Document version ID | [Defaults to `undefined`] |
|
|
348
|
+
| **ksUat** | `string` | | [Optional] [Defaults to `undefined`] |
|
|
349
|
+
|
|
350
|
+
### Return type
|
|
351
|
+
|
|
352
|
+
[**VersionChunkIdsResponse**](VersionChunkIdsResponse.md)
|
|
353
|
+
|
|
354
|
+
### Authorization
|
|
355
|
+
|
|
356
|
+
No authorization required
|
|
357
|
+
|
|
358
|
+
### HTTP request headers
|
|
359
|
+
|
|
360
|
+
- **Content-Type**: Not defined
|
|
361
|
+
- **Accept**: `application/json`
|
|
362
|
+
|
|
363
|
+
|
|
364
|
+
### HTTP response details
|
|
365
|
+
| Status code | Description | Response headers |
|
|
366
|
+
|-------------|-------------|------------------|
|
|
367
|
+
| **200** | Successful Response | - |
|
|
368
|
+
| **422** | Validation Error | - |
|
|
369
|
+
|
|
370
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
371
|
+
|
|
372
|
+
|
|
229
373
|
## searchChunks
|
|
230
374
|
|
|
231
375
|
> Array<ScoredChunkResponse> searchChunks(chunkSearchRequest, ksUat)
|
|
232
376
|
|
|
233
377
|
Search Chunks Handler
|
|
234
378
|
|
|
235
|
-
Semantic search over chunks using vector similarity. Combines vector similarity with path-based authorization and optional metadata filters. Uses
|
|
379
|
+
Semantic search over chunks using Qdrant vector similarity. Combines vector similarity with path-based authorization and optional metadata filters. Uses Qdrant for vector search and hydrates results from Postgres.
|
|
236
380
|
|
|
237
381
|
### Example
|
|
238
382
|
|
package/docs/PathPartsApi.md
CHANGED
|
@@ -7,6 +7,8 @@ All URIs are relative to *http://localhost:8000*
|
|
|
7
7
|
| [**bulkAddPathPartTags**](PathPartsApi.md#bulkaddpathparttags) | **POST** /v1/path-parts/{path_part_id}/tags | Bulk Add Path Part Tags Handler |
|
|
8
8
|
| [**bulkRemovePathPartTags**](PathPartsApi.md#bulkremovepathparttags) | **DELETE** /v1/path-parts/{path_part_id}/tags | Bulk Remove Path Part Tags Handler |
|
|
9
9
|
| [**getPathPart**](PathPartsApi.md#getpathpart) | **GET** /v1/path-parts/{path_part_id} | Get Path Part Handler |
|
|
10
|
+
| [**getPathPartSubtreeChunks**](PathPartsApi.md#getpathpartsubtreechunks) | **GET** /v1/path-parts/{path_part_id}/subtree_chunks | Get Path Part Subtree Chunks Handler |
|
|
11
|
+
| [**getPathPartTags**](PathPartsApi.md#getpathparttags) | **GET** /v1/path-parts/{path_part_id}/tags | Get Path Part Tags Handler |
|
|
10
12
|
| [**listPathParts**](PathPartsApi.md#listpathparts) | **GET** /v1/path-parts | List Path Parts Handler |
|
|
11
13
|
|
|
12
14
|
|
|
@@ -230,6 +232,151 @@ No authorization required
|
|
|
230
232
|
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
231
233
|
|
|
232
234
|
|
|
235
|
+
## getPathPartSubtreeChunks
|
|
236
|
+
|
|
237
|
+
> SubtreeChunksResponse getPathPartSubtreeChunks(pathPartId, ksUat)
|
|
238
|
+
|
|
239
|
+
Get Path Part Subtree Chunks Handler
|
|
240
|
+
|
|
241
|
+
Resolve all descendant chunks for a subtree root. Returns chunks grouped by identical (path_part_ids, tag_ids) tuples.
|
|
242
|
+
|
|
243
|
+
### Example
|
|
244
|
+
|
|
245
|
+
```ts
|
|
246
|
+
import {
|
|
247
|
+
Configuration,
|
|
248
|
+
PathPartsApi,
|
|
249
|
+
} from '@knowledge-stack/ksapi';
|
|
250
|
+
import type { GetPathPartSubtreeChunksRequest } from '@knowledge-stack/ksapi';
|
|
251
|
+
|
|
252
|
+
async function example() {
|
|
253
|
+
console.log("🚀 Testing @knowledge-stack/ksapi SDK...");
|
|
254
|
+
const api = new PathPartsApi();
|
|
255
|
+
|
|
256
|
+
const body = {
|
|
257
|
+
// string
|
|
258
|
+
pathPartId: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
|
|
259
|
+
// string (optional)
|
|
260
|
+
ksUat: ksUat_example,
|
|
261
|
+
} satisfies GetPathPartSubtreeChunksRequest;
|
|
262
|
+
|
|
263
|
+
try {
|
|
264
|
+
const data = await api.getPathPartSubtreeChunks(body);
|
|
265
|
+
console.log(data);
|
|
266
|
+
} catch (error) {
|
|
267
|
+
console.error(error);
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
// Run the test
|
|
272
|
+
example().catch(console.error);
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
### Parameters
|
|
276
|
+
|
|
277
|
+
|
|
278
|
+
| Name | Type | Description | Notes |
|
|
279
|
+
|------------- | ------------- | ------------- | -------------|
|
|
280
|
+
| **pathPartId** | `string` | | [Defaults to `undefined`] |
|
|
281
|
+
| **ksUat** | `string` | | [Optional] [Defaults to `undefined`] |
|
|
282
|
+
|
|
283
|
+
### Return type
|
|
284
|
+
|
|
285
|
+
[**SubtreeChunksResponse**](SubtreeChunksResponse.md)
|
|
286
|
+
|
|
287
|
+
### Authorization
|
|
288
|
+
|
|
289
|
+
No authorization required
|
|
290
|
+
|
|
291
|
+
### HTTP request headers
|
|
292
|
+
|
|
293
|
+
- **Content-Type**: Not defined
|
|
294
|
+
- **Accept**: `application/json`
|
|
295
|
+
|
|
296
|
+
|
|
297
|
+
### HTTP response details
|
|
298
|
+
| Status code | Description | Response headers |
|
|
299
|
+
|-------------|-------------|------------------|
|
|
300
|
+
| **200** | Successful Response | - |
|
|
301
|
+
| **422** | Validation Error | - |
|
|
302
|
+
|
|
303
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
304
|
+
|
|
305
|
+
|
|
306
|
+
## getPathPartTags
|
|
307
|
+
|
|
308
|
+
> PathPartTagsResponse getPathPartTags(pathPartId, includeInherited, ksUat)
|
|
309
|
+
|
|
310
|
+
Get Path Part Tags Handler
|
|
311
|
+
|
|
312
|
+
Get tags for a path part. When include_inherited=False (default), returns only directly-attached tags. When include_inherited=True, walks the ancestor chain and returns the deduplicated union of tags from all ancestors (including the path part itself).
|
|
313
|
+
|
|
314
|
+
### Example
|
|
315
|
+
|
|
316
|
+
```ts
|
|
317
|
+
import {
|
|
318
|
+
Configuration,
|
|
319
|
+
PathPartsApi,
|
|
320
|
+
} from '@knowledge-stack/ksapi';
|
|
321
|
+
import type { GetPathPartTagsRequest } from '@knowledge-stack/ksapi';
|
|
322
|
+
|
|
323
|
+
async function example() {
|
|
324
|
+
console.log("🚀 Testing @knowledge-stack/ksapi SDK...");
|
|
325
|
+
const api = new PathPartsApi();
|
|
326
|
+
|
|
327
|
+
const body = {
|
|
328
|
+
// string
|
|
329
|
+
pathPartId: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
|
|
330
|
+
// boolean | Include tags inherited from ancestor path parts (optional)
|
|
331
|
+
includeInherited: true,
|
|
332
|
+
// string (optional)
|
|
333
|
+
ksUat: ksUat_example,
|
|
334
|
+
} satisfies GetPathPartTagsRequest;
|
|
335
|
+
|
|
336
|
+
try {
|
|
337
|
+
const data = await api.getPathPartTags(body);
|
|
338
|
+
console.log(data);
|
|
339
|
+
} catch (error) {
|
|
340
|
+
console.error(error);
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
// Run the test
|
|
345
|
+
example().catch(console.error);
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
### Parameters
|
|
349
|
+
|
|
350
|
+
|
|
351
|
+
| Name | Type | Description | Notes |
|
|
352
|
+
|------------- | ------------- | ------------- | -------------|
|
|
353
|
+
| **pathPartId** | `string` | | [Defaults to `undefined`] |
|
|
354
|
+
| **includeInherited** | `boolean` | Include tags inherited from ancestor path parts | [Optional] [Defaults to `false`] |
|
|
355
|
+
| **ksUat** | `string` | | [Optional] [Defaults to `undefined`] |
|
|
356
|
+
|
|
357
|
+
### Return type
|
|
358
|
+
|
|
359
|
+
[**PathPartTagsResponse**](PathPartTagsResponse.md)
|
|
360
|
+
|
|
361
|
+
### Authorization
|
|
362
|
+
|
|
363
|
+
No authorization required
|
|
364
|
+
|
|
365
|
+
### HTTP request headers
|
|
366
|
+
|
|
367
|
+
- **Content-Type**: Not defined
|
|
368
|
+
- **Accept**: `application/json`
|
|
369
|
+
|
|
370
|
+
|
|
371
|
+
### HTTP response details
|
|
372
|
+
| Status code | Description | Response headers |
|
|
373
|
+
|-------------|-------------|------------------|
|
|
374
|
+
| **200** | Successful Response | - |
|
|
375
|
+
| **422** | Validation Error | - |
|
|
376
|
+
|
|
377
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
378
|
+
|
|
379
|
+
|
|
233
380
|
## listPathParts
|
|
234
381
|
|
|
235
382
|
> PaginatedResponsePathPartResponse listPathParts(parentPathId, maxDepth, sortOrder, limit, offset, ksUat)
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
|
|
2
|
+
# SubtreeChunkGroup
|
|
3
|
+
|
|
4
|
+
A group of chunks sharing identical path_part_ids and tag_ids. Used by PathPartCRUDService.resolve_subtree_chunks to batch downstream Qdrant set_payload calls.
|
|
5
|
+
|
|
6
|
+
## Properties
|
|
7
|
+
|
|
8
|
+
Name | Type
|
|
9
|
+
------------ | -------------
|
|
10
|
+
`chunkIds` | Array<string>
|
|
11
|
+
`pathPartIds` | Array<string>
|
|
12
|
+
`tagIds` | Array<string>
|
|
13
|
+
|
|
14
|
+
## Example
|
|
15
|
+
|
|
16
|
+
```typescript
|
|
17
|
+
import type { SubtreeChunkGroup } from '@knowledge-stack/ksapi'
|
|
18
|
+
|
|
19
|
+
// TODO: Update the object below with actual values
|
|
20
|
+
const example = {
|
|
21
|
+
"chunkIds": null,
|
|
22
|
+
"pathPartIds": null,
|
|
23
|
+
"tagIds": null,
|
|
24
|
+
} satisfies SubtreeChunkGroup
|
|
25
|
+
|
|
26
|
+
console.log(example)
|
|
27
|
+
|
|
28
|
+
// Convert the instance to a JSON string
|
|
29
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
30
|
+
console.log(exampleJSON)
|
|
31
|
+
|
|
32
|
+
// Parse the JSON string back to an object
|
|
33
|
+
const exampleParsed = JSON.parse(exampleJSON) as SubtreeChunkGroup
|
|
34
|
+
console.log(exampleParsed)
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
38
|
+
|
|
39
|
+
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
|
|
2
|
+
# SubtreeChunksResponse
|
|
3
|
+
|
|
4
|
+
Response for subtree resolution.
|
|
5
|
+
|
|
6
|
+
## Properties
|
|
7
|
+
|
|
8
|
+
Name | Type
|
|
9
|
+
------------ | -------------
|
|
10
|
+
`groups` | [Array<SubtreeChunkGroup>](SubtreeChunkGroup.md)
|
|
11
|
+
|
|
12
|
+
## Example
|
|
13
|
+
|
|
14
|
+
```typescript
|
|
15
|
+
import type { SubtreeChunksResponse } from '@knowledge-stack/ksapi'
|
|
16
|
+
|
|
17
|
+
// TODO: Update the object below with actual values
|
|
18
|
+
const example = {
|
|
19
|
+
"groups": null,
|
|
20
|
+
} satisfies SubtreeChunksResponse
|
|
21
|
+
|
|
22
|
+
console.log(example)
|
|
23
|
+
|
|
24
|
+
// Convert the instance to a JSON string
|
|
25
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
26
|
+
console.log(exampleJSON)
|
|
27
|
+
|
|
28
|
+
// Parse the JSON string back to an object
|
|
29
|
+
const exampleParsed = JSON.parse(exampleJSON) as SubtreeChunksResponse
|
|
30
|
+
console.log(exampleParsed)
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
34
|
+
|
|
35
|
+
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
|
|
2
|
+
# VersionChunkIdsResponse
|
|
3
|
+
|
|
4
|
+
Response containing chunk IDs for a document version.
|
|
5
|
+
|
|
6
|
+
## Properties
|
|
7
|
+
|
|
8
|
+
Name | Type
|
|
9
|
+
------------ | -------------
|
|
10
|
+
`chunkIds` | Array<string>
|
|
11
|
+
|
|
12
|
+
## Example
|
|
13
|
+
|
|
14
|
+
```typescript
|
|
15
|
+
import type { VersionChunkIdsResponse } from '@knowledge-stack/ksapi'
|
|
16
|
+
|
|
17
|
+
// TODO: Update the object below with actual values
|
|
18
|
+
const example = {
|
|
19
|
+
"chunkIds": null,
|
|
20
|
+
} satisfies VersionChunkIdsResponse
|
|
21
|
+
|
|
22
|
+
console.log(example)
|
|
23
|
+
|
|
24
|
+
// Convert the instance to a JSON string
|
|
25
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
26
|
+
console.log(exampleJSON)
|
|
27
|
+
|
|
28
|
+
// Parse the JSON string back to an object
|
|
29
|
+
const exampleParsed = JSON.parse(exampleJSON) as VersionChunkIdsResponse
|
|
30
|
+
console.log(exampleParsed)
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
34
|
+
|
|
35
|
+
|