@orq-ai/node 3.2.9 → 3.2.11

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 (153) hide show
  1. package/bin/mcp-server.js +32 -32
  2. package/bin/mcp-server.js.map +17 -17
  3. package/hooks/types.d.ts +1 -1
  4. package/hooks/types.d.ts.map +1 -1
  5. package/jsr.json +1 -1
  6. package/lib/config.d.ts +3 -3
  7. package/lib/config.js +3 -3
  8. package/lib/config.js.map +1 -1
  9. package/mcp-server/mcp-server.js +1 -1
  10. package/mcp-server/mcp-server.js.map +1 -1
  11. package/mcp-server/server.js +1 -1
  12. package/mcp-server/server.js.map +1 -1
  13. package/models/operations/bulkcreatedatapoints.js +2 -2
  14. package/models/operations/createcontact.js +2 -2
  15. package/models/operations/createdataset.js +2 -2
  16. package/models/operations/createdatasetitem.js +2 -2
  17. package/models/operations/fileget.js +2 -2
  18. package/models/operations/filelist.js +2 -2
  19. package/models/operations/fileupload.js +2 -2
  20. package/models/operations/listdatasetdatapoints.js +2 -2
  21. package/models/operations/listdatasets.js +2 -2
  22. package/models/operations/retrievedatapoint.js +2 -2
  23. package/models/operations/retrievedataset.js +2 -2
  24. package/models/operations/updatedatapoint.js +2 -2
  25. package/models/operations/updatedataset.js +2 -2
  26. package/package.json +1 -1
  27. package/packages/orq-rc/README.md +37 -1
  28. package/packages/orq-rc/docs/sdks/files/README.md +8 -2
  29. package/packages/orq-rc/docs/sdks/knowledge/README.md +1197 -0
  30. package/packages/orq-rc/jsr.json +1 -1
  31. package/packages/orq-rc/package-lock.json +2 -2
  32. package/packages/orq-rc/package.json +1 -1
  33. package/packages/orq-rc/src/funcs/contactsCreate.ts +1 -1
  34. package/packages/orq-rc/src/funcs/datasetsClear.ts +1 -1
  35. package/packages/orq-rc/src/funcs/datasetsCreate.ts +1 -1
  36. package/packages/orq-rc/src/funcs/datasetsCreateDatapoint.ts +1 -1
  37. package/packages/orq-rc/src/funcs/datasetsCreateDatapoints.ts +1 -1
  38. package/packages/orq-rc/src/funcs/datasetsDelete.ts +1 -1
  39. package/packages/orq-rc/src/funcs/datasetsDeleteDatapoint.ts +1 -1
  40. package/packages/orq-rc/src/funcs/datasetsList.ts +1 -1
  41. package/packages/orq-rc/src/funcs/datasetsListDatapoints.ts +1 -1
  42. package/packages/orq-rc/src/funcs/datasetsRetrieve.ts +1 -1
  43. package/packages/orq-rc/src/funcs/datasetsRetrieveDatapoint.ts +1 -1
  44. package/packages/orq-rc/src/funcs/datasetsUpdate.ts +1 -1
  45. package/packages/orq-rc/src/funcs/datasetsUpdateDatapoint.ts +1 -1
  46. package/packages/orq-rc/src/funcs/deploymentsGetConfig.ts +1 -1
  47. package/packages/orq-rc/src/funcs/deploymentsInvoke.ts +1 -1
  48. package/packages/orq-rc/src/funcs/deploymentsList.ts +1 -1
  49. package/packages/orq-rc/src/funcs/deploymentsMetricsCreate.ts +1 -1
  50. package/packages/orq-rc/src/funcs/deploymentsStream.ts +1 -1
  51. package/packages/orq-rc/src/funcs/feedbackCreate.ts +1 -1
  52. package/packages/orq-rc/src/funcs/filesCreate.ts +19 -22
  53. package/packages/orq-rc/src/funcs/filesDelete.ts +1 -1
  54. package/packages/orq-rc/src/funcs/filesGet.ts +1 -1
  55. package/packages/orq-rc/src/funcs/filesList.ts +1 -1
  56. package/packages/orq-rc/src/funcs/knowledgeCreate.ts +152 -0
  57. package/packages/orq-rc/src/funcs/knowledgeCreateChunks.ts +165 -0
  58. package/packages/orq-rc/src/funcs/knowledgeCreateDatasource.ts +160 -0
  59. package/packages/orq-rc/src/funcs/knowledgeDelete.ts +161 -0
  60. package/packages/orq-rc/src/funcs/knowledgeDeleteChunk.ts +168 -0
  61. package/packages/orq-rc/src/funcs/knowledgeDeleteDatasource.ts +167 -0
  62. package/packages/orq-rc/src/funcs/knowledgeList.ts +163 -0
  63. package/packages/orq-rc/src/funcs/knowledgeListChunks.ts +172 -0
  64. package/packages/orq-rc/src/funcs/knowledgeListDatasources.ts +168 -0
  65. package/packages/orq-rc/src/funcs/knowledgeRetrieve.ts +160 -0
  66. package/packages/orq-rc/src/funcs/knowledgeRetrieveDatasource.ts +163 -0
  67. package/packages/orq-rc/src/funcs/knowledgeRetrieveFileUrl.ts +176 -0
  68. package/packages/orq-rc/src/funcs/knowledgeSearch.ts +158 -0
  69. package/packages/orq-rc/src/funcs/knowledgeUpdate.ts +158 -0
  70. package/packages/orq-rc/src/funcs/knowledgeUpdateChunk.ts +168 -0
  71. package/packages/orq-rc/src/funcs/promptsCreate.ts +1 -1
  72. package/packages/orq-rc/src/funcs/promptsDelete.ts +1 -1
  73. package/packages/orq-rc/src/funcs/promptsGetVersion.ts +1 -1
  74. package/packages/orq-rc/src/funcs/promptsList.ts +1 -1
  75. package/packages/orq-rc/src/funcs/promptsListVersions.ts +1 -1
  76. package/packages/orq-rc/src/funcs/promptsRetrieve.ts +1 -1
  77. package/packages/orq-rc/src/funcs/promptsUpdate.ts +1 -1
  78. package/packages/orq-rc/src/funcs/remoteconfigsRetrieve.ts +1 -1
  79. package/packages/orq-rc/src/hooks/types.ts +1 -1
  80. package/packages/orq-rc/src/lib/config.ts +3 -3
  81. package/packages/orq-rc/src/mcp-server/mcp-server.ts +1 -1
  82. package/packages/orq-rc/src/mcp-server/server.ts +31 -1
  83. package/packages/orq-rc/src/mcp-server/tools/filesCreate.ts +1 -1
  84. package/packages/orq-rc/src/mcp-server/tools/knowledgeCreate.ts +35 -0
  85. package/packages/orq-rc/src/mcp-server/tools/knowledgeCreateChunks.ts +35 -0
  86. package/packages/orq-rc/src/mcp-server/tools/knowledgeCreateDatasource.ts +35 -0
  87. package/packages/orq-rc/src/mcp-server/tools/knowledgeDelete.ts +35 -0
  88. package/packages/orq-rc/src/mcp-server/tools/knowledgeDeleteChunk.ts +33 -0
  89. package/packages/orq-rc/src/mcp-server/tools/knowledgeDeleteDatasource.ts +35 -0
  90. package/packages/orq-rc/src/mcp-server/tools/knowledgeList.ts +37 -0
  91. package/packages/orq-rc/src/mcp-server/tools/knowledgeListChunks.ts +35 -0
  92. package/packages/orq-rc/src/mcp-server/tools/knowledgeListDatasources.ts +35 -0
  93. package/packages/orq-rc/src/mcp-server/tools/knowledgeRetrieve.ts +37 -0
  94. package/packages/orq-rc/src/mcp-server/tools/knowledgeRetrieveDatasource.ts +35 -0
  95. package/packages/orq-rc/src/mcp-server/tools/knowledgeRetrieveFileUrl.ts +35 -0
  96. package/packages/orq-rc/src/mcp-server/tools/knowledgeSearch.ts +35 -0
  97. package/packages/orq-rc/src/mcp-server/tools/knowledgeUpdate.ts +35 -0
  98. package/packages/orq-rc/src/mcp-server/tools/knowledgeUpdateChunk.ts +35 -0
  99. package/packages/orq-rc/src/models/operations/bulkcreatedatapoints.ts +2 -2
  100. package/packages/orq-rc/src/models/operations/createchunk.ts +680 -0
  101. package/packages/orq-rc/src/models/operations/createcontact.ts +2 -2
  102. package/packages/orq-rc/src/models/operations/createdataset.ts +2 -2
  103. package/packages/orq-rc/src/models/operations/createdatasetitem.ts +2 -2
  104. package/packages/orq-rc/src/models/operations/createdatasource.ts +852 -0
  105. package/packages/orq-rc/src/models/operations/createknowledge.ts +2920 -0
  106. package/packages/orq-rc/src/models/operations/createprompt.ts +6 -0
  107. package/packages/orq-rc/src/models/operations/deletechunk.ts +96 -0
  108. package/packages/orq-rc/src/models/operations/deletedatasource.ts +87 -0
  109. package/packages/orq-rc/src/models/operations/deleteknowledge.ts +78 -0
  110. package/packages/orq-rc/src/models/operations/fileget.ts +2 -2
  111. package/packages/orq-rc/src/models/operations/filelist.ts +2 -2
  112. package/packages/orq-rc/src/models/operations/fileupload.ts +6 -6
  113. package/packages/orq-rc/src/models/operations/getallprompts.ts +3 -0
  114. package/packages/orq-rc/src/models/operations/getonefileuploadurl.ts +157 -0
  115. package/packages/orq-rc/src/models/operations/getoneknowledge.ts +1631 -0
  116. package/packages/orq-rc/src/models/operations/getoneprompt.ts +3 -0
  117. package/packages/orq-rc/src/models/operations/getpromptversion.ts +3 -0
  118. package/packages/orq-rc/src/models/operations/index.ts +15 -0
  119. package/packages/orq-rc/src/models/operations/listchunks.ts +444 -0
  120. package/packages/orq-rc/src/models/operations/listdatasetdatapoints.ts +2 -2
  121. package/packages/orq-rc/src/models/operations/listdatasets.ts +2 -2
  122. package/packages/orq-rc/src/models/operations/listdatasources.ts +447 -0
  123. package/packages/orq-rc/src/models/operations/listknowledgebases.ts +1782 -0
  124. package/packages/orq-rc/src/models/operations/listpromptversions.ts +3 -0
  125. package/packages/orq-rc/src/models/operations/retrievedatapoint.ts +2 -2
  126. package/packages/orq-rc/src/models/operations/retrievedataset.ts +2 -2
  127. package/packages/orq-rc/src/models/operations/retrievedatasource.ts +273 -0
  128. package/packages/orq-rc/src/models/operations/searchknowledge.ts +1673 -0
  129. package/packages/orq-rc/src/models/operations/updatechunk.ts +418 -0
  130. package/packages/orq-rc/src/models/operations/updatedatapoint.ts +2 -2
  131. package/packages/orq-rc/src/models/operations/updatedataset.ts +2 -2
  132. package/packages/orq-rc/src/models/operations/updateknowledge.ts +3123 -0
  133. package/packages/orq-rc/src/models/operations/updateprompt.ts +6 -0
  134. package/packages/orq-rc/src/sdk/files.ts +1 -1
  135. package/packages/orq-rc/src/sdk/knowledge.ts +246 -0
  136. package/packages/orq-rc/src/sdk/sdk.ts +6 -0
  137. package/src/hooks/types.ts +1 -1
  138. package/src/lib/config.ts +3 -3
  139. package/src/mcp-server/mcp-server.ts +1 -1
  140. package/src/mcp-server/server.ts +1 -1
  141. package/src/models/operations/bulkcreatedatapoints.ts +2 -2
  142. package/src/models/operations/createcontact.ts +2 -2
  143. package/src/models/operations/createdataset.ts +2 -2
  144. package/src/models/operations/createdatasetitem.ts +2 -2
  145. package/src/models/operations/fileget.ts +2 -2
  146. package/src/models/operations/filelist.ts +2 -2
  147. package/src/models/operations/fileupload.ts +2 -2
  148. package/src/models/operations/listdatasetdatapoints.ts +2 -2
  149. package/src/models/operations/listdatasets.ts +2 -2
  150. package/src/models/operations/retrievedatapoint.ts +2 -2
  151. package/src/models/operations/retrievedataset.ts +2 -2
  152. package/src/models/operations/updatedatapoint.ts +2 -2
  153. package/src/models/operations/updatedataset.ts +2 -2
@@ -0,0 +1,1197 @@
1
+ # Knowledge
2
+ (*knowledge*)
3
+
4
+ ## Overview
5
+
6
+ ### Available Operations
7
+
8
+ * [list](#list) - List all knowledge bases
9
+ * [create](#create) - Create a knowledge
10
+ * [retrieve](#retrieve) - Retrieves a knowledge base
11
+ * [update](#update) - Updates a knowledge
12
+ * [delete](#delete) - Deletes a knowledge
13
+ * [search](#search) - Retrieves the documents used for retrieval
14
+ * [retrieveFileUrl](#retrievefileurl) - Retrieves the file upload url
15
+ * [listDatasources](#listdatasources) - List all datasources
16
+ * [createDatasource](#createdatasource) - Create a new datasource
17
+ * [retrieveDatasource](#retrievedatasource) - Retrieve a datasource
18
+ * [deleteDatasource](#deletedatasource) - Deletes a datasource
19
+ * [createChunks](#createchunks) - Create chunks for a datasource
20
+ * [listChunks](#listchunks) - List all chunks for a datasource
21
+ * [updateChunk](#updatechunk) - Update a chunk
22
+ * [deleteChunk](#deletechunk) - Delete a chunk
23
+
24
+ ## list
25
+
26
+ Returns a list of your knowledge bases. The knowledge bases are returned sorted by creation date, with the most recent knowledge bases appearing first
27
+
28
+ ### Example Usage
29
+
30
+ ```typescript
31
+ import { Orq } from "@orq-ai/node";
32
+
33
+ const orq = new Orq({
34
+ apiKey: process.env["ORQ_API_KEY"] ?? "",
35
+ });
36
+
37
+ async function run() {
38
+ const result = await orq.knowledge.list({});
39
+
40
+ // Handle the result
41
+ console.log(result);
42
+ }
43
+
44
+ run();
45
+ ```
46
+
47
+ ### Standalone function
48
+
49
+ The standalone function version of this method:
50
+
51
+ ```typescript
52
+ import { OrqCore } from "@orq-ai/node/core.js";
53
+ import { knowledgeList } from "@orq-ai/node/funcs/knowledgeList.js";
54
+
55
+ // Use `OrqCore` for best tree-shaking performance.
56
+ // You can create one instance of it to use across an application.
57
+ const orq = new OrqCore({
58
+ apiKey: process.env["ORQ_API_KEY"] ?? "",
59
+ });
60
+
61
+ async function run() {
62
+ const res = await knowledgeList(orq, {});
63
+
64
+ if (!res.ok) {
65
+ throw res.error;
66
+ }
67
+
68
+ const { value: result } = res;
69
+
70
+ // Handle the result
71
+ console.log(result);
72
+ }
73
+
74
+ run();
75
+ ```
76
+
77
+ ### Parameters
78
+
79
+ | Parameter | Type | Required | Description |
80
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
81
+ | `request` | [operations.ListKnowledgeBasesRequest](../../models/operations/listknowledgebasesrequest.md) | :heavy_check_mark: | The request object to use for the request. |
82
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
83
+ | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
84
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
85
+
86
+ ### Response
87
+
88
+ **Promise\<[operations.ListKnowledgeBasesResponseBody](../../models/operations/listknowledgebasesresponsebody.md)\>**
89
+
90
+ ### Errors
91
+
92
+ | Error Type | Status Code | Content Type |
93
+ | --------------- | --------------- | --------------- |
94
+ | errors.APIError | 4XX, 5XX | \*/\* |
95
+
96
+ ## create
97
+
98
+ Create a knowledge
99
+
100
+ ### Example Usage
101
+
102
+ ```typescript
103
+ import { Orq } from "@orq-ai/node";
104
+
105
+ const orq = new Orq({
106
+ apiKey: process.env["ORQ_API_KEY"] ?? "",
107
+ });
108
+
109
+ async function run() {
110
+ const result = await orq.knowledge.create({
111
+ key: "<key>",
112
+ model: "Fiesta",
113
+ path: "Customer Service/Billing/Refund",
114
+ });
115
+
116
+ // Handle the result
117
+ console.log(result);
118
+ }
119
+
120
+ run();
121
+ ```
122
+
123
+ ### Standalone function
124
+
125
+ The standalone function version of this method:
126
+
127
+ ```typescript
128
+ import { OrqCore } from "@orq-ai/node/core.js";
129
+ import { knowledgeCreate } from "@orq-ai/node/funcs/knowledgeCreate.js";
130
+
131
+ // Use `OrqCore` for best tree-shaking performance.
132
+ // You can create one instance of it to use across an application.
133
+ const orq = new OrqCore({
134
+ apiKey: process.env["ORQ_API_KEY"] ?? "",
135
+ });
136
+
137
+ async function run() {
138
+ const res = await knowledgeCreate(orq, {
139
+ key: "<key>",
140
+ model: "Fiesta",
141
+ path: "Customer Service/Billing/Refund",
142
+ });
143
+
144
+ if (!res.ok) {
145
+ throw res.error;
146
+ }
147
+
148
+ const { value: result } = res;
149
+
150
+ // Handle the result
151
+ console.log(result);
152
+ }
153
+
154
+ run();
155
+ ```
156
+
157
+ ### Parameters
158
+
159
+ | Parameter | Type | Required | Description |
160
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
161
+ | `request` | [operations.CreateKnowledgeRequestBody](../../models/operations/createknowledgerequestbody.md) | :heavy_check_mark: | The request object to use for the request. |
162
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
163
+ | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
164
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
165
+
166
+ ### Response
167
+
168
+ **Promise\<[operations.CreateKnowledgeResponseBody](../../models/operations/createknowledgeresponsebody.md)\>**
169
+
170
+ ### Errors
171
+
172
+ | Error Type | Status Code | Content Type |
173
+ | --------------- | --------------- | --------------- |
174
+ | errors.APIError | 4XX, 5XX | \*/\* |
175
+
176
+ ## retrieve
177
+
178
+ Retrieve a knowledge base with the settings.
179
+
180
+ ### Example Usage
181
+
182
+ ```typescript
183
+ import { Orq } from "@orq-ai/node";
184
+
185
+ const orq = new Orq({
186
+ apiKey: process.env["ORQ_API_KEY"] ?? "",
187
+ });
188
+
189
+ async function run() {
190
+ const result = await orq.knowledge.retrieve({
191
+ knowledgeId: "<id>",
192
+ });
193
+
194
+ // Handle the result
195
+ console.log(result);
196
+ }
197
+
198
+ run();
199
+ ```
200
+
201
+ ### Standalone function
202
+
203
+ The standalone function version of this method:
204
+
205
+ ```typescript
206
+ import { OrqCore } from "@orq-ai/node/core.js";
207
+ import { knowledgeRetrieve } from "@orq-ai/node/funcs/knowledgeRetrieve.js";
208
+
209
+ // Use `OrqCore` for best tree-shaking performance.
210
+ // You can create one instance of it to use across an application.
211
+ const orq = new OrqCore({
212
+ apiKey: process.env["ORQ_API_KEY"] ?? "",
213
+ });
214
+
215
+ async function run() {
216
+ const res = await knowledgeRetrieve(orq, {
217
+ knowledgeId: "<id>",
218
+ });
219
+
220
+ if (!res.ok) {
221
+ throw res.error;
222
+ }
223
+
224
+ const { value: result } = res;
225
+
226
+ // Handle the result
227
+ console.log(result);
228
+ }
229
+
230
+ run();
231
+ ```
232
+
233
+ ### Parameters
234
+
235
+ | Parameter | Type | Required | Description |
236
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
237
+ | `request` | [operations.GetOneKnowledgeRequest](../../models/operations/getoneknowledgerequest.md) | :heavy_check_mark: | The request object to use for the request. |
238
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
239
+ | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
240
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
241
+
242
+ ### Response
243
+
244
+ **Promise\<[operations.GetOneKnowledgeResponseBody](../../models/operations/getoneknowledgeresponsebody.md)\>**
245
+
246
+ ### Errors
247
+
248
+ | Error Type | Status Code | Content Type |
249
+ | --------------- | --------------- | --------------- |
250
+ | errors.APIError | 4XX, 5XX | \*/\* |
251
+
252
+ ## update
253
+
254
+ Updates a knowledge
255
+
256
+ ### Example Usage
257
+
258
+ ```typescript
259
+ import { Orq } from "@orq-ai/node";
260
+
261
+ const orq = new Orq({
262
+ apiKey: process.env["ORQ_API_KEY"] ?? "",
263
+ });
264
+
265
+ async function run() {
266
+ const result = await orq.knowledge.update({
267
+ knowledgeId: "<id>",
268
+ requestBody: {
269
+ path: "Customer Service/Billing/Refund",
270
+ },
271
+ });
272
+
273
+ // Handle the result
274
+ console.log(result);
275
+ }
276
+
277
+ run();
278
+ ```
279
+
280
+ ### Standalone function
281
+
282
+ The standalone function version of this method:
283
+
284
+ ```typescript
285
+ import { OrqCore } from "@orq-ai/node/core.js";
286
+ import { knowledgeUpdate } from "@orq-ai/node/funcs/knowledgeUpdate.js";
287
+
288
+ // Use `OrqCore` for best tree-shaking performance.
289
+ // You can create one instance of it to use across an application.
290
+ const orq = new OrqCore({
291
+ apiKey: process.env["ORQ_API_KEY"] ?? "",
292
+ });
293
+
294
+ async function run() {
295
+ const res = await knowledgeUpdate(orq, {
296
+ knowledgeId: "<id>",
297
+ requestBody: {
298
+ path: "Customer Service/Billing/Refund",
299
+ },
300
+ });
301
+
302
+ if (!res.ok) {
303
+ throw res.error;
304
+ }
305
+
306
+ const { value: result } = res;
307
+
308
+ // Handle the result
309
+ console.log(result);
310
+ }
311
+
312
+ run();
313
+ ```
314
+
315
+ ### Parameters
316
+
317
+ | Parameter | Type | Required | Description |
318
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
319
+ | `request` | [operations.UpdateKnowledgeRequest](../../models/operations/updateknowledgerequest.md) | :heavy_check_mark: | The request object to use for the request. |
320
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
321
+ | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
322
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
323
+
324
+ ### Response
325
+
326
+ **Promise\<[operations.UpdateKnowledgeResponseBody](../../models/operations/updateknowledgeresponsebody.md)\>**
327
+
328
+ ### Errors
329
+
330
+ | Error Type | Status Code | Content Type |
331
+ | --------------- | --------------- | --------------- |
332
+ | errors.APIError | 4XX, 5XX | \*/\* |
333
+
334
+ ## delete
335
+
336
+ Deletes a knowledge base. Deleting a knowledge base will delete all the datasources and chunks associated with it.
337
+
338
+ ### Example Usage
339
+
340
+ ```typescript
341
+ import { Orq } from "@orq-ai/node";
342
+
343
+ const orq = new Orq({
344
+ apiKey: process.env["ORQ_API_KEY"] ?? "",
345
+ });
346
+
347
+ async function run() {
348
+ await orq.knowledge.delete({
349
+ knowledgeId: "<id>",
350
+ });
351
+
352
+
353
+ }
354
+
355
+ run();
356
+ ```
357
+
358
+ ### Standalone function
359
+
360
+ The standalone function version of this method:
361
+
362
+ ```typescript
363
+ import { OrqCore } from "@orq-ai/node/core.js";
364
+ import { knowledgeDelete } from "@orq-ai/node/funcs/knowledgeDelete.js";
365
+
366
+ // Use `OrqCore` for best tree-shaking performance.
367
+ // You can create one instance of it to use across an application.
368
+ const orq = new OrqCore({
369
+ apiKey: process.env["ORQ_API_KEY"] ?? "",
370
+ });
371
+
372
+ async function run() {
373
+ const res = await knowledgeDelete(orq, {
374
+ knowledgeId: "<id>",
375
+ });
376
+
377
+ if (!res.ok) {
378
+ throw res.error;
379
+ }
380
+
381
+ const { value: result } = res;
382
+
383
+
384
+ }
385
+
386
+ run();
387
+ ```
388
+
389
+ ### Parameters
390
+
391
+ | Parameter | Type | Required | Description |
392
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
393
+ | `request` | [operations.DeleteKnowledgeRequest](../../models/operations/deleteknowledgerequest.md) | :heavy_check_mark: | The request object to use for the request. |
394
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
395
+ | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
396
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
397
+
398
+ ### Response
399
+
400
+ **Promise\<void\>**
401
+
402
+ ### Errors
403
+
404
+ | Error Type | Status Code | Content Type |
405
+ | --------------- | --------------- | --------------- |
406
+ | errors.APIError | 4XX, 5XX | \*/\* |
407
+
408
+ ## search
409
+
410
+ Retrieves the documents used for retrieval
411
+
412
+ ### Example Usage
413
+
414
+ ```typescript
415
+ import { Orq } from "@orq-ai/node";
416
+
417
+ const orq = new Orq({
418
+ apiKey: process.env["ORQ_API_KEY"] ?? "",
419
+ });
420
+
421
+ async function run() {
422
+ const result = await orq.knowledge.search({
423
+ knowledgeId: "<id>",
424
+ requestBody: {
425
+ query: "<value>",
426
+ },
427
+ });
428
+
429
+ // Handle the result
430
+ console.log(result);
431
+ }
432
+
433
+ run();
434
+ ```
435
+
436
+ ### Standalone function
437
+
438
+ The standalone function version of this method:
439
+
440
+ ```typescript
441
+ import { OrqCore } from "@orq-ai/node/core.js";
442
+ import { knowledgeSearch } from "@orq-ai/node/funcs/knowledgeSearch.js";
443
+
444
+ // Use `OrqCore` for best tree-shaking performance.
445
+ // You can create one instance of it to use across an application.
446
+ const orq = new OrqCore({
447
+ apiKey: process.env["ORQ_API_KEY"] ?? "",
448
+ });
449
+
450
+ async function run() {
451
+ const res = await knowledgeSearch(orq, {
452
+ knowledgeId: "<id>",
453
+ requestBody: {
454
+ query: "<value>",
455
+ },
456
+ });
457
+
458
+ if (!res.ok) {
459
+ throw res.error;
460
+ }
461
+
462
+ const { value: result } = res;
463
+
464
+ // Handle the result
465
+ console.log(result);
466
+ }
467
+
468
+ run();
469
+ ```
470
+
471
+ ### Parameters
472
+
473
+ | Parameter | Type | Required | Description |
474
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
475
+ | `request` | [operations.SearchKnowledgeRequest](../../models/operations/searchknowledgerequest.md) | :heavy_check_mark: | The request object to use for the request. |
476
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
477
+ | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
478
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
479
+
480
+ ### Response
481
+
482
+ **Promise\<[operations.SearchKnowledgeResponseBody](../../models/operations/searchknowledgeresponsebody.md)\>**
483
+
484
+ ### Errors
485
+
486
+ | Error Type | Status Code | Content Type |
487
+ | --------------- | --------------- | --------------- |
488
+ | errors.APIError | 4XX, 5XX | \*/\* |
489
+
490
+ ## retrieveFileUrl
491
+
492
+ Retrieves the file upload url
493
+
494
+ ### Example Usage
495
+
496
+ ```typescript
497
+ import { Orq } from "@orq-ai/node";
498
+
499
+ const orq = new Orq({
500
+ apiKey: process.env["ORQ_API_KEY"] ?? "",
501
+ });
502
+
503
+ async function run() {
504
+ const result = await orq.knowledge.retrieveFileUrl({
505
+ knowledgeId: "<id>",
506
+ fileName: "example.file",
507
+ contentType: "<value>",
508
+ datasourceId: "<id>",
509
+ });
510
+
511
+ // Handle the result
512
+ console.log(result);
513
+ }
514
+
515
+ run();
516
+ ```
517
+
518
+ ### Standalone function
519
+
520
+ The standalone function version of this method:
521
+
522
+ ```typescript
523
+ import { OrqCore } from "@orq-ai/node/core.js";
524
+ import { knowledgeRetrieveFileUrl } from "@orq-ai/node/funcs/knowledgeRetrieveFileUrl.js";
525
+
526
+ // Use `OrqCore` for best tree-shaking performance.
527
+ // You can create one instance of it to use across an application.
528
+ const orq = new OrqCore({
529
+ apiKey: process.env["ORQ_API_KEY"] ?? "",
530
+ });
531
+
532
+ async function run() {
533
+ const res = await knowledgeRetrieveFileUrl(orq, {
534
+ knowledgeId: "<id>",
535
+ fileName: "example.file",
536
+ contentType: "<value>",
537
+ datasourceId: "<id>",
538
+ });
539
+
540
+ if (!res.ok) {
541
+ throw res.error;
542
+ }
543
+
544
+ const { value: result } = res;
545
+
546
+ // Handle the result
547
+ console.log(result);
548
+ }
549
+
550
+ run();
551
+ ```
552
+
553
+ ### Parameters
554
+
555
+ | Parameter | Type | Required | Description |
556
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
557
+ | `request` | [operations.GetOneFileUploadUrlRequest](../../models/operations/getonefileuploadurlrequest.md) | :heavy_check_mark: | The request object to use for the request. |
558
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
559
+ | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
560
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
561
+
562
+ ### Response
563
+
564
+ **Promise\<[operations.GetOneFileUploadUrlResponseBody](../../models/operations/getonefileuploadurlresponsebody.md)\>**
565
+
566
+ ### Errors
567
+
568
+ | Error Type | Status Code | Content Type |
569
+ | ------------------- | ------------------- | ------------------- |
570
+ | errors.HonoApiError | 500 | application/json |
571
+ | errors.APIError | 4XX, 5XX | \*/\* |
572
+
573
+ ## listDatasources
574
+
575
+ List all datasources
576
+
577
+ ### Example Usage
578
+
579
+ ```typescript
580
+ import { Orq } from "@orq-ai/node";
581
+
582
+ const orq = new Orq({
583
+ apiKey: process.env["ORQ_API_KEY"] ?? "",
584
+ });
585
+
586
+ async function run() {
587
+ const result = await orq.knowledge.listDatasources({
588
+ knowledgeId: "<id>",
589
+ status: "completed",
590
+ });
591
+
592
+ // Handle the result
593
+ console.log(result);
594
+ }
595
+
596
+ run();
597
+ ```
598
+
599
+ ### Standalone function
600
+
601
+ The standalone function version of this method:
602
+
603
+ ```typescript
604
+ import { OrqCore } from "@orq-ai/node/core.js";
605
+ import { knowledgeListDatasources } from "@orq-ai/node/funcs/knowledgeListDatasources.js";
606
+
607
+ // Use `OrqCore` for best tree-shaking performance.
608
+ // You can create one instance of it to use across an application.
609
+ const orq = new OrqCore({
610
+ apiKey: process.env["ORQ_API_KEY"] ?? "",
611
+ });
612
+
613
+ async function run() {
614
+ const res = await knowledgeListDatasources(orq, {
615
+ knowledgeId: "<id>",
616
+ status: "completed",
617
+ });
618
+
619
+ if (!res.ok) {
620
+ throw res.error;
621
+ }
622
+
623
+ const { value: result } = res;
624
+
625
+ // Handle the result
626
+ console.log(result);
627
+ }
628
+
629
+ run();
630
+ ```
631
+
632
+ ### Parameters
633
+
634
+ | Parameter | Type | Required | Description |
635
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
636
+ | `request` | [operations.ListDatasourcesRequest](../../models/operations/listdatasourcesrequest.md) | :heavy_check_mark: | The request object to use for the request. |
637
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
638
+ | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
639
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
640
+
641
+ ### Response
642
+
643
+ **Promise\<[operations.ListDatasourcesResponseBody](../../models/operations/listdatasourcesresponsebody.md)\>**
644
+
645
+ ### Errors
646
+
647
+ | Error Type | Status Code | Content Type |
648
+ | --------------- | --------------- | --------------- |
649
+ | errors.APIError | 4XX, 5XX | \*/\* |
650
+
651
+ ## createDatasource
652
+
653
+ Create a new datasource
654
+
655
+ ### Example Usage
656
+
657
+ ```typescript
658
+ import { Orq } from "@orq-ai/node";
659
+
660
+ const orq = new Orq({
661
+ apiKey: process.env["ORQ_API_KEY"] ?? "",
662
+ });
663
+
664
+ async function run() {
665
+ const result = await orq.knowledge.createDatasource({
666
+ knowledgeId: "<id>",
667
+ requestBody: {},
668
+ });
669
+
670
+ // Handle the result
671
+ console.log(result);
672
+ }
673
+
674
+ run();
675
+ ```
676
+
677
+ ### Standalone function
678
+
679
+ The standalone function version of this method:
680
+
681
+ ```typescript
682
+ import { OrqCore } from "@orq-ai/node/core.js";
683
+ import { knowledgeCreateDatasource } from "@orq-ai/node/funcs/knowledgeCreateDatasource.js";
684
+
685
+ // Use `OrqCore` for best tree-shaking performance.
686
+ // You can create one instance of it to use across an application.
687
+ const orq = new OrqCore({
688
+ apiKey: process.env["ORQ_API_KEY"] ?? "",
689
+ });
690
+
691
+ async function run() {
692
+ const res = await knowledgeCreateDatasource(orq, {
693
+ knowledgeId: "<id>",
694
+ requestBody: {},
695
+ });
696
+
697
+ if (!res.ok) {
698
+ throw res.error;
699
+ }
700
+
701
+ const { value: result } = res;
702
+
703
+ // Handle the result
704
+ console.log(result);
705
+ }
706
+
707
+ run();
708
+ ```
709
+
710
+ ### Parameters
711
+
712
+ | Parameter | Type | Required | Description |
713
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
714
+ | `request` | [operations.CreateDatasourceRequest](../../models/operations/createdatasourcerequest.md) | :heavy_check_mark: | The request object to use for the request. |
715
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
716
+ | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
717
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
718
+
719
+ ### Response
720
+
721
+ **Promise\<[operations.CreateDatasourceResponseBody](../../models/operations/createdatasourceresponsebody.md)\>**
722
+
723
+ ### Errors
724
+
725
+ | Error Type | Status Code | Content Type |
726
+ | --------------- | --------------- | --------------- |
727
+ | errors.APIError | 4XX, 5XX | \*/\* |
728
+
729
+ ## retrieveDatasource
730
+
731
+ Retrieve a datasource
732
+
733
+ ### Example Usage
734
+
735
+ ```typescript
736
+ import { Orq } from "@orq-ai/node";
737
+
738
+ const orq = new Orq({
739
+ apiKey: process.env["ORQ_API_KEY"] ?? "",
740
+ });
741
+
742
+ async function run() {
743
+ const result = await orq.knowledge.retrieveDatasource({
744
+ knowledgeId: "<id>",
745
+ datasourceId: "<id>",
746
+ });
747
+
748
+ // Handle the result
749
+ console.log(result);
750
+ }
751
+
752
+ run();
753
+ ```
754
+
755
+ ### Standalone function
756
+
757
+ The standalone function version of this method:
758
+
759
+ ```typescript
760
+ import { OrqCore } from "@orq-ai/node/core.js";
761
+ import { knowledgeRetrieveDatasource } from "@orq-ai/node/funcs/knowledgeRetrieveDatasource.js";
762
+
763
+ // Use `OrqCore` for best tree-shaking performance.
764
+ // You can create one instance of it to use across an application.
765
+ const orq = new OrqCore({
766
+ apiKey: process.env["ORQ_API_KEY"] ?? "",
767
+ });
768
+
769
+ async function run() {
770
+ const res = await knowledgeRetrieveDatasource(orq, {
771
+ knowledgeId: "<id>",
772
+ datasourceId: "<id>",
773
+ });
774
+
775
+ if (!res.ok) {
776
+ throw res.error;
777
+ }
778
+
779
+ const { value: result } = res;
780
+
781
+ // Handle the result
782
+ console.log(result);
783
+ }
784
+
785
+ run();
786
+ ```
787
+
788
+ ### Parameters
789
+
790
+ | Parameter | Type | Required | Description |
791
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
792
+ | `request` | [operations.RetrieveDatasourceRequest](../../models/operations/retrievedatasourcerequest.md) | :heavy_check_mark: | The request object to use for the request. |
793
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
794
+ | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
795
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
796
+
797
+ ### Response
798
+
799
+ **Promise\<[operations.RetrieveDatasourceResponseBody](../../models/operations/retrievedatasourceresponsebody.md)\>**
800
+
801
+ ### Errors
802
+
803
+ | Error Type | Status Code | Content Type |
804
+ | --------------- | --------------- | --------------- |
805
+ | errors.APIError | 4XX, 5XX | \*/\* |
806
+
807
+ ## deleteDatasource
808
+
809
+ Deletes a datasource from a knowledge base. Deleting a datasource will remove it from the knowledge base and all associated chunks. This action is irreversible and cannot be undone.
810
+
811
+ ### Example Usage
812
+
813
+ ```typescript
814
+ import { Orq } from "@orq-ai/node";
815
+
816
+ const orq = new Orq({
817
+ apiKey: process.env["ORQ_API_KEY"] ?? "",
818
+ });
819
+
820
+ async function run() {
821
+ await orq.knowledge.deleteDatasource({
822
+ knowledgeId: "<id>",
823
+ datasourceId: "<id>",
824
+ });
825
+
826
+
827
+ }
828
+
829
+ run();
830
+ ```
831
+
832
+ ### Standalone function
833
+
834
+ The standalone function version of this method:
835
+
836
+ ```typescript
837
+ import { OrqCore } from "@orq-ai/node/core.js";
838
+ import { knowledgeDeleteDatasource } from "@orq-ai/node/funcs/knowledgeDeleteDatasource.js";
839
+
840
+ // Use `OrqCore` for best tree-shaking performance.
841
+ // You can create one instance of it to use across an application.
842
+ const orq = new OrqCore({
843
+ apiKey: process.env["ORQ_API_KEY"] ?? "",
844
+ });
845
+
846
+ async function run() {
847
+ const res = await knowledgeDeleteDatasource(orq, {
848
+ knowledgeId: "<id>",
849
+ datasourceId: "<id>",
850
+ });
851
+
852
+ if (!res.ok) {
853
+ throw res.error;
854
+ }
855
+
856
+ const { value: result } = res;
857
+
858
+
859
+ }
860
+
861
+ run();
862
+ ```
863
+
864
+ ### Parameters
865
+
866
+ | Parameter | Type | Required | Description |
867
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
868
+ | `request` | [operations.DeleteDatasourceRequest](../../models/operations/deletedatasourcerequest.md) | :heavy_check_mark: | The request object to use for the request. |
869
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
870
+ | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
871
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
872
+
873
+ ### Response
874
+
875
+ **Promise\<void\>**
876
+
877
+ ### Errors
878
+
879
+ | Error Type | Status Code | Content Type |
880
+ | --------------- | --------------- | --------------- |
881
+ | errors.APIError | 4XX, 5XX | \*/\* |
882
+
883
+ ## createChunks
884
+
885
+ Create chunks for a datasource
886
+
887
+ ### Example Usage
888
+
889
+ ```typescript
890
+ import { Orq } from "@orq-ai/node";
891
+
892
+ const orq = new Orq({
893
+ apiKey: process.env["ORQ_API_KEY"] ?? "",
894
+ });
895
+
896
+ async function run() {
897
+ const result = await orq.knowledge.createChunks({
898
+ knowledgeId: "<id>",
899
+ datasourceId: "<id>",
900
+ });
901
+
902
+ // Handle the result
903
+ console.log(result);
904
+ }
905
+
906
+ run();
907
+ ```
908
+
909
+ ### Standalone function
910
+
911
+ The standalone function version of this method:
912
+
913
+ ```typescript
914
+ import { OrqCore } from "@orq-ai/node/core.js";
915
+ import { knowledgeCreateChunks } from "@orq-ai/node/funcs/knowledgeCreateChunks.js";
916
+
917
+ // Use `OrqCore` for best tree-shaking performance.
918
+ // You can create one instance of it to use across an application.
919
+ const orq = new OrqCore({
920
+ apiKey: process.env["ORQ_API_KEY"] ?? "",
921
+ });
922
+
923
+ async function run() {
924
+ const res = await knowledgeCreateChunks(orq, {
925
+ knowledgeId: "<id>",
926
+ datasourceId: "<id>",
927
+ });
928
+
929
+ if (!res.ok) {
930
+ throw res.error;
931
+ }
932
+
933
+ const { value: result } = res;
934
+
935
+ // Handle the result
936
+ console.log(result);
937
+ }
938
+
939
+ run();
940
+ ```
941
+
942
+ ### Parameters
943
+
944
+ | Parameter | Type | Required | Description |
945
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
946
+ | `request` | [operations.CreateChunkRequest](../../models/operations/createchunkrequest.md) | :heavy_check_mark: | The request object to use for the request. |
947
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
948
+ | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
949
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
950
+
951
+ ### Response
952
+
953
+ **Promise\<[operations.CreateChunkResponseBody[]](../../models/.md)\>**
954
+
955
+ ### Errors
956
+
957
+ | Error Type | Status Code | Content Type |
958
+ | --------------- | --------------- | --------------- |
959
+ | errors.APIError | 4XX, 5XX | \*/\* |
960
+
961
+ ## listChunks
962
+
963
+ List all chunks for a datasource
964
+
965
+ ### Example Usage
966
+
967
+ ```typescript
968
+ import { Orq } from "@orq-ai/node";
969
+
970
+ const orq = new Orq({
971
+ apiKey: process.env["ORQ_API_KEY"] ?? "",
972
+ });
973
+
974
+ async function run() {
975
+ const result = await orq.knowledge.listChunks({
976
+ knowledgeId: "<id>",
977
+ datasourceId: "<id>",
978
+ status: "completed",
979
+ });
980
+
981
+ // Handle the result
982
+ console.log(result);
983
+ }
984
+
985
+ run();
986
+ ```
987
+
988
+ ### Standalone function
989
+
990
+ The standalone function version of this method:
991
+
992
+ ```typescript
993
+ import { OrqCore } from "@orq-ai/node/core.js";
994
+ import { knowledgeListChunks } from "@orq-ai/node/funcs/knowledgeListChunks.js";
995
+
996
+ // Use `OrqCore` for best tree-shaking performance.
997
+ // You can create one instance of it to use across an application.
998
+ const orq = new OrqCore({
999
+ apiKey: process.env["ORQ_API_KEY"] ?? "",
1000
+ });
1001
+
1002
+ async function run() {
1003
+ const res = await knowledgeListChunks(orq, {
1004
+ knowledgeId: "<id>",
1005
+ datasourceId: "<id>",
1006
+ status: "completed",
1007
+ });
1008
+
1009
+ if (!res.ok) {
1010
+ throw res.error;
1011
+ }
1012
+
1013
+ const { value: result } = res;
1014
+
1015
+ // Handle the result
1016
+ console.log(result);
1017
+ }
1018
+
1019
+ run();
1020
+ ```
1021
+
1022
+ ### Parameters
1023
+
1024
+ | Parameter | Type | Required | Description |
1025
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
1026
+ | `request` | [operations.ListChunksRequest](../../models/operations/listchunksrequest.md) | :heavy_check_mark: | The request object to use for the request. |
1027
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
1028
+ | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
1029
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
1030
+
1031
+ ### Response
1032
+
1033
+ **Promise\<[operations.ListChunksResponseBody](../../models/operations/listchunksresponsebody.md)\>**
1034
+
1035
+ ### Errors
1036
+
1037
+ | Error Type | Status Code | Content Type |
1038
+ | --------------- | --------------- | --------------- |
1039
+ | errors.APIError | 4XX, 5XX | \*/\* |
1040
+
1041
+ ## updateChunk
1042
+
1043
+ Update a chunk
1044
+
1045
+ ### Example Usage
1046
+
1047
+ ```typescript
1048
+ import { Orq } from "@orq-ai/node";
1049
+
1050
+ const orq = new Orq({
1051
+ apiKey: process.env["ORQ_API_KEY"] ?? "",
1052
+ });
1053
+
1054
+ async function run() {
1055
+ const result = await orq.knowledge.updateChunk({
1056
+ chunkId: "<id>",
1057
+ datasourceId: "<id>",
1058
+ knowledgeId: "<id>",
1059
+ });
1060
+
1061
+ // Handle the result
1062
+ console.log(result);
1063
+ }
1064
+
1065
+ run();
1066
+ ```
1067
+
1068
+ ### Standalone function
1069
+
1070
+ The standalone function version of this method:
1071
+
1072
+ ```typescript
1073
+ import { OrqCore } from "@orq-ai/node/core.js";
1074
+ import { knowledgeUpdateChunk } from "@orq-ai/node/funcs/knowledgeUpdateChunk.js";
1075
+
1076
+ // Use `OrqCore` for best tree-shaking performance.
1077
+ // You can create one instance of it to use across an application.
1078
+ const orq = new OrqCore({
1079
+ apiKey: process.env["ORQ_API_KEY"] ?? "",
1080
+ });
1081
+
1082
+ async function run() {
1083
+ const res = await knowledgeUpdateChunk(orq, {
1084
+ chunkId: "<id>",
1085
+ datasourceId: "<id>",
1086
+ knowledgeId: "<id>",
1087
+ });
1088
+
1089
+ if (!res.ok) {
1090
+ throw res.error;
1091
+ }
1092
+
1093
+ const { value: result } = res;
1094
+
1095
+ // Handle the result
1096
+ console.log(result);
1097
+ }
1098
+
1099
+ run();
1100
+ ```
1101
+
1102
+ ### Parameters
1103
+
1104
+ | Parameter | Type | Required | Description |
1105
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
1106
+ | `request` | [operations.UpdateChunkRequest](../../models/operations/updatechunkrequest.md) | :heavy_check_mark: | The request object to use for the request. |
1107
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
1108
+ | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
1109
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
1110
+
1111
+ ### Response
1112
+
1113
+ **Promise\<[operations.UpdateChunkResponseBody](../../models/operations/updatechunkresponsebody.md)\>**
1114
+
1115
+ ### Errors
1116
+
1117
+ | Error Type | Status Code | Content Type |
1118
+ | --------------- | --------------- | --------------- |
1119
+ | errors.APIError | 4XX, 5XX | \*/\* |
1120
+
1121
+ ## deleteChunk
1122
+
1123
+ Delete a chunk
1124
+
1125
+ ### Example Usage
1126
+
1127
+ ```typescript
1128
+ import { Orq } from "@orq-ai/node";
1129
+
1130
+ const orq = new Orq({
1131
+ apiKey: process.env["ORQ_API_KEY"] ?? "",
1132
+ });
1133
+
1134
+ async function run() {
1135
+ await orq.knowledge.deleteChunk({
1136
+ chunkId: "<id>",
1137
+ datasourceId: "<id>",
1138
+ knowledgeId: "<id>",
1139
+ });
1140
+
1141
+
1142
+ }
1143
+
1144
+ run();
1145
+ ```
1146
+
1147
+ ### Standalone function
1148
+
1149
+ The standalone function version of this method:
1150
+
1151
+ ```typescript
1152
+ import { OrqCore } from "@orq-ai/node/core.js";
1153
+ import { knowledgeDeleteChunk } from "@orq-ai/node/funcs/knowledgeDeleteChunk.js";
1154
+
1155
+ // Use `OrqCore` for best tree-shaking performance.
1156
+ // You can create one instance of it to use across an application.
1157
+ const orq = new OrqCore({
1158
+ apiKey: process.env["ORQ_API_KEY"] ?? "",
1159
+ });
1160
+
1161
+ async function run() {
1162
+ const res = await knowledgeDeleteChunk(orq, {
1163
+ chunkId: "<id>",
1164
+ datasourceId: "<id>",
1165
+ knowledgeId: "<id>",
1166
+ });
1167
+
1168
+ if (!res.ok) {
1169
+ throw res.error;
1170
+ }
1171
+
1172
+ const { value: result } = res;
1173
+
1174
+
1175
+ }
1176
+
1177
+ run();
1178
+ ```
1179
+
1180
+ ### Parameters
1181
+
1182
+ | Parameter | Type | Required | Description |
1183
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
1184
+ | `request` | [operations.DeleteChunkRequest](../../models/operations/deletechunkrequest.md) | :heavy_check_mark: | The request object to use for the request. |
1185
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
1186
+ | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
1187
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
1188
+
1189
+ ### Response
1190
+
1191
+ **Promise\<void\>**
1192
+
1193
+ ### Errors
1194
+
1195
+ | Error Type | Status Code | Content Type |
1196
+ | --------------- | --------------- | --------------- |
1197
+ | errors.APIError | 4XX, 5XX | \*/\* |