@orq-ai/node 3.3.2 → 3.4.0-rc.0

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