@knowledge-stack/ksapi 1.13.0 → 1.14.0
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 +3 -0
- package/README.md +2 -2
- package/dist/apis/ChunksApi.d.ts +30 -1
- package/dist/apis/ChunksApi.js +33 -0
- package/dist/esm/apis/ChunksApi.d.ts +30 -1
- package/dist/esm/apis/ChunksApi.js +34 -1
- package/dist/esm/models/ChunkSearchRequest.d.ts +89 -0
- package/dist/esm/models/ChunkSearchRequest.js +69 -0
- package/dist/esm/models/EmbeddingModel.d.ts +24 -0
- package/dist/esm/models/EmbeddingModel.js +42 -0
- package/dist/esm/models/ScoredChunkResponse.d.ts +127 -0
- package/dist/esm/models/ScoredChunkResponse.js +94 -0
- package/dist/esm/models/index.d.ts +3 -0
- package/dist/esm/models/index.js +3 -0
- package/dist/models/ChunkSearchRequest.d.ts +89 -0
- package/dist/models/ChunkSearchRequest.js +77 -0
- package/dist/models/EmbeddingModel.d.ts +24 -0
- package/dist/models/EmbeddingModel.js +50 -0
- package/dist/models/ScoredChunkResponse.d.ts +127 -0
- package/dist/models/ScoredChunkResponse.js +102 -0
- package/dist/models/index.d.ts +3 -0
- package/dist/models/index.js +3 -0
- package/package.json +1 -1
- package/src/apis/ChunksApi.ts +69 -0
- package/src/models/ChunkSearchRequest.ts +160 -0
- package/src/models/EmbeddingModel.ts +52 -0
- package/src/models/ScoredChunkResponse.ts +215 -0
- package/src/models/index.ts +3 -0
package/.openapi-generator/FILES
CHANGED
|
@@ -25,6 +25,7 @@ src/models/ChunkLineageResponse.ts
|
|
|
25
25
|
src/models/ChunkMetadataInput.ts
|
|
26
26
|
src/models/ChunkMetadataOutput.ts
|
|
27
27
|
src/models/ChunkResponse.ts
|
|
28
|
+
src/models/ChunkSearchRequest.ts
|
|
28
29
|
src/models/ChunkType.ts
|
|
29
30
|
src/models/CreateChunkLineageRequest.ts
|
|
30
31
|
src/models/CreateChunkRequest.ts
|
|
@@ -44,6 +45,7 @@ src/models/DocumentType.ts
|
|
|
44
45
|
src/models/DocumentVersionResponse.ts
|
|
45
46
|
src/models/EmailSentResponse.ts
|
|
46
47
|
src/models/EmailVerificationRequest.ts
|
|
48
|
+
src/models/EmbeddingModel.ts
|
|
47
49
|
src/models/FolderDocumentResponse.ts
|
|
48
50
|
src/models/FolderResponse.ts
|
|
49
51
|
src/models/HTTPValidationError.ts
|
|
@@ -80,6 +82,7 @@ src/models/PermissionResponse.ts
|
|
|
80
82
|
src/models/Polygon.ts
|
|
81
83
|
src/models/PolygonReference.ts
|
|
82
84
|
src/models/RootResponse.ts
|
|
85
|
+
src/models/ScoredChunkResponse.ts
|
|
83
86
|
src/models/SectionResponse.ts
|
|
84
87
|
src/models/SignInRequest.ts
|
|
85
88
|
src/models/TagPathPartRequest.ts
|
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
## @knowledge-stack/ksapi@1.
|
|
1
|
+
## @knowledge-stack/ksapi@1.14.0
|
|
2
2
|
|
|
3
3
|
This generator creates TypeScript/JavaScript client that utilizes [Fetch API](https://fetch.spec.whatwg.org/). The generated Node module can be used in the following environments:
|
|
4
4
|
|
|
@@ -36,7 +36,7 @@ navigate to the folder of your consuming project and run one of the following co
|
|
|
36
36
|
_published:_
|
|
37
37
|
|
|
38
38
|
```
|
|
39
|
-
npm install @knowledge-stack/ksapi@1.
|
|
39
|
+
npm install @knowledge-stack/ksapi@1.14.0 --save
|
|
40
40
|
```
|
|
41
41
|
|
|
42
42
|
_unPublished (not recommended):_
|
package/dist/apis/ChunksApi.d.ts
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
12
|
import * as runtime from '../runtime';
|
|
13
|
-
import type { ChunkResponse, CreateChunkRequest, UpdateChunkContentRequest, UpdateChunkMetadataRequest } from '../models/index';
|
|
13
|
+
import type { ChunkResponse, ChunkSearchRequest, CreateChunkRequest, ScoredChunkResponse, UpdateChunkContentRequest, UpdateChunkMetadataRequest } from '../models/index';
|
|
14
14
|
export interface CreateChunkOperationRequest {
|
|
15
15
|
createChunkRequest: CreateChunkRequest;
|
|
16
16
|
ksUat?: string;
|
|
@@ -23,6 +23,10 @@ export interface GetChunkRequest {
|
|
|
23
23
|
chunkId: string;
|
|
24
24
|
ksUat?: string;
|
|
25
25
|
}
|
|
26
|
+
export interface SearchChunksRequest {
|
|
27
|
+
chunkSearchRequest: ChunkSearchRequest;
|
|
28
|
+
ksUat?: string;
|
|
29
|
+
}
|
|
26
30
|
export interface UpdateChunkContentOperationRequest {
|
|
27
31
|
chunkId: string;
|
|
28
32
|
updateChunkContentRequest: UpdateChunkContentRequest;
|
|
@@ -85,6 +89,21 @@ export interface ChunksApiInterface {
|
|
|
85
89
|
* Get Chunk Handler
|
|
86
90
|
*/
|
|
87
91
|
getChunk(requestParameters: GetChunkRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ChunkResponse>;
|
|
92
|
+
/**
|
|
93
|
+
* Semantic search over chunks using vector similarity. Combines pgvector cosine similarity with path-based authorization and optional metadata filters. Uses a two-session design to avoid holding a DB connection during the external embedding API call.
|
|
94
|
+
* @summary Search Chunks Handler
|
|
95
|
+
* @param {ChunkSearchRequest} chunkSearchRequest
|
|
96
|
+
* @param {string} [ksUat]
|
|
97
|
+
* @param {*} [options] Override http request option.
|
|
98
|
+
* @throws {RequiredError}
|
|
99
|
+
* @memberof ChunksApiInterface
|
|
100
|
+
*/
|
|
101
|
+
searchChunksRaw(requestParameters: SearchChunksRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<ScoredChunkResponse>>>;
|
|
102
|
+
/**
|
|
103
|
+
* Semantic search over chunks using vector similarity. Combines pgvector cosine similarity with path-based authorization and optional metadata filters. Uses a two-session design to avoid holding a DB connection during the external embedding API call.
|
|
104
|
+
* Search Chunks Handler
|
|
105
|
+
*/
|
|
106
|
+
searchChunks(requestParameters: SearchChunksRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<ScoredChunkResponse>>;
|
|
88
107
|
/**
|
|
89
108
|
* Update chunk content by creating a new content row. The old content row is preserved (not deleted). If the new content matches an existing content hash, it will be deduplicated.
|
|
90
109
|
* @summary Update Chunk Content Handler
|
|
@@ -152,6 +171,16 @@ export declare class ChunksApi extends runtime.BaseAPI implements ChunksApiInter
|
|
|
152
171
|
* Get Chunk Handler
|
|
153
172
|
*/
|
|
154
173
|
getChunk(requestParameters: GetChunkRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ChunkResponse>;
|
|
174
|
+
/**
|
|
175
|
+
* Semantic search over chunks using vector similarity. Combines pgvector cosine similarity with path-based authorization and optional metadata filters. Uses a two-session design to avoid holding a DB connection during the external embedding API call.
|
|
176
|
+
* Search Chunks Handler
|
|
177
|
+
*/
|
|
178
|
+
searchChunksRaw(requestParameters: SearchChunksRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<ScoredChunkResponse>>>;
|
|
179
|
+
/**
|
|
180
|
+
* Semantic search over chunks using vector similarity. Combines pgvector cosine similarity with path-based authorization and optional metadata filters. Uses a two-session design to avoid holding a DB connection during the external embedding API call.
|
|
181
|
+
* Search Chunks Handler
|
|
182
|
+
*/
|
|
183
|
+
searchChunks(requestParameters: SearchChunksRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<ScoredChunkResponse>>;
|
|
155
184
|
/**
|
|
156
185
|
* Update chunk content by creating a new content row. The old content row is preserved (not deleted). If the new content matches an existing content hash, it will be deduplicated.
|
|
157
186
|
* Update Chunk Content Handler
|
package/dist/apis/ChunksApi.js
CHANGED
|
@@ -125,6 +125,39 @@ class ChunksApi extends runtime.BaseAPI {
|
|
|
125
125
|
return yield response.value();
|
|
126
126
|
});
|
|
127
127
|
}
|
|
128
|
+
/**
|
|
129
|
+
* Semantic search over chunks using vector similarity. Combines pgvector cosine similarity with path-based authorization and optional metadata filters. Uses a two-session design to avoid holding a DB connection during the external embedding API call.
|
|
130
|
+
* Search Chunks Handler
|
|
131
|
+
*/
|
|
132
|
+
searchChunksRaw(requestParameters, initOverrides) {
|
|
133
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
134
|
+
if (requestParameters['chunkSearchRequest'] == null) {
|
|
135
|
+
throw new runtime.RequiredError('chunkSearchRequest', 'Required parameter "chunkSearchRequest" was null or undefined when calling searchChunks().');
|
|
136
|
+
}
|
|
137
|
+
const queryParameters = {};
|
|
138
|
+
const headerParameters = {};
|
|
139
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
140
|
+
let urlPath = `/v1/chunks/search`;
|
|
141
|
+
const response = yield this.request({
|
|
142
|
+
path: urlPath,
|
|
143
|
+
method: 'POST',
|
|
144
|
+
headers: headerParameters,
|
|
145
|
+
query: queryParameters,
|
|
146
|
+
body: (0, index_1.ChunkSearchRequestToJSON)(requestParameters['chunkSearchRequest']),
|
|
147
|
+
}, initOverrides);
|
|
148
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(index_1.ScoredChunkResponseFromJSON));
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Semantic search over chunks using vector similarity. Combines pgvector cosine similarity with path-based authorization and optional metadata filters. Uses a two-session design to avoid holding a DB connection during the external embedding API call.
|
|
153
|
+
* Search Chunks Handler
|
|
154
|
+
*/
|
|
155
|
+
searchChunks(requestParameters, initOverrides) {
|
|
156
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
157
|
+
const response = yield this.searchChunksRaw(requestParameters, initOverrides);
|
|
158
|
+
return yield response.value();
|
|
159
|
+
});
|
|
160
|
+
}
|
|
128
161
|
/**
|
|
129
162
|
* Update chunk content by creating a new content row. The old content row is preserved (not deleted). If the new content matches an existing content hash, it will be deduplicated.
|
|
130
163
|
* Update Chunk Content Handler
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
12
|
import * as runtime from '../runtime';
|
|
13
|
-
import type { ChunkResponse, CreateChunkRequest, UpdateChunkContentRequest, UpdateChunkMetadataRequest } from '../models/index';
|
|
13
|
+
import type { ChunkResponse, ChunkSearchRequest, CreateChunkRequest, ScoredChunkResponse, UpdateChunkContentRequest, UpdateChunkMetadataRequest } from '../models/index';
|
|
14
14
|
export interface CreateChunkOperationRequest {
|
|
15
15
|
createChunkRequest: CreateChunkRequest;
|
|
16
16
|
ksUat?: string;
|
|
@@ -23,6 +23,10 @@ export interface GetChunkRequest {
|
|
|
23
23
|
chunkId: string;
|
|
24
24
|
ksUat?: string;
|
|
25
25
|
}
|
|
26
|
+
export interface SearchChunksRequest {
|
|
27
|
+
chunkSearchRequest: ChunkSearchRequest;
|
|
28
|
+
ksUat?: string;
|
|
29
|
+
}
|
|
26
30
|
export interface UpdateChunkContentOperationRequest {
|
|
27
31
|
chunkId: string;
|
|
28
32
|
updateChunkContentRequest: UpdateChunkContentRequest;
|
|
@@ -85,6 +89,21 @@ export interface ChunksApiInterface {
|
|
|
85
89
|
* Get Chunk Handler
|
|
86
90
|
*/
|
|
87
91
|
getChunk(requestParameters: GetChunkRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ChunkResponse>;
|
|
92
|
+
/**
|
|
93
|
+
* Semantic search over chunks using vector similarity. Combines pgvector cosine similarity with path-based authorization and optional metadata filters. Uses a two-session design to avoid holding a DB connection during the external embedding API call.
|
|
94
|
+
* @summary Search Chunks Handler
|
|
95
|
+
* @param {ChunkSearchRequest} chunkSearchRequest
|
|
96
|
+
* @param {string} [ksUat]
|
|
97
|
+
* @param {*} [options] Override http request option.
|
|
98
|
+
* @throws {RequiredError}
|
|
99
|
+
* @memberof ChunksApiInterface
|
|
100
|
+
*/
|
|
101
|
+
searchChunksRaw(requestParameters: SearchChunksRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<ScoredChunkResponse>>>;
|
|
102
|
+
/**
|
|
103
|
+
* Semantic search over chunks using vector similarity. Combines pgvector cosine similarity with path-based authorization and optional metadata filters. Uses a two-session design to avoid holding a DB connection during the external embedding API call.
|
|
104
|
+
* Search Chunks Handler
|
|
105
|
+
*/
|
|
106
|
+
searchChunks(requestParameters: SearchChunksRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<ScoredChunkResponse>>;
|
|
88
107
|
/**
|
|
89
108
|
* Update chunk content by creating a new content row. The old content row is preserved (not deleted). If the new content matches an existing content hash, it will be deduplicated.
|
|
90
109
|
* @summary Update Chunk Content Handler
|
|
@@ -152,6 +171,16 @@ export declare class ChunksApi extends runtime.BaseAPI implements ChunksApiInter
|
|
|
152
171
|
* Get Chunk Handler
|
|
153
172
|
*/
|
|
154
173
|
getChunk(requestParameters: GetChunkRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ChunkResponse>;
|
|
174
|
+
/**
|
|
175
|
+
* Semantic search over chunks using vector similarity. Combines pgvector cosine similarity with path-based authorization and optional metadata filters. Uses a two-session design to avoid holding a DB connection during the external embedding API call.
|
|
176
|
+
* Search Chunks Handler
|
|
177
|
+
*/
|
|
178
|
+
searchChunksRaw(requestParameters: SearchChunksRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<ScoredChunkResponse>>>;
|
|
179
|
+
/**
|
|
180
|
+
* Semantic search over chunks using vector similarity. Combines pgvector cosine similarity with path-based authorization and optional metadata filters. Uses a two-session design to avoid holding a DB connection during the external embedding API call.
|
|
181
|
+
* Search Chunks Handler
|
|
182
|
+
*/
|
|
183
|
+
searchChunks(requestParameters: SearchChunksRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<ScoredChunkResponse>>;
|
|
155
184
|
/**
|
|
156
185
|
* Update chunk content by creating a new content row. The old content row is preserved (not deleted). If the new content matches an existing content hash, it will be deduplicated.
|
|
157
186
|
* Update Chunk Content Handler
|
|
@@ -21,7 +21,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
21
21
|
});
|
|
22
22
|
};
|
|
23
23
|
import * as runtime from '../runtime';
|
|
24
|
-
import { ChunkResponseFromJSON, CreateChunkRequestToJSON, UpdateChunkContentRequestToJSON, UpdateChunkMetadataRequestToJSON, } from '../models/index';
|
|
24
|
+
import { ChunkResponseFromJSON, ChunkSearchRequestToJSON, CreateChunkRequestToJSON, ScoredChunkResponseFromJSON, UpdateChunkContentRequestToJSON, UpdateChunkMetadataRequestToJSON, } from '../models/index';
|
|
25
25
|
/**
|
|
26
26
|
*
|
|
27
27
|
*/
|
|
@@ -122,6 +122,39 @@ export class ChunksApi extends runtime.BaseAPI {
|
|
|
122
122
|
return yield response.value();
|
|
123
123
|
});
|
|
124
124
|
}
|
|
125
|
+
/**
|
|
126
|
+
* Semantic search over chunks using vector similarity. Combines pgvector cosine similarity with path-based authorization and optional metadata filters. Uses a two-session design to avoid holding a DB connection during the external embedding API call.
|
|
127
|
+
* Search Chunks Handler
|
|
128
|
+
*/
|
|
129
|
+
searchChunksRaw(requestParameters, initOverrides) {
|
|
130
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
131
|
+
if (requestParameters['chunkSearchRequest'] == null) {
|
|
132
|
+
throw new runtime.RequiredError('chunkSearchRequest', 'Required parameter "chunkSearchRequest" was null or undefined when calling searchChunks().');
|
|
133
|
+
}
|
|
134
|
+
const queryParameters = {};
|
|
135
|
+
const headerParameters = {};
|
|
136
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
137
|
+
let urlPath = `/v1/chunks/search`;
|
|
138
|
+
const response = yield this.request({
|
|
139
|
+
path: urlPath,
|
|
140
|
+
method: 'POST',
|
|
141
|
+
headers: headerParameters,
|
|
142
|
+
query: queryParameters,
|
|
143
|
+
body: ChunkSearchRequestToJSON(requestParameters['chunkSearchRequest']),
|
|
144
|
+
}, initOverrides);
|
|
145
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(ScoredChunkResponseFromJSON));
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Semantic search over chunks using vector similarity. Combines pgvector cosine similarity with path-based authorization and optional metadata filters. Uses a two-session design to avoid holding a DB connection during the external embedding API call.
|
|
150
|
+
* Search Chunks Handler
|
|
151
|
+
*/
|
|
152
|
+
searchChunks(requestParameters, initOverrides) {
|
|
153
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
154
|
+
const response = yield this.searchChunksRaw(requestParameters, initOverrides);
|
|
155
|
+
return yield response.value();
|
|
156
|
+
});
|
|
157
|
+
}
|
|
125
158
|
/**
|
|
126
159
|
* Update chunk content by creating a new content row. The old content row is preserved (not deleted). If the new content matches an existing content hash, it will be deduplicated.
|
|
127
160
|
* Update Chunk Content Handler
|
|
@@ -0,0 +1,89 @@
|
|
|
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
|
+
import type { EmbeddingModel } from './EmbeddingModel';
|
|
13
|
+
import type { ChunkType } from './ChunkType';
|
|
14
|
+
/**
|
|
15
|
+
* Request body for semantic chunk search.
|
|
16
|
+
* @export
|
|
17
|
+
* @interface ChunkSearchRequest
|
|
18
|
+
*/
|
|
19
|
+
export interface ChunkSearchRequest {
|
|
20
|
+
/**
|
|
21
|
+
* Search query text
|
|
22
|
+
* @type {string}
|
|
23
|
+
* @memberof ChunkSearchRequest
|
|
24
|
+
*/
|
|
25
|
+
query: string;
|
|
26
|
+
/**
|
|
27
|
+
* Embedding model to use
|
|
28
|
+
* @type {EmbeddingModel}
|
|
29
|
+
* @memberof ChunkSearchRequest
|
|
30
|
+
*/
|
|
31
|
+
model?: EmbeddingModel;
|
|
32
|
+
/**
|
|
33
|
+
* Path part IDs to search within (non-CHUNK types). Defaults to tenant's /KS_ROOT/shared.
|
|
34
|
+
* @type {Array<string>}
|
|
35
|
+
* @memberof ChunkSearchRequest
|
|
36
|
+
*/
|
|
37
|
+
parentPathIds?: Array<string>;
|
|
38
|
+
/**
|
|
39
|
+
* Filter by chunk type (TEXT, TABLE, IMAGE, UNKNOWN)
|
|
40
|
+
* @type {ChunkType}
|
|
41
|
+
* @memberof ChunkSearchRequest
|
|
42
|
+
*/
|
|
43
|
+
chunkType?: ChunkType;
|
|
44
|
+
/**
|
|
45
|
+
* Only chunks updated after this timestamp
|
|
46
|
+
* @type {Date}
|
|
47
|
+
* @memberof ChunkSearchRequest
|
|
48
|
+
*/
|
|
49
|
+
updatedAt?: Date;
|
|
50
|
+
/**
|
|
51
|
+
* Number of results (1-50)
|
|
52
|
+
* @type {number}
|
|
53
|
+
* @memberof ChunkSearchRequest
|
|
54
|
+
*/
|
|
55
|
+
topK?: number;
|
|
56
|
+
/**
|
|
57
|
+
* Minimum similarity score
|
|
58
|
+
* @type {number}
|
|
59
|
+
* @memberof ChunkSearchRequest
|
|
60
|
+
*/
|
|
61
|
+
scoreThreshold?: number;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Check if a given object implements the ChunkSearchRequest interface.
|
|
65
|
+
*/
|
|
66
|
+
export declare function instanceOfChunkSearchRequest(value: object): value is ChunkSearchRequest;
|
|
67
|
+
export declare function ChunkSearchRequestFromJSON(json: any): ChunkSearchRequest;
|
|
68
|
+
export declare function ChunkSearchRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): ChunkSearchRequest;
|
|
69
|
+
export declare function ChunkSearchRequestToJSON(json: any): ChunkSearchRequest;
|
|
70
|
+
export declare function ChunkSearchRequestToJSONTyped(value?: ChunkSearchRequest | null, ignoreDiscriminator?: boolean): any;
|
|
71
|
+
export declare const ChunkSearchRequestPropertyValidationAttributesMap: {
|
|
72
|
+
[property: string]: {
|
|
73
|
+
maxLength?: number;
|
|
74
|
+
minLength?: number;
|
|
75
|
+
pattern?: string;
|
|
76
|
+
maximum?: number;
|
|
77
|
+
exclusiveMaximum?: boolean;
|
|
78
|
+
minimum?: number;
|
|
79
|
+
exclusiveMinimum?: boolean;
|
|
80
|
+
multipleOf?: number;
|
|
81
|
+
maxItems?: number;
|
|
82
|
+
minItems?: number;
|
|
83
|
+
uniqueItems?: boolean;
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
export declare const ChunkSearchRequestAdditionalPropertiesValidationAttributes: {
|
|
87
|
+
maxProperties?: number;
|
|
88
|
+
minProperties?: number;
|
|
89
|
+
};
|
|
@@ -0,0 +1,69 @@
|
|
|
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
|
+
import { EmbeddingModelFromJSON, EmbeddingModelToJSON, } from './EmbeddingModel';
|
|
15
|
+
import { ChunkTypeFromJSON, ChunkTypeToJSON, } from './ChunkType';
|
|
16
|
+
/**
|
|
17
|
+
* Check if a given object implements the ChunkSearchRequest interface.
|
|
18
|
+
*/
|
|
19
|
+
export function instanceOfChunkSearchRequest(value) {
|
|
20
|
+
if (!('query' in value) || value['query'] === undefined)
|
|
21
|
+
return false;
|
|
22
|
+
return true;
|
|
23
|
+
}
|
|
24
|
+
export function ChunkSearchRequestFromJSON(json) {
|
|
25
|
+
return ChunkSearchRequestFromJSONTyped(json, false);
|
|
26
|
+
}
|
|
27
|
+
export function ChunkSearchRequestFromJSONTyped(json, ignoreDiscriminator) {
|
|
28
|
+
if (json == null) {
|
|
29
|
+
return json;
|
|
30
|
+
}
|
|
31
|
+
return {
|
|
32
|
+
'query': json['query'],
|
|
33
|
+
'model': json['model'] == null ? undefined : EmbeddingModelFromJSON(json['model']),
|
|
34
|
+
'parentPathIds': json['parent_path_ids'] == null ? undefined : json['parent_path_ids'],
|
|
35
|
+
'chunkType': json['chunk_type'] == null ? undefined : ChunkTypeFromJSON(json['chunk_type']),
|
|
36
|
+
'updatedAt': json['updated_at'] == null ? undefined : (new Date(json['updated_at'])),
|
|
37
|
+
'topK': json['top_k'] == null ? undefined : json['top_k'],
|
|
38
|
+
'scoreThreshold': json['score_threshold'] == null ? undefined : json['score_threshold'],
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
export function ChunkSearchRequestToJSON(json) {
|
|
42
|
+
return ChunkSearchRequestToJSONTyped(json, false);
|
|
43
|
+
}
|
|
44
|
+
export function ChunkSearchRequestToJSONTyped(value, ignoreDiscriminator = false) {
|
|
45
|
+
if (value == null) {
|
|
46
|
+
return value;
|
|
47
|
+
}
|
|
48
|
+
return {
|
|
49
|
+
'query': value['query'],
|
|
50
|
+
'model': EmbeddingModelToJSON(value['model']),
|
|
51
|
+
'parent_path_ids': value['parentPathIds'],
|
|
52
|
+
'chunk_type': ChunkTypeToJSON(value['chunkType']),
|
|
53
|
+
'updated_at': value['updatedAt'] == null ? value['updatedAt'] : value['updatedAt'].toISOString(),
|
|
54
|
+
'top_k': value['topK'],
|
|
55
|
+
'score_threshold': value['scoreThreshold'],
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
export const ChunkSearchRequestPropertyValidationAttributesMap = {
|
|
59
|
+
query: {
|
|
60
|
+
minLength: 1,
|
|
61
|
+
},
|
|
62
|
+
topK: {
|
|
63
|
+
maximum: 50,
|
|
64
|
+
exclusiveMaximum: false,
|
|
65
|
+
minimum: 1,
|
|
66
|
+
exclusiveMinimum: false,
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
export const ChunkSearchRequestAdditionalPropertiesValidationAttributes = {};
|
|
@@ -0,0 +1,24 @@
|
|
|
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
|
+
* Supported embedding models.
|
|
14
|
+
* @export
|
|
15
|
+
*/
|
|
16
|
+
export declare const EmbeddingModel: {
|
|
17
|
+
readonly TextEmbedding3Small: "text-embedding-3-small";
|
|
18
|
+
};
|
|
19
|
+
export type EmbeddingModel = typeof EmbeddingModel[keyof typeof EmbeddingModel];
|
|
20
|
+
export declare function instanceOfEmbeddingModel(value: any): boolean;
|
|
21
|
+
export declare function EmbeddingModelFromJSON(json: any): EmbeddingModel;
|
|
22
|
+
export declare function EmbeddingModelFromJSONTyped(json: any, ignoreDiscriminator: boolean): EmbeddingModel;
|
|
23
|
+
export declare function EmbeddingModelToJSON(value?: EmbeddingModel | null): any;
|
|
24
|
+
export declare function EmbeddingModelToJSONTyped(value: any, ignoreDiscriminator: boolean): EmbeddingModel;
|
|
@@ -0,0 +1,42 @@
|
|
|
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
|
+
* Supported embedding models.
|
|
16
|
+
* @export
|
|
17
|
+
*/
|
|
18
|
+
export const EmbeddingModel = {
|
|
19
|
+
TextEmbedding3Small: 'text-embedding-3-small'
|
|
20
|
+
};
|
|
21
|
+
export function instanceOfEmbeddingModel(value) {
|
|
22
|
+
for (const key in EmbeddingModel) {
|
|
23
|
+
if (Object.prototype.hasOwnProperty.call(EmbeddingModel, key)) {
|
|
24
|
+
if (EmbeddingModel[key] === value) {
|
|
25
|
+
return true;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
export function EmbeddingModelFromJSON(json) {
|
|
32
|
+
return EmbeddingModelFromJSONTyped(json, false);
|
|
33
|
+
}
|
|
34
|
+
export function EmbeddingModelFromJSONTyped(json, ignoreDiscriminator) {
|
|
35
|
+
return json;
|
|
36
|
+
}
|
|
37
|
+
export function EmbeddingModelToJSON(value) {
|
|
38
|
+
return value;
|
|
39
|
+
}
|
|
40
|
+
export function EmbeddingModelToJSONTyped(value, ignoreDiscriminator) {
|
|
41
|
+
return value;
|
|
42
|
+
}
|
|
@@ -0,0 +1,127 @@
|
|
|
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
|
+
import type { ChunkMetadataOutput } from './ChunkMetadataOutput';
|
|
13
|
+
import type { ChunkType } from './ChunkType';
|
|
14
|
+
/**
|
|
15
|
+
* Chunk response with similarity score.
|
|
16
|
+
* @export
|
|
17
|
+
* @interface ScoredChunkResponse
|
|
18
|
+
*/
|
|
19
|
+
export interface ScoredChunkResponse {
|
|
20
|
+
/**
|
|
21
|
+
* Chunk ID
|
|
22
|
+
* @type {string}
|
|
23
|
+
* @memberof ScoredChunkResponse
|
|
24
|
+
*/
|
|
25
|
+
id: string;
|
|
26
|
+
/**
|
|
27
|
+
* PathPart ID
|
|
28
|
+
* @type {string}
|
|
29
|
+
* @memberof ScoredChunkResponse
|
|
30
|
+
*/
|
|
31
|
+
pathPartId: string;
|
|
32
|
+
/**
|
|
33
|
+
* ChunkContent ID
|
|
34
|
+
* @type {string}
|
|
35
|
+
* @memberof ScoredChunkResponse
|
|
36
|
+
*/
|
|
37
|
+
contentId: string;
|
|
38
|
+
/**
|
|
39
|
+
* Chunk text content
|
|
40
|
+
* @type {string}
|
|
41
|
+
* @memberof ScoredChunkResponse
|
|
42
|
+
*/
|
|
43
|
+
content: string;
|
|
44
|
+
/**
|
|
45
|
+
* Type of chunk content
|
|
46
|
+
* @type {ChunkType}
|
|
47
|
+
* @memberof ScoredChunkResponse
|
|
48
|
+
*/
|
|
49
|
+
chunkType: ChunkType;
|
|
50
|
+
/**
|
|
51
|
+
* Chunk metadata
|
|
52
|
+
* @type {ChunkMetadataOutput}
|
|
53
|
+
* @memberof ScoredChunkResponse
|
|
54
|
+
*/
|
|
55
|
+
chunkMetadata: ChunkMetadataOutput;
|
|
56
|
+
/**
|
|
57
|
+
* Parent PathPart ID
|
|
58
|
+
* @type {string}
|
|
59
|
+
* @memberof ScoredChunkResponse
|
|
60
|
+
*/
|
|
61
|
+
parentId: string;
|
|
62
|
+
/**
|
|
63
|
+
* Previous sibling PathPart ID
|
|
64
|
+
* @type {string}
|
|
65
|
+
* @memberof ScoredChunkResponse
|
|
66
|
+
*/
|
|
67
|
+
prevSiblingPathId?: string;
|
|
68
|
+
/**
|
|
69
|
+
* Next sibling PathPart ID
|
|
70
|
+
* @type {string}
|
|
71
|
+
* @memberof ScoredChunkResponse
|
|
72
|
+
*/
|
|
73
|
+
nextSiblingId?: string;
|
|
74
|
+
/**
|
|
75
|
+
* Full materialized path from root
|
|
76
|
+
* @type {string}
|
|
77
|
+
* @memberof ScoredChunkResponse
|
|
78
|
+
*/
|
|
79
|
+
materializedPath: string;
|
|
80
|
+
/**
|
|
81
|
+
* Tenant ID
|
|
82
|
+
* @type {string}
|
|
83
|
+
* @memberof ScoredChunkResponse
|
|
84
|
+
*/
|
|
85
|
+
tenantId: string;
|
|
86
|
+
/**
|
|
87
|
+
* Creation timestamp
|
|
88
|
+
* @type {Date}
|
|
89
|
+
* @memberof ScoredChunkResponse
|
|
90
|
+
*/
|
|
91
|
+
createdAt: Date;
|
|
92
|
+
/**
|
|
93
|
+
* Last update timestamp
|
|
94
|
+
* @type {Date}
|
|
95
|
+
* @memberof ScoredChunkResponse
|
|
96
|
+
*/
|
|
97
|
+
updatedAt: Date;
|
|
98
|
+
/**
|
|
99
|
+
* Cosine similarity score (1 - cosine_distance)
|
|
100
|
+
* @type {number}
|
|
101
|
+
* @memberof ScoredChunkResponse
|
|
102
|
+
*/
|
|
103
|
+
score: number;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Check if a given object implements the ScoredChunkResponse interface.
|
|
107
|
+
*/
|
|
108
|
+
export declare function instanceOfScoredChunkResponse(value: object): value is ScoredChunkResponse;
|
|
109
|
+
export declare function ScoredChunkResponseFromJSON(json: any): ScoredChunkResponse;
|
|
110
|
+
export declare function ScoredChunkResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): ScoredChunkResponse;
|
|
111
|
+
export declare function ScoredChunkResponseToJSON(json: any): ScoredChunkResponse;
|
|
112
|
+
export declare function ScoredChunkResponseToJSONTyped(value?: ScoredChunkResponse | null, ignoreDiscriminator?: boolean): any;
|
|
113
|
+
export declare const ScoredChunkResponsePropertyValidationAttributesMap: {
|
|
114
|
+
[property: string]: {
|
|
115
|
+
maxLength?: number;
|
|
116
|
+
minLength?: number;
|
|
117
|
+
pattern?: string;
|
|
118
|
+
maximum?: number;
|
|
119
|
+
exclusiveMaximum?: boolean;
|
|
120
|
+
minimum?: number;
|
|
121
|
+
exclusiveMinimum?: boolean;
|
|
122
|
+
multipleOf?: number;
|
|
123
|
+
maxItems?: number;
|
|
124
|
+
minItems?: number;
|
|
125
|
+
uniqueItems?: boolean;
|
|
126
|
+
};
|
|
127
|
+
};
|