@petercatai/whisker-client 0.0.1760329074-dev

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.
Files changed (3) hide show
  1. package/dist/api.d.ts +3795 -0
  2. package/dist/api.js +882 -0
  3. package/package.json +23 -0
package/dist/api.js ADDED
@@ -0,0 +1,882 @@
1
+ "use strict";
2
+ /* eslint-disable */
3
+ /* tslint:disable */
4
+ // @ts-nocheck
5
+ /*
6
+ * ---------------------------------------------------------------
7
+ * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
8
+ * ## ##
9
+ * ## AUTHOR: acacode ##
10
+ * ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
11
+ * ---------------------------------------------------------------
12
+ */
13
+ var __rest = (this && this.__rest) || function (s, e) {
14
+ var t = {};
15
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
16
+ t[p] = s[p];
17
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
18
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
19
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
20
+ t[p[i]] = s[p[i]];
21
+ }
22
+ return t;
23
+ };
24
+ Object.defineProperty(exports, "__esModule", { value: true });
25
+ exports.Api = exports.HttpClient = exports.ContentType = exports.IAction = exports.IEmbeddingModelEnum = exports.IKnowledgeSourceEnum = exports.IKnowledgeTypeEnum = exports.ILanguage = exports.IOperator = exports.IResource = exports.ITagObjectType = exports.ITaskStatus = void 0;
26
+ /** TaskStatus */
27
+ var ITaskStatus;
28
+ (function (ITaskStatus) {
29
+ ITaskStatus["Pending"] = "pending";
30
+ ITaskStatus["Running"] = "running";
31
+ ITaskStatus["Success"] = "success";
32
+ ITaskStatus["Failed"] = "failed";
33
+ ITaskStatus["Skipped"] = "skipped";
34
+ ITaskStatus["Canceled"] = "canceled";
35
+ ITaskStatus["PendingRetry"] = "pending_retry";
36
+ ITaskStatus["Deleted"] = "deleted";
37
+ })(ITaskStatus || (exports.ITaskStatus = ITaskStatus = {}));
38
+ /**
39
+ * TagObjectType
40
+ * 可打标签的对象类型。
41
+ */
42
+ var ITagObjectType;
43
+ (function (ITagObjectType) {
44
+ ITagObjectType["Space"] = "space";
45
+ ITagObjectType["Knowledge"] = "knowledge";
46
+ })(ITagObjectType || (exports.ITagObjectType = ITagObjectType = {}));
47
+ /** Resource */
48
+ var IResource;
49
+ (function (IResource) {
50
+ IResource["Retrieval"] = "retrieval";
51
+ IResource["Tenant"] = "tenant";
52
+ IResource["Space"] = "space";
53
+ IResource["Knowledge"] = "knowledge";
54
+ IResource["Chunk"] = "chunk";
55
+ IResource["ApiKey"] = "api_key";
56
+ IResource["Task"] = "task";
57
+ IResource["Rule"] = "rule";
58
+ IResource["Public"] = "public";
59
+ IResource["Webhook"] = "webhook";
60
+ IResource["Tag"] = "tag";
61
+ IResource["Tagging"] = "tagging";
62
+ IResource["Artifact"] = "artifact";
63
+ })(IResource || (exports.IResource = IResource = {}));
64
+ /** Operator */
65
+ var IOperator;
66
+ (function (IOperator) {
67
+ IOperator["And"] = "and";
68
+ IOperator["Or"] = "or";
69
+ })(IOperator || (exports.IOperator = IOperator = {}));
70
+ /**
71
+ * Language
72
+ * Enum of the programming languages.
73
+ */
74
+ var ILanguage;
75
+ (function (ILanguage) {
76
+ ILanguage["Cpp"] = "cpp";
77
+ ILanguage["Go"] = "go";
78
+ ILanguage["Java"] = "java";
79
+ ILanguage["Kotlin"] = "kotlin";
80
+ ILanguage["Js"] = "js";
81
+ ILanguage["Ts"] = "ts";
82
+ ILanguage["Php"] = "php";
83
+ ILanguage["Proto"] = "proto";
84
+ ILanguage["Python"] = "python";
85
+ ILanguage["Rst"] = "rst";
86
+ ILanguage["Ruby"] = "ruby";
87
+ ILanguage["Rust"] = "rust";
88
+ ILanguage["Scala"] = "scala";
89
+ ILanguage["Swift"] = "swift";
90
+ ILanguage["Markdown"] = "markdown";
91
+ ILanguage["Latex"] = "latex";
92
+ ILanguage["Html"] = "html";
93
+ ILanguage["Sol"] = "sol";
94
+ ILanguage["Csharp"] = "csharp";
95
+ ILanguage["Cobol"] = "cobol";
96
+ ILanguage["C"] = "c";
97
+ ILanguage["Lua"] = "lua";
98
+ ILanguage["Perl"] = "perl";
99
+ ILanguage["Haskell"] = "haskell";
100
+ ILanguage["Elixir"] = "elixir";
101
+ ILanguage["Powershell"] = "powershell";
102
+ ILanguage["Visualbasic6"] = "visualbasic6";
103
+ })(ILanguage || (exports.ILanguage = ILanguage = {}));
104
+ /**
105
+ * KnowledgeTypeEnum
106
+ * mime type of the knowledge. The type is used to determine how to process the knowledge and
107
+ * is also used to determine the type of the knowledge resource.
108
+ * different types of knowledge will be processed differently and have different load、split configurations.
109
+ * For example, text will be processed by splitter, while code will be processed by language parser.
110
+ */
111
+ var IKnowledgeTypeEnum;
112
+ (function (IKnowledgeTypeEnum) {
113
+ IKnowledgeTypeEnum["Text"] = "text";
114
+ IKnowledgeTypeEnum["Image"] = "image";
115
+ IKnowledgeTypeEnum["Markdown"] = "markdown";
116
+ IKnowledgeTypeEnum["Latex"] = "latex";
117
+ IKnowledgeTypeEnum["Json"] = "json";
118
+ IKnowledgeTypeEnum["Docx"] = "docx";
119
+ IKnowledgeTypeEnum["Pdf"] = "pdf";
120
+ IKnowledgeTypeEnum["Qa"] = "qa";
121
+ IKnowledgeTypeEnum["Yuquedoc"] = "yuquedoc";
122
+ IKnowledgeTypeEnum["YuqueBook"] = "yuque_book";
123
+ IKnowledgeTypeEnum["GithubRepo"] = "github_repo";
124
+ IKnowledgeTypeEnum["Cpp"] = "cpp";
125
+ IKnowledgeTypeEnum["Go"] = "go";
126
+ IKnowledgeTypeEnum["Java"] = "java";
127
+ IKnowledgeTypeEnum["Kotlin"] = "kotlin";
128
+ IKnowledgeTypeEnum["Js"] = "js";
129
+ IKnowledgeTypeEnum["Ts"] = "ts";
130
+ IKnowledgeTypeEnum["Php"] = "php";
131
+ IKnowledgeTypeEnum["Proto"] = "proto";
132
+ IKnowledgeTypeEnum["Python"] = "python";
133
+ IKnowledgeTypeEnum["Rst"] = "rst";
134
+ IKnowledgeTypeEnum["Ruby"] = "ruby";
135
+ IKnowledgeTypeEnum["Rust"] = "rust";
136
+ IKnowledgeTypeEnum["Scala"] = "scala";
137
+ IKnowledgeTypeEnum["Swift"] = "swift";
138
+ IKnowledgeTypeEnum["Html"] = "html";
139
+ IKnowledgeTypeEnum["Sol"] = "sol";
140
+ IKnowledgeTypeEnum["Csharp"] = "csharp";
141
+ IKnowledgeTypeEnum["Cobol"] = "cobol";
142
+ IKnowledgeTypeEnum["C"] = "c";
143
+ IKnowledgeTypeEnum["Lua"] = "lua";
144
+ IKnowledgeTypeEnum["Perl"] = "perl";
145
+ IKnowledgeTypeEnum["Haskell"] = "haskell";
146
+ IKnowledgeTypeEnum["Elixir"] = "elixir";
147
+ IKnowledgeTypeEnum["Powershell"] = "powershell";
148
+ })(IKnowledgeTypeEnum || (exports.IKnowledgeTypeEnum = IKnowledgeTypeEnum = {}));
149
+ /**
150
+ * KnowledgeSourceEnum
151
+ * Specifies the source of knowledge, which influences the behavior of the resource loader
152
+ */
153
+ var IKnowledgeSourceEnum;
154
+ (function (IKnowledgeSourceEnum) {
155
+ IKnowledgeSourceEnum["GithubRepo"] = "github_repo";
156
+ IKnowledgeSourceEnum["GithubFile"] = "github_file";
157
+ IKnowledgeSourceEnum["UserInputText"] = "user_input_text";
158
+ IKnowledgeSourceEnum["CloudStorageText"] = "cloud_storage_text";
159
+ IKnowledgeSourceEnum["CloudStorageImage"] = "cloud_storage_image";
160
+ IKnowledgeSourceEnum["Yuque"] = "yuque";
161
+ })(IKnowledgeSourceEnum || (exports.IKnowledgeSourceEnum = IKnowledgeSourceEnum = {}));
162
+ /** EmbeddingModelEnum */
163
+ var IEmbeddingModelEnum;
164
+ (function (IEmbeddingModelEnum) {
165
+ IEmbeddingModelEnum["Openai"] = "openai";
166
+ IEmbeddingModelEnum["SentenceTransformersAllMiniLML6V2"] = "sentence-transformers/all-MiniLM-L6-v2";
167
+ IEmbeddingModelEnum["SentenceTransformersAllMpnetBaseV2"] = "sentence-transformers/all-mpnet-base-v2";
168
+ IEmbeddingModelEnum["SentenceTransformersParaphraseMultilingualMiniLML12V2"] = "sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2";
169
+ IEmbeddingModelEnum["Shibing624Text2VecBaseChinese"] = "shibing624/text2vec-base-chinese";
170
+ })(IEmbeddingModelEnum || (exports.IEmbeddingModelEnum = IEmbeddingModelEnum = {}));
171
+ /** Action */
172
+ var IAction;
173
+ (function (IAction) {
174
+ IAction["Create"] = "create";
175
+ IAction["Read"] = "read";
176
+ IAction["Update"] = "update";
177
+ IAction["Delete"] = "delete";
178
+ IAction["Value"] = "*";
179
+ })(IAction || (exports.IAction = IAction = {}));
180
+ var ContentType;
181
+ (function (ContentType) {
182
+ ContentType["Json"] = "application/json";
183
+ ContentType["JsonApi"] = "application/vnd.api+json";
184
+ ContentType["FormData"] = "multipart/form-data";
185
+ ContentType["UrlEncoded"] = "application/x-www-form-urlencoded";
186
+ ContentType["Text"] = "text/plain";
187
+ })(ContentType || (exports.ContentType = ContentType = {}));
188
+ class HttpClient {
189
+ constructor(apiConfig = {}) {
190
+ this.baseUrl = "";
191
+ this.securityData = null;
192
+ this.abortControllers = new Map();
193
+ this.customFetch = (...fetchParams) => fetch(...fetchParams);
194
+ this.baseApiParams = {
195
+ credentials: "same-origin",
196
+ headers: {},
197
+ redirect: "follow",
198
+ referrerPolicy: "no-referrer",
199
+ };
200
+ this.setSecurityData = (data) => {
201
+ this.securityData = data;
202
+ };
203
+ this.contentFormatters = {
204
+ [ContentType.Json]: (input) => input !== null && (typeof input === "object" || typeof input === "string")
205
+ ? JSON.stringify(input)
206
+ : input,
207
+ [ContentType.JsonApi]: (input) => input !== null && (typeof input === "object" || typeof input === "string")
208
+ ? JSON.stringify(input)
209
+ : input,
210
+ [ContentType.Text]: (input) => input !== null && typeof input !== "string"
211
+ ? JSON.stringify(input)
212
+ : input,
213
+ [ContentType.FormData]: (input) => {
214
+ if (input instanceof FormData) {
215
+ return input;
216
+ }
217
+ return Object.keys(input || {}).reduce((formData, key) => {
218
+ const property = input[key];
219
+ formData.append(key, property instanceof Blob
220
+ ? property
221
+ : typeof property === "object" && property !== null
222
+ ? JSON.stringify(property)
223
+ : `${property}`);
224
+ return formData;
225
+ }, new FormData());
226
+ },
227
+ [ContentType.UrlEncoded]: (input) => this.toQueryString(input),
228
+ };
229
+ this.createAbortSignal = (cancelToken) => {
230
+ if (this.abortControllers.has(cancelToken)) {
231
+ const abortController = this.abortControllers.get(cancelToken);
232
+ if (abortController) {
233
+ return abortController.signal;
234
+ }
235
+ return void 0;
236
+ }
237
+ const abortController = new AbortController();
238
+ this.abortControllers.set(cancelToken, abortController);
239
+ return abortController.signal;
240
+ };
241
+ this.abortRequest = (cancelToken) => {
242
+ const abortController = this.abortControllers.get(cancelToken);
243
+ if (abortController) {
244
+ abortController.abort();
245
+ this.abortControllers.delete(cancelToken);
246
+ }
247
+ };
248
+ this.request = async (_a) => {
249
+ var { body, secure, path, type, query, format, baseUrl, cancelToken } = _a, params = __rest(_a, ["body", "secure", "path", "type", "query", "format", "baseUrl", "cancelToken"]);
250
+ const secureParams = ((typeof secure === "boolean" ? secure : this.baseApiParams.secure) &&
251
+ this.securityWorker &&
252
+ (await this.securityWorker(this.securityData))) ||
253
+ {};
254
+ const requestParams = this.mergeRequestParams(params, secureParams);
255
+ const queryString = query && this.toQueryString(query);
256
+ const payloadFormatter = this.contentFormatters[type || ContentType.Json];
257
+ const responseFormat = format || requestParams.format;
258
+ return this.customFetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, Object.assign(Object.assign({}, requestParams), { headers: Object.assign(Object.assign({}, (requestParams.headers || {})), (type && type !== ContentType.FormData
259
+ ? { "Content-Type": type }
260
+ : {})), signal: (cancelToken
261
+ ? this.createAbortSignal(cancelToken)
262
+ : requestParams.signal) || null, body: typeof body === "undefined" || body === null
263
+ ? null
264
+ : payloadFormatter(body) })).then(async (response) => {
265
+ const r = response;
266
+ r.data = null;
267
+ r.error = null;
268
+ const responseToParse = responseFormat ? response.clone() : response;
269
+ const data = !responseFormat
270
+ ? r
271
+ : await responseToParse[responseFormat]()
272
+ .then((data) => {
273
+ if (r.ok) {
274
+ r.data = data;
275
+ }
276
+ else {
277
+ r.error = data;
278
+ }
279
+ return r;
280
+ })
281
+ .catch((e) => {
282
+ r.error = e;
283
+ return r;
284
+ });
285
+ if (cancelToken) {
286
+ this.abortControllers.delete(cancelToken);
287
+ }
288
+ if (!response.ok)
289
+ throw data;
290
+ return data;
291
+ });
292
+ };
293
+ Object.assign(this, apiConfig);
294
+ }
295
+ encodeQueryParam(key, value) {
296
+ const encodedKey = encodeURIComponent(key);
297
+ return `${encodedKey}=${encodeURIComponent(typeof value === "number" ? value : `${value}`)}`;
298
+ }
299
+ addQueryParam(query, key) {
300
+ return this.encodeQueryParam(key, query[key]);
301
+ }
302
+ addArrayQueryParam(query, key) {
303
+ const value = query[key];
304
+ return value.map((v) => this.encodeQueryParam(key, v)).join("&");
305
+ }
306
+ toQueryString(rawQuery) {
307
+ const query = rawQuery || {};
308
+ const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]);
309
+ return keys
310
+ .map((key) => Array.isArray(query[key])
311
+ ? this.addArrayQueryParam(query, key)
312
+ : this.addQueryParam(query, key))
313
+ .join("&");
314
+ }
315
+ addQueryParams(rawQuery) {
316
+ const queryString = this.toQueryString(rawQuery);
317
+ return queryString ? `?${queryString}` : "";
318
+ }
319
+ mergeRequestParams(params1, params2) {
320
+ return Object.assign(Object.assign(Object.assign(Object.assign({}, this.baseApiParams), params1), (params2 || {})), { headers: Object.assign(Object.assign(Object.assign({}, (this.baseApiParams.headers || {})), (params1.headers || {})), ((params2 && params2.headers) || {})) });
321
+ }
322
+ }
323
+ exports.HttpClient = HttpClient;
324
+ /**
325
+ * @title whisker rag server
326
+ * @version 1.0.6
327
+ */
328
+ class Api extends HttpClient {
329
+ constructor() {
330
+ super(...arguments);
331
+ /**
332
+ * No description
333
+ *
334
+ * @name HomePageGet
335
+ * @summary Home Page
336
+ * @request GET:/
337
+ */
338
+ this.homePageGet = (params = {}) => this.request(Object.assign({ path: `/`, method: "GET", format: "json" }, params));
339
+ this.knowledge = {
340
+ /**
341
+ * @description Duplicate file_sha entries are prohibited. Any modifications to split_config or embedding model_name parameters must be performed using dedicated API endpoints."
342
+ *
343
+ * @tags knowledge
344
+ * @name AddKnowledge
345
+ * @summary Add Knowledge
346
+ * @request POST:/api/knowledge/add
347
+ */
348
+ addKnowledge: (data, params = {}) => this.request(Object.assign({ path: `/api/knowledge/add`, method: "POST", body: data, type: ContentType.Json, format: "json" }, params)),
349
+ /**
350
+ * No description
351
+ *
352
+ * @tags knowledge
353
+ * @name UpdateKnowledge
354
+ * @summary Update Knowledge
355
+ * @request POST:/api/knowledge/update
356
+ */
357
+ updateKnowledge: (data, params = {}) => this.request(Object.assign({ path: `/api/knowledge/update`, method: "POST", body: data, type: ContentType.Json, format: "json" }, params)),
358
+ /**
359
+ * No description
360
+ *
361
+ * @tags knowledge
362
+ * @name UpdateKnowledgeEnableStatus
363
+ * @summary Update Knowledge Enable Status
364
+ * @request POST:/api/knowledge/update/enabled
365
+ */
366
+ updateKnowledgeEnableStatus: (data, params = {}) => this.request(Object.assign({ path: `/api/knowledge/update/enabled`, method: "POST", body: data, type: ContentType.Json, format: "json" }, params)),
367
+ /**
368
+ * No description
369
+ *
370
+ * @tags knowledge
371
+ * @name GetKnowledgeList
372
+ * @summary Get Knowledge List
373
+ * @request POST:/api/knowledge/list
374
+ */
375
+ getKnowledgeList: (data, params = {}) => this.request(Object.assign({ path: `/api/knowledge/list`, method: "POST", body: data, type: ContentType.Json, format: "json" }, params)),
376
+ /**
377
+ * No description
378
+ *
379
+ * @tags knowledge
380
+ * @name GetKnowledgeById
381
+ * @summary Get Knowledge By Id
382
+ * @request GET:/api/knowledge/detail
383
+ */
384
+ getKnowledgeById: (query, params = {}) => this.request(Object.assign({ path: `/api/knowledge/detail`, method: "GET", query: query, format: "json" }, params)),
385
+ /**
386
+ * @description Deletes a knowledge entry by its ID.
387
+ *
388
+ * @tags knowledge
389
+ * @name DeleteKnowledge
390
+ * @summary Delete Knowledge
391
+ * @request DELETE:/api/knowledge/delete
392
+ */
393
+ deleteKnowledge: (query, params = {}) => this.request(Object.assign({ path: `/api/knowledge/delete`, method: "DELETE", query: query, format: "json" }, params)),
394
+ /**
395
+ * No description
396
+ *
397
+ * @tags knowledge
398
+ * @name GetEmbeddingModelsList
399
+ * @summary Get Embedding Models List
400
+ * @request GET:/api/knowledge/embedding/models
401
+ */
402
+ getEmbeddingModelsList: (params = {}) => this.request(Object.assign({ path: `/api/knowledge/embedding/models`, method: "GET", format: "json" }, params)),
403
+ /**
404
+ * @description 处理不同类型的webhook:knowledge, deployment, notification等
405
+ *
406
+ * @tags knowledge
407
+ * @name HandleWebhookApiKnowledgeWebhookTypeSourceAuthInfoKnowledgeBaseIdPost
408
+ * @summary 通用webhook处理器
409
+ * @request POST:/api/knowledge/{webhook_type}/{source}/{auth_info}/{knowledge_base_id}
410
+ */
411
+ handleWebhookApiKnowledgeWebhookTypeSourceAuthInfoKnowledgeBaseIdPost: (webhookType, source, authInfo, knowledgeBaseId, data, params = {}) => this.request(Object.assign({ path: `/api/knowledge/${webhookType}/${source}/${authInfo}/${knowledgeBaseId}`, method: "POST", body: data, type: ContentType.Json, format: "json" }, params)),
412
+ };
413
+ this.retrieval = {
414
+ /**
415
+ * @description Retrieve certain chunks within a knowledge_id, for example, within a specific PDF file.
416
+ *
417
+ * @tags retrieval
418
+ * @name RetrieveKnowledgeContent
419
+ * @summary Retrieve Knowledge Content
420
+ * @request POST:/api/retrieval/knowledge
421
+ */
422
+ retrieveKnowledgeContent: (data, params = {}) => this.request(Object.assign({ path: `/api/retrieval/knowledge`, method: "POST", body: data, type: ContentType.Json, format: "json" }, params)),
423
+ /**
424
+ * @description Retrieve chunks within a space_id, for example, given a petercat bot_id, retrieve all chunks under that bot_id.
425
+ *
426
+ * @tags retrieval
427
+ * @name RetrieveSpaceContent
428
+ * @summary Retrieve Space Content
429
+ * @request POST:/api/retrieval/space
430
+ */
431
+ retrieveSpaceContent: (data, params = {}) => this.request(Object.assign({ path: `/api/retrieval/space`, method: "POST", body: data, type: ContentType.Json, format: "json" }, params)),
432
+ /**
433
+ * @description Retrieve chunks within a space_id, for example, given a petercat bot_id, retrieve all chunks under that bot_id.
434
+ *
435
+ * @tags retrieval
436
+ * @name Retrieve
437
+ * @summary Retrieve
438
+ * @request POST:/api/retrieval/
439
+ */
440
+ retrieve: (data, params = {}) => this.request(Object.assign({ path: `/api/retrieval/`, method: "POST", body: data, type: ContentType.Json, format: "json" }, params)),
441
+ };
442
+ this.task = {
443
+ /**
444
+ * No description
445
+ *
446
+ * @tags task
447
+ * @name RestartTask
448
+ * @summary Restart Task
449
+ * @request POST:/api/task/restart
450
+ */
451
+ restartTask: (data, params = {}) => this.request(Object.assign({ path: `/api/task/restart`, method: "POST", body: data, type: ContentType.Json, format: "json" }, params)),
452
+ /**
453
+ * No description
454
+ *
455
+ * @tags task
456
+ * @name CancelTask
457
+ * @summary Cancel Task
458
+ * @request POST:/api/task/cancel
459
+ */
460
+ cancelTask: (data, params = {}) => this.request(Object.assign({ path: `/api/task/cancel`, method: "POST", body: data, type: ContentType.Json, format: "json" }, params)),
461
+ /**
462
+ * No description
463
+ *
464
+ * @tags task
465
+ * @name GetTaskList
466
+ * @summary Get Task List
467
+ * @request POST:/api/task/list
468
+ */
469
+ getTaskList: (data, params = {}) => this.request(Object.assign({ path: `/api/task/list`, method: "POST", body: data, type: ContentType.Json, format: "json" }, params)),
470
+ /**
471
+ * No description
472
+ *
473
+ * @tags task
474
+ * @name GetTaskDetail
475
+ * @summary Get Task Detail
476
+ * @request GET:/api/task/detail
477
+ */
478
+ getTaskDetail: (query, params = {}) => this.request(Object.assign({ path: `/api/task/detail`, method: "GET", query: query, format: "json" }, params)),
479
+ /**
480
+ * No description
481
+ *
482
+ * @tags task
483
+ * @name DeleteTaskById
484
+ * @summary Delete Task By Id
485
+ * @request DELETE:/api/task/delete
486
+ */
487
+ deleteTaskById: (query, params = {}) => this.request(Object.assign({ path: `/api/task/delete`, method: "DELETE", query: query, format: "json" }, params)),
488
+ };
489
+ this.chunk = {
490
+ /**
491
+ * No description
492
+ *
493
+ * @tags chunk
494
+ * @name GetChunkList
495
+ * @summary Get Chunk List
496
+ * @request POST:/api/chunk/list
497
+ */
498
+ getChunkList: (data, params = {}) => this.request(Object.assign({ path: `/api/chunk/list`, method: "POST", body: data, type: ContentType.Json, format: "json" }, params)),
499
+ /**
500
+ * No description
501
+ *
502
+ * @tags chunk
503
+ * @name DeleteChunkById
504
+ * @summary Delete Chunk By Id
505
+ * @request DELETE:/api/chunk/id/{id}/model_name/{model_name}
506
+ */
507
+ deleteChunkById: (id, modelName, params = {}) => this.request(Object.assign({ path: `/api/chunk/id/${id}/model_name/${modelName}`, method: "DELETE", format: "json" }, params)),
508
+ /**
509
+ * No description
510
+ *
511
+ * @tags chunk
512
+ * @name GetChunkById
513
+ * @summary Get Chunk By Id
514
+ * @request GET:/api/chunk/id/{id}/model_name/{model_name}
515
+ */
516
+ getChunkById: (id, modelName, params = {}) => this.request(Object.assign({ path: `/api/chunk/id/${id}/model_name/${modelName}`, method: "GET", format: "json" }, params)),
517
+ /**
518
+ * No description
519
+ *
520
+ * @tags chunk
521
+ * @name AddChunk
522
+ * @summary Add Chunk
523
+ * @request POST:/api/chunk/add
524
+ */
525
+ addChunk: (data, params = {}) => this.request(Object.assign({ path: `/api/chunk/add`, method: "POST", body: data, type: ContentType.Json, format: "json" }, params)),
526
+ /**
527
+ * No description
528
+ *
529
+ * @tags chunk
530
+ * @name UpdateChunk
531
+ * @summary Update Chunk
532
+ * @request POST:/api/chunk/update
533
+ */
534
+ updateChunk: (data, params = {}) => this.request(Object.assign({ path: `/api/chunk/update`, method: "POST", body: data, type: ContentType.Json, format: "json" }, params)),
535
+ };
536
+ this.tenant = {
537
+ /**
538
+ * No description
539
+ *
540
+ * @tags tenant
541
+ * @name CreateTenant
542
+ * @summary Create Tenant
543
+ * @request POST:/api/tenant/create
544
+ */
545
+ createTenant: (data, params = {}) => this.request(Object.assign({ path: `/api/tenant/create`, method: "POST", body: data, type: ContentType.Json, format: "json" }, params)),
546
+ /**
547
+ * No description
548
+ *
549
+ * @tags tenant
550
+ * @name GetTenantById
551
+ * @summary Query Tenant
552
+ * @request GET:/api/tenant/id/{id}
553
+ */
554
+ getTenantById: (id, params = {}) => this.request(Object.assign({ path: `/api/tenant/id/${id}`, method: "GET", format: "json" }, params)),
555
+ /**
556
+ * No description
557
+ *
558
+ * @tags tenant
559
+ * @name DeleteTenantById
560
+ * @summary Delete Tenant
561
+ * @request DELETE:/api/tenant/{id}
562
+ */
563
+ deleteTenantById: (id, params = {}) => this.request(Object.assign({ path: `/api/tenant/${id}`, method: "DELETE", format: "json" }, params)),
564
+ /**
565
+ * No description
566
+ *
567
+ * @tags tenant
568
+ * @name UpdateTenant
569
+ * @summary Update Tenant
570
+ * @request POST:/api/tenant/update
571
+ */
572
+ updateTenant: (data, params = {}) => this.request(Object.assign({ path: `/api/tenant/update`, method: "POST", body: data, type: ContentType.Json, format: "json" }, params)),
573
+ /**
574
+ * No description
575
+ *
576
+ * @tags tenant
577
+ * @name GetTenantList
578
+ * @summary Get Tenant List
579
+ * @request GET:/api/tenant/list
580
+ */
581
+ getTenantList: (query, params = {}) => this.request(Object.assign({ path: `/api/tenant/list`, method: "GET", query: query, format: "json" }, params)),
582
+ /**
583
+ * No description
584
+ *
585
+ * @tags tenant
586
+ * @name GetTenant
587
+ * @summary Get Tenant
588
+ * @request GET:/api/tenant/me
589
+ */
590
+ getTenant: (params = {}) => this.request(Object.assign({ path: `/api/tenant/me`, method: "GET", format: "json" }, params)),
591
+ };
592
+ this.space = {
593
+ /**
594
+ * No description
595
+ *
596
+ * @tags space
597
+ * @name GetSpaceList
598
+ * @summary Get Space List
599
+ * @request POST:/api/space/list
600
+ */
601
+ getSpaceList: (data, params = {}) => this.request(Object.assign({ path: `/api/space/list`, method: "POST", body: data, type: ContentType.Json, format: "json" }, params)),
602
+ /**
603
+ * No description
604
+ *
605
+ * @tags space
606
+ * @name AddSpace
607
+ * @summary Add Space
608
+ * @request POST:/api/space/add
609
+ */
610
+ addSpace: (data, params = {}) => this.request(Object.assign({ path: `/api/space/add`, method: "POST", body: data, type: ContentType.Json, format: "json" }, params)),
611
+ /**
612
+ * No description
613
+ *
614
+ * @tags space
615
+ * @name DeleteSpace
616
+ * @summary Delete Space
617
+ * @request DELETE:/api/space/{space_id}
618
+ */
619
+ deleteSpace: (spaceId, params = {}) => this.request(Object.assign({ path: `/api/space/${spaceId}`, method: "DELETE", format: "json" }, params)),
620
+ /**
621
+ * No description
622
+ *
623
+ * @tags space
624
+ * @name UpdateSpace
625
+ * @summary Update Space
626
+ * @request PUT:/api/space/{space_id}
627
+ */
628
+ updateSpace: (spaceId, data, params = {}) => this.request(Object.assign({ path: `/api/space/${spaceId}`, method: "PUT", body: data, type: ContentType.Json, format: "json" }, params)),
629
+ /**
630
+ * No description
631
+ *
632
+ * @tags space
633
+ * @name GetSpaceById
634
+ * @summary Get Space By Id
635
+ * @request GET:/api/space/{space_id}
636
+ */
637
+ getSpaceById: (spaceId, params = {}) => this.request(Object.assign({ path: `/api/space/${spaceId}`, method: "GET", format: "json" }, params)),
638
+ };
639
+ this.v1 = {
640
+ /**
641
+ * No description
642
+ *
643
+ * @tags dashboard
644
+ * @name GetGlobalInfo
645
+ * @summary Get System Global Info
646
+ * @request GET:/api/v1/dashboard/global_info
647
+ */
648
+ getGlobalInfo: (params = {}) => this.request(Object.assign({ path: `/api/v1/dashboard/global_info`, method: "GET", format: "json" }, params)),
649
+ /**
650
+ * No description
651
+ *
652
+ * @tags dashboard
653
+ * @name GetTenantLog
654
+ * @summary Get Tenant Log
655
+ * @request GET:/api/v1/dashboard/tenant_log
656
+ */
657
+ getTenantLog: (data, params = {}) => this.request(Object.assign({ path: `/api/v1/dashboard/tenant_log`, method: "GET", body: data, type: ContentType.Json, format: "json" }, params)),
658
+ /**
659
+ * No description
660
+ *
661
+ * @tags agent
662
+ * @name ProResearchApiV1AgentProResearchPost
663
+ * @summary Pro Research
664
+ * @request POST:/api/v1/agent/pro_research
665
+ */
666
+ proResearchApiV1AgentProResearchPost: (data, params = {}) => this.request(Object.assign({ path: `/api/v1/agent/pro_research`, method: "POST", body: data, type: ContentType.Json, format: "json" }, params)),
667
+ /**
668
+ * @description whisker 通用 webhook
669
+ *
670
+ * @tags webhook
671
+ * @name HandleWebhookApiV1WebhookWebhookTypeSourceAuthInfoKnowledgeBaseIdPost
672
+ * @summary 通用webhook处理器
673
+ * @request POST:/api/v1/webhook/{webhook_type}/{source}/{auth_info}/{knowledge_base_id}
674
+ */
675
+ handleWebhookApiV1WebhookWebhookTypeSourceAuthInfoKnowledgeBaseIdPost: (webhookType, source, authInfo, knowledgeBaseId, data, params = {}) => this.request(Object.assign({ path: `/api/v1/webhook/${webhookType}/${source}/${authInfo}/${knowledgeBaseId}`, method: "POST", body: data, type: ContentType.Json, format: "json" }, params)),
676
+ /**
677
+ * No description
678
+ *
679
+ * @tags tagging
680
+ * @name GetTaggingList
681
+ * @summary Get Tagging List
682
+ * @request POST:/api/v1/tagging/list
683
+ */
684
+ getTaggingList: (data, params = {}) => this.request(Object.assign({ path: `/api/v1/tagging/list`, method: "POST", body: data, type: ContentType.Json, format: "json" }, params)),
685
+ /**
686
+ * No description
687
+ *
688
+ * @tags tagging
689
+ * @name AddTaggingList
690
+ * @summary Add Tagging List
691
+ * @request POST:/api/v1/tagging/add_list
692
+ */
693
+ addTaggingList: (data, params = {}) => this.request(Object.assign({ path: `/api/v1/tagging/add_list`, method: "POST", body: data, type: ContentType.Json, format: "json" }, params)),
694
+ /**
695
+ * No description
696
+ *
697
+ * @tags tagging
698
+ * @name DeleteTaggingById
699
+ * @summary Delete Tagging By Id
700
+ * @request DELETE:/api/v1/tagging/{tagging_id}
701
+ */
702
+ deleteTaggingById: (taggingId, params = {}) => this.request(Object.assign({ path: `/api/v1/tagging/${taggingId}`, method: "DELETE", format: "json" }, params)),
703
+ /**
704
+ * @description 分页获取标签列表
705
+ *
706
+ * @tags tag
707
+ * @name GetTagList
708
+ * @summary Get Tag List
709
+ * @request POST:/api/v1/tag/list
710
+ */
711
+ getTagList: (data, params = {}) => this.request(Object.assign({ path: `/api/v1/tag/list`, method: "POST", body: data, type: ContentType.Json, format: "json" }, params)),
712
+ /**
713
+ * @description 批量新增标签 注意:根据接口定义,DB 插件方法签名为 add_tag_list(tag_list: List[TagCreate]), 因此此处直接传入 body。若 TagCreate 需要携带 tenant_id,应由模型或插件内部处理。
714
+ *
715
+ * @tags tag
716
+ * @name AddTagList
717
+ * @summary Add Tag List
718
+ * @request POST:/api/v1/tag/add_list
719
+ */
720
+ addTagList: (data, params = {}) => this.request(Object.assign({ path: `/api/v1/tag/add_list`, method: "POST", body: data, type: ContentType.Json, format: "json" }, params)),
721
+ /**
722
+ * @description 获取标签详情
723
+ *
724
+ * @tags tag
725
+ * @name GetTagById
726
+ * @summary Get Tag By Id
727
+ * @request GET:/api/v1/tag/{tag_id}
728
+ */
729
+ getTagById: (tagId, params = {}) => this.request(Object.assign({ path: `/api/v1/tag/${tagId}`, method: "GET", format: "json" }, params)),
730
+ /**
731
+ * No description
732
+ *
733
+ * @tags tag
734
+ * @name DeleteTagById
735
+ * @summary Delete Tag By Id
736
+ * @request DELETE:/api/v1/tag/{tag_id}
737
+ */
738
+ deleteTagById: (tagId, params = {}) => this.request(Object.assign({ path: `/api/v1/tag/${tagId}`, method: "DELETE", format: "json" }, params)),
739
+ /**
740
+ * No description
741
+ *
742
+ * @tags tag
743
+ * @name UpdateTag
744
+ * @summary Update Tag
745
+ * @request POST:/api/v1/tag/update
746
+ */
747
+ updateTag: (data, params = {}) => this.request(Object.assign({ path: `/api/v1/tag/update`, method: "POST", body: data, type: ContentType.Json, format: "json" }, params)),
748
+ /**
749
+ * No description
750
+ *
751
+ * @tags artifact
752
+ * @name GetArtifactList
753
+ * @summary Get Artifact List
754
+ * @request POST:/api/v1/artifact/list
755
+ */
756
+ getArtifactList: (data, params = {}) => this.request(Object.assign({ path: `/api/v1/artifact/list`, method: "POST", body: data, type: ContentType.Json, format: "json" }, params)),
757
+ /**
758
+ * No description
759
+ *
760
+ * @tags artifact
761
+ * @name AddArtifactList
762
+ * @summary Add Artifact List
763
+ * @request POST:/api/v1/artifact/add_list
764
+ */
765
+ addArtifactList: (data, params = {}) => this.request(Object.assign({ path: `/api/v1/artifact/add_list`, method: "POST", body: data, type: ContentType.Json, format: "json" }, params)),
766
+ /**
767
+ * No description
768
+ *
769
+ * @tags artifact
770
+ * @name GetArtifactById
771
+ * @summary Get Artifact By Id
772
+ * @request GET:/api/v1/artifact/{artifact_id}
773
+ */
774
+ getArtifactById: (artifactId, params = {}) => this.request(Object.assign({ path: `/api/v1/artifact/${artifactId}`, method: "GET", format: "json" }, params)),
775
+ /**
776
+ * No description
777
+ *
778
+ * @tags artifact
779
+ * @name DeleteArtifactById
780
+ * @summary Delete Artifact By Id
781
+ * @request DELETE:/api/v1/artifact/{artifact_id}
782
+ */
783
+ deleteArtifactById: (artifactId, params = {}) => this.request(Object.assign({ path: `/api/v1/artifact/${artifactId}`, method: "DELETE", format: "json" }, params)),
784
+ /**
785
+ * No description
786
+ *
787
+ * @tags artifact
788
+ * @name UpdateArtifactSpaceId
789
+ * @summary Update Artifact Space Id
790
+ * @request POST:/api/v1/artifact/update_space
791
+ */
792
+ updateArtifactSpaceId: (data, params = {}) => this.request(Object.assign({ path: `/api/v1/artifact/update_space`, method: "POST", body: data, type: ContentType.Json, format: "json" }, params)),
793
+ };
794
+ this.rule = {
795
+ /**
796
+ * No description
797
+ *
798
+ * @tags rule
799
+ * @name GetGlobalRule
800
+ * @summary Get Global Rule
801
+ * @request GET:/api/rule/global
802
+ */
803
+ getGlobalRule: (params = {}) => this.request(Object.assign({ path: `/api/rule/global`, method: "GET", format: "json" }, params)),
804
+ /**
805
+ * No description
806
+ *
807
+ * @tags rule
808
+ * @name GetSpaceRule
809
+ * @summary Get Space Rule
810
+ * @request GET:/api/rule/space/{space_id}
811
+ */
812
+ getSpaceRule: (spaceId, params = {}) => this.request(Object.assign({ path: `/api/rule/space/${spaceId}`, method: "GET", format: "json" }, params)),
813
+ };
814
+ this.apiKey = {
815
+ /**
816
+ * No description
817
+ *
818
+ * @tags api key
819
+ * @name CreateApiKey
820
+ * @summary Create Api Key
821
+ * @request POST:/api/api_key/create
822
+ */
823
+ createApiKey: (data, params = {}) => this.request(Object.assign({ path: `/api/api_key/create`, method: "POST", body: data, type: ContentType.Json, format: "json" }, params)),
824
+ /**
825
+ * No description
826
+ *
827
+ * @tags api key
828
+ * @name UpdateApiKey
829
+ * @summary Update Api Key
830
+ * @request POST:/api/api_key/update
831
+ */
832
+ updateApiKey: (data, params = {}) => this.request(Object.assign({ path: `/api/api_key/update`, method: "POST", body: data, type: ContentType.Json, format: "json" }, params)),
833
+ /**
834
+ * No description
835
+ *
836
+ * @tags api key
837
+ * @name GetApiKeyList
838
+ * @summary Get Api Key List
839
+ * @request POST:/api/api_key/list
840
+ */
841
+ getApiKeyList: (data, params = {}) => this.request(Object.assign({ path: `/api/api_key/list`, method: "POST", body: data, type: ContentType.Json, format: "json" }, params)),
842
+ /**
843
+ * No description
844
+ *
845
+ * @tags api key
846
+ * @name DeleteApiKey
847
+ * @summary Delete Api Key
848
+ * @request DELETE:/api/api_key/delete/{key_id}
849
+ */
850
+ deleteApiKey: (keyId, params = {}) => this.request(Object.assign({ path: `/api/api_key/delete/${keyId}`, method: "DELETE", format: "json" }, params)),
851
+ /**
852
+ * No description
853
+ *
854
+ * @tags api key
855
+ * @name DeactivateApiKey
856
+ * @summary Change Api Key Status
857
+ * @request POST:/api/api_key/deactivate/{key_id}
858
+ */
859
+ deactivateApiKey: (keyId, data, params = {}) => this.request(Object.assign({ path: `/api/api_key/deactivate/${keyId}`, method: "POST", body: data, type: ContentType.Json, format: "json" }, params)),
860
+ /**
861
+ * No description
862
+ *
863
+ * @tags api key
864
+ * @name GetAllExpiredApiKeys
865
+ * @summary Get All Expired Api Keys
866
+ * @request GET:/api/api_key/expired
867
+ */
868
+ getAllExpiredApiKeys: (params = {}) => this.request(Object.assign({ path: `/api/api_key/expired`, method: "GET", format: "json" }, params)),
869
+ };
870
+ this.healthChecker = {
871
+ /**
872
+ * No description
873
+ *
874
+ * @name HealthCheckerApiHealthCheckerGet
875
+ * @summary Health Checker
876
+ * @request GET:/api/health_checker
877
+ */
878
+ healthCheckerApiHealthCheckerGet: (params = {}) => this.request(Object.assign({ path: `/api/health_checker`, method: "GET", format: "json" }, params)),
879
+ };
880
+ }
881
+ }
882
+ exports.Api = Api;