@orq-ai/node 3.10.4 → 3.11.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (487) hide show
  1. package/bin/mcp-server.js +105 -123
  2. package/bin/mcp-server.js.map +30 -30
  3. package/examples/package-lock.json +5 -6
  4. package/jsr.json +1 -1
  5. package/lib/config.d.ts +2 -2
  6. package/lib/config.js +2 -2
  7. package/lib/config.js.map +1 -1
  8. package/mcp-server/mcp-server.js +1 -1
  9. package/mcp-server/mcp-server.js.map +1 -1
  10. package/mcp-server/server.js +1 -1
  11. package/mcp-server/server.js.map +1 -1
  12. package/models/operations/createcontact.js +2 -2
  13. package/models/operations/createdataset.js +2 -2
  14. package/models/operations/createdatasetitem.js +2 -2
  15. package/models/operations/createdatasource.js +2 -2
  16. package/models/operations/createeval.js +16 -16
  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/getevals.js +28 -28
  21. package/models/operations/listcontacts.js +2 -2
  22. package/models/operations/listdatasetdatapoints.js +2 -2
  23. package/models/operations/listdatasets.js +2 -2
  24. package/models/operations/listdatasources.js +2 -2
  25. package/models/operations/retrievecontact.js +2 -2
  26. package/models/operations/retrievedatapoint.js +2 -2
  27. package/models/operations/retrievedataset.js +2 -2
  28. package/models/operations/retrievedatasource.js +2 -2
  29. package/models/operations/searchknowledge.d.ts +0 -40
  30. package/models/operations/searchknowledge.d.ts.map +1 -1
  31. package/models/operations/searchknowledge.js +4 -32
  32. package/models/operations/searchknowledge.js.map +1 -1
  33. package/models/operations/updatecontact.js +2 -2
  34. package/models/operations/updatedatapoint.js +2 -2
  35. package/models/operations/updatedataset.js +2 -2
  36. package/models/operations/updatedatasource.js +2 -2
  37. package/models/operations/updateeval.js +16 -16
  38. package/package.json +4 -4
  39. package/src/lib/config.ts +2 -2
  40. package/src/mcp-server/mcp-server.ts +1 -1
  41. package/src/mcp-server/server.ts +1 -1
  42. package/src/models/operations/createcontact.ts +2 -2
  43. package/src/models/operations/createdataset.ts +2 -2
  44. package/src/models/operations/createdatasetitem.ts +2 -2
  45. package/src/models/operations/createdatasource.ts +2 -2
  46. package/src/models/operations/createeval.ts +16 -16
  47. package/src/models/operations/fileget.ts +2 -2
  48. package/src/models/operations/filelist.ts +2 -2
  49. package/src/models/operations/fileupload.ts +2 -2
  50. package/src/models/operations/getevals.ts +28 -28
  51. package/src/models/operations/listcontacts.ts +2 -2
  52. package/src/models/operations/listdatasetdatapoints.ts +2 -2
  53. package/src/models/operations/listdatasets.ts +2 -2
  54. package/src/models/operations/listdatasources.ts +2 -2
  55. package/src/models/operations/retrievecontact.ts +2 -2
  56. package/src/models/operations/retrievedatapoint.ts +2 -2
  57. package/src/models/operations/retrievedataset.ts +2 -2
  58. package/src/models/operations/retrievedatasource.ts +2 -2
  59. package/src/models/operations/searchknowledge.ts +0 -42
  60. package/src/models/operations/updatecontact.ts +2 -2
  61. package/src/models/operations/updatedatapoint.ts +2 -2
  62. package/src/models/operations/updatedataset.ts +2 -2
  63. package/src/models/operations/updatedatasource.ts +2 -2
  64. package/src/models/operations/updateeval.ts +16 -16
  65. package/packages/orq-rc/FUNCTIONS.md +0 -103
  66. package/packages/orq-rc/README.md +0 -960
  67. package/packages/orq-rc/RUNTIMES.md +0 -48
  68. package/packages/orq-rc/docs/sdks/chunking/README.md +0 -95
  69. package/packages/orq-rc/docs/sdks/contacts/README.md +0 -450
  70. package/packages/orq-rc/docs/sdks/datasets/README.md +0 -836
  71. package/packages/orq-rc/docs/sdks/deployments/README.md +0 -314
  72. package/packages/orq-rc/docs/sdks/evals/README.md +0 -3077
  73. package/packages/orq-rc/docs/sdks/feedback/README.md +0 -89
  74. package/packages/orq-rc/docs/sdks/files/README.md +0 -301
  75. package/packages/orq-rc/docs/sdks/knowledge/README.md +0 -1243
  76. package/packages/orq-rc/docs/sdks/metrics/README.md +0 -83
  77. package/packages/orq-rc/docs/sdks/models/README.md +0 -76
  78. package/packages/orq-rc/docs/sdks/orq/README.md +0 -10
  79. package/packages/orq-rc/docs/sdks/prompts/README.md +0 -557
  80. package/packages/orq-rc/docs/sdks/remoteconfigs/README.md +0 -77
  81. package/packages/orq-rc/examples/README.md +0 -31
  82. package/packages/orq-rc/examples/contactsCreate.example.ts +0 -42
  83. package/packages/orq-rc/examples/package-lock.json +0 -627
  84. package/packages/orq-rc/examples/package.json +0 -18
  85. package/packages/orq-rc/jsr.json +0 -28
  86. package/packages/orq-rc/package-lock.json +0 -3018
  87. package/packages/orq-rc/package.json +0 -43
  88. package/packages/orq-rc/src/core.ts +0 -13
  89. package/packages/orq-rc/src/funcs/chunkingParse.ts +0 -160
  90. package/packages/orq-rc/src/funcs/contactsCreate.ts +0 -165
  91. package/packages/orq-rc/src/funcs/contactsDelete.ts +0 -176
  92. package/packages/orq-rc/src/funcs/contactsList.ts +0 -169
  93. package/packages/orq-rc/src/funcs/contactsRetrieve.ts +0 -175
  94. package/packages/orq-rc/src/funcs/contactsUpdate.ts +0 -176
  95. package/packages/orq-rc/src/funcs/datasetsClear.ts +0 -167
  96. package/packages/orq-rc/src/funcs/datasetsCreate.ts +0 -165
  97. package/packages/orq-rc/src/funcs/datasetsCreateDatapoint.ts +0 -167
  98. package/packages/orq-rc/src/funcs/datasetsDelete.ts +0 -167
  99. package/packages/orq-rc/src/funcs/datasetsDeleteDatapoint.ts +0 -182
  100. package/packages/orq-rc/src/funcs/datasetsList.ts +0 -167
  101. package/packages/orq-rc/src/funcs/datasetsListDatapoints.ts +0 -174
  102. package/packages/orq-rc/src/funcs/datasetsRetrieve.ts +0 -175
  103. package/packages/orq-rc/src/funcs/datasetsRetrieveDatapoint.ts +0 -181
  104. package/packages/orq-rc/src/funcs/datasetsUpdate.ts +0 -176
  105. package/packages/orq-rc/src/funcs/datasetsUpdateDatapoint.ts +0 -179
  106. package/packages/orq-rc/src/funcs/deploymentsGetConfig.ts +0 -168
  107. package/packages/orq-rc/src/funcs/deploymentsInvoke.ts +0 -176
  108. package/packages/orq-rc/src/funcs/deploymentsList.ts +0 -176
  109. package/packages/orq-rc/src/funcs/deploymentsMetricsCreate.ts +0 -168
  110. package/packages/orq-rc/src/funcs/deploymentsStream.ts +0 -183
  111. package/packages/orq-rc/src/funcs/evalsAgeAppropriate.ts +0 -175
  112. package/packages/orq-rc/src/funcs/evalsAll.ts +0 -173
  113. package/packages/orq-rc/src/funcs/evalsBertScore.ts +0 -175
  114. package/packages/orq-rc/src/funcs/evalsBleuScore.ts +0 -175
  115. package/packages/orq-rc/src/funcs/evalsBotDetection.ts +0 -175
  116. package/packages/orq-rc/src/funcs/evalsContains.ts +0 -175
  117. package/packages/orq-rc/src/funcs/evalsContainsAll.ts +0 -175
  118. package/packages/orq-rc/src/funcs/evalsContainsAny.ts +0 -175
  119. package/packages/orq-rc/src/funcs/evalsContainsEmail.ts +0 -175
  120. package/packages/orq-rc/src/funcs/evalsContainsNone.ts +0 -175
  121. package/packages/orq-rc/src/funcs/evalsContainsUrl.ts +0 -175
  122. package/packages/orq-rc/src/funcs/evalsContainsValidLink.ts +0 -177
  123. package/packages/orq-rc/src/funcs/evalsCreate.ts +0 -169
  124. package/packages/orq-rc/src/funcs/evalsDelete.ts +0 -173
  125. package/packages/orq-rc/src/funcs/evalsEndsWith.ts +0 -175
  126. package/packages/orq-rc/src/funcs/evalsExactMatch.ts +0 -175
  127. package/packages/orq-rc/src/funcs/evalsFactCheckingKnowledgeBase.ts +0 -183
  128. package/packages/orq-rc/src/funcs/evalsGrammar.ts +0 -173
  129. package/packages/orq-rc/src/funcs/evalsInvoke.ts +0 -177
  130. package/packages/orq-rc/src/funcs/evalsLengthBetween.ts +0 -175
  131. package/packages/orq-rc/src/funcs/evalsLengthGreaterThan.ts +0 -177
  132. package/packages/orq-rc/src/funcs/evalsLengthLessThan.ts +0 -175
  133. package/packages/orq-rc/src/funcs/evalsLocalization.ts +0 -175
  134. package/packages/orq-rc/src/funcs/evalsPii.ts +0 -173
  135. package/packages/orq-rc/src/funcs/evalsRagasCoherence.ts +0 -175
  136. package/packages/orq-rc/src/funcs/evalsRagasConciseness.ts +0 -174
  137. package/packages/orq-rc/src/funcs/evalsRagasContextEntitiesRecall.ts +0 -183
  138. package/packages/orq-rc/src/funcs/evalsRagasContextPrecision.ts +0 -180
  139. package/packages/orq-rc/src/funcs/evalsRagasContextRecall.ts +0 -177
  140. package/packages/orq-rc/src/funcs/evalsRagasCorrectness.ts +0 -174
  141. package/packages/orq-rc/src/funcs/evalsRagasFaithfulness.ts +0 -177
  142. package/packages/orq-rc/src/funcs/evalsRagasHarmfulness.ts +0 -174
  143. package/packages/orq-rc/src/funcs/evalsRagasMaliciousness.ts +0 -177
  144. package/packages/orq-rc/src/funcs/evalsRagasNoiseSensitivity.ts +0 -180
  145. package/packages/orq-rc/src/funcs/evalsRagasResponseRelevancy.ts +0 -183
  146. package/packages/orq-rc/src/funcs/evalsRagasSummarization.ts +0 -177
  147. package/packages/orq-rc/src/funcs/evalsSentimentClassification.ts +0 -183
  148. package/packages/orq-rc/src/funcs/evalsSummarization.ts +0 -175
  149. package/packages/orq-rc/src/funcs/evalsToneOfVoice.ts +0 -175
  150. package/packages/orq-rc/src/funcs/evalsTranslation.ts +0 -175
  151. package/packages/orq-rc/src/funcs/evalsUpdate.ts +0 -173
  152. package/packages/orq-rc/src/funcs/evalsValidJson.ts +0 -175
  153. package/packages/orq-rc/src/funcs/feedbackCreate.ts +0 -160
  154. package/packages/orq-rc/src/funcs/filesCreate.ts +0 -187
  155. package/packages/orq-rc/src/funcs/filesDelete.ts +0 -164
  156. package/packages/orq-rc/src/funcs/filesGet.ts +0 -166
  157. package/packages/orq-rc/src/funcs/filesList.ts +0 -167
  158. package/packages/orq-rc/src/funcs/knowledgeCreate.ts +0 -158
  159. package/packages/orq-rc/src/funcs/knowledgeCreateChunks.ts +0 -171
  160. package/packages/orq-rc/src/funcs/knowledgeCreateDatasource.ts +0 -166
  161. package/packages/orq-rc/src/funcs/knowledgeDelete.ts +0 -167
  162. package/packages/orq-rc/src/funcs/knowledgeDeleteChunk.ts +0 -174
  163. package/packages/orq-rc/src/funcs/knowledgeDeleteDatasource.ts +0 -173
  164. package/packages/orq-rc/src/funcs/knowledgeList.ts +0 -169
  165. package/packages/orq-rc/src/funcs/knowledgeListChunks.ts +0 -178
  166. package/packages/orq-rc/src/funcs/knowledgeListDatasources.ts +0 -174
  167. package/packages/orq-rc/src/funcs/knowledgeRetrieve.ts +0 -166
  168. package/packages/orq-rc/src/funcs/knowledgeRetrieveChunk.ts +0 -173
  169. package/packages/orq-rc/src/funcs/knowledgeRetrieveDatasource.ts +0 -169
  170. package/packages/orq-rc/src/funcs/knowledgeSearch.ts +0 -167
  171. package/packages/orq-rc/src/funcs/knowledgeUpdate.ts +0 -164
  172. package/packages/orq-rc/src/funcs/knowledgeUpdateChunk.ts +0 -174
  173. package/packages/orq-rc/src/funcs/knowledgeUpdateDatasource.ts +0 -170
  174. package/packages/orq-rc/src/funcs/modelsList.ts +0 -142
  175. package/packages/orq-rc/src/funcs/promptsCreate.ts +0 -160
  176. package/packages/orq-rc/src/funcs/promptsDelete.ts +0 -164
  177. package/packages/orq-rc/src/funcs/promptsGetVersion.ts +0 -181
  178. package/packages/orq-rc/src/funcs/promptsList.ts +0 -167
  179. package/packages/orq-rc/src/funcs/promptsListVersions.ts +0 -173
  180. package/packages/orq-rc/src/funcs/promptsRetrieve.ts +0 -166
  181. package/packages/orq-rc/src/funcs/promptsUpdate.ts +0 -173
  182. package/packages/orq-rc/src/funcs/remoteconfigsRetrieve.ts +0 -161
  183. package/packages/orq-rc/src/hooks/global.ts +0 -44
  184. package/packages/orq-rc/src/hooks/hooks.ts +0 -132
  185. package/packages/orq-rc/src/hooks/index.ts +0 -6
  186. package/packages/orq-rc/src/hooks/registration.ts +0 -15
  187. package/packages/orq-rc/src/hooks/types.ts +0 -112
  188. package/packages/orq-rc/src/index.ts +0 -9
  189. package/packages/orq-rc/src/lib/base64.ts +0 -37
  190. package/packages/orq-rc/src/lib/config.ts +0 -74
  191. package/packages/orq-rc/src/lib/dlv.ts +0 -53
  192. package/packages/orq-rc/src/lib/encodings.ts +0 -483
  193. package/packages/orq-rc/src/lib/env.ts +0 -73
  194. package/packages/orq-rc/src/lib/event-streams.ts +0 -137
  195. package/packages/orq-rc/src/lib/files.ts +0 -82
  196. package/packages/orq-rc/src/lib/http.ts +0 -323
  197. package/packages/orq-rc/src/lib/is-plain-object.ts +0 -43
  198. package/packages/orq-rc/src/lib/logger.ts +0 -9
  199. package/packages/orq-rc/src/lib/matchers.ts +0 -345
  200. package/packages/orq-rc/src/lib/primitives.ts +0 -150
  201. package/packages/orq-rc/src/lib/retries.ts +0 -218
  202. package/packages/orq-rc/src/lib/schemas.ts +0 -91
  203. package/packages/orq-rc/src/lib/sdks.ts +0 -407
  204. package/packages/orq-rc/src/lib/security.ts +0 -261
  205. package/packages/orq-rc/src/lib/url.ts +0 -33
  206. package/packages/orq-rc/src/mcp-server/cli/start/command.ts +0 -112
  207. package/packages/orq-rc/src/mcp-server/cli/start/impl.ts +0 -136
  208. package/packages/orq-rc/src/mcp-server/cli.ts +0 -13
  209. package/packages/orq-rc/src/mcp-server/console-logger.ts +0 -71
  210. package/packages/orq-rc/src/mcp-server/extensions.ts +0 -17
  211. package/packages/orq-rc/src/mcp-server/mcp-server.ts +0 -26
  212. package/packages/orq-rc/src/mcp-server/prompts.ts +0 -117
  213. package/packages/orq-rc/src/mcp-server/resources.ts +0 -172
  214. package/packages/orq-rc/src/mcp-server/scopes.ts +0 -7
  215. package/packages/orq-rc/src/mcp-server/server.ts +0 -251
  216. package/packages/orq-rc/src/mcp-server/shared.ts +0 -75
  217. package/packages/orq-rc/src/mcp-server/tools/chunkingParse.ts +0 -37
  218. package/packages/orq-rc/src/mcp-server/tools/contactsCreate.ts +0 -37
  219. package/packages/orq-rc/src/mcp-server/tools/contactsDelete.ts +0 -35
  220. package/packages/orq-rc/src/mcp-server/tools/contactsList.ts +0 -37
  221. package/packages/orq-rc/src/mcp-server/tools/contactsRetrieve.ts +0 -37
  222. package/packages/orq-rc/src/mcp-server/tools/contactsUpdate.ts +0 -37
  223. package/packages/orq-rc/src/mcp-server/tools/datasetsClear.ts +0 -35
  224. package/packages/orq-rc/src/mcp-server/tools/datasetsCreate.ts +0 -37
  225. package/packages/orq-rc/src/mcp-server/tools/datasetsCreateDatapoint.ts +0 -37
  226. package/packages/orq-rc/src/mcp-server/tools/datasetsDelete.ts +0 -35
  227. package/packages/orq-rc/src/mcp-server/tools/datasetsDeleteDatapoint.ts +0 -35
  228. package/packages/orq-rc/src/mcp-server/tools/datasetsList.ts +0 -37
  229. package/packages/orq-rc/src/mcp-server/tools/datasetsListDatapoints.ts +0 -37
  230. package/packages/orq-rc/src/mcp-server/tools/datasetsRetrieve.ts +0 -37
  231. package/packages/orq-rc/src/mcp-server/tools/datasetsRetrieveDatapoint.ts +0 -37
  232. package/packages/orq-rc/src/mcp-server/tools/datasetsUpdate.ts +0 -37
  233. package/packages/orq-rc/src/mcp-server/tools/datasetsUpdateDatapoint.ts +0 -35
  234. package/packages/orq-rc/src/mcp-server/tools/deploymentsGetConfig.ts +0 -37
  235. package/packages/orq-rc/src/mcp-server/tools/deploymentsInvoke.ts +0 -37
  236. package/packages/orq-rc/src/mcp-server/tools/deploymentsList.ts +0 -37
  237. package/packages/orq-rc/src/mcp-server/tools/deploymentsMetricsCreate.ts +0 -37
  238. package/packages/orq-rc/src/mcp-server/tools/deploymentsStream.ts +0 -37
  239. package/packages/orq-rc/src/mcp-server/tools/evalsAgeAppropriate.ts +0 -35
  240. package/packages/orq-rc/src/mcp-server/tools/evalsAll.ts +0 -35
  241. package/packages/orq-rc/src/mcp-server/tools/evalsBertScore.ts +0 -35
  242. package/packages/orq-rc/src/mcp-server/tools/evalsBleuScore.ts +0 -35
  243. package/packages/orq-rc/src/mcp-server/tools/evalsBotDetection.ts +0 -35
  244. package/packages/orq-rc/src/mcp-server/tools/evalsContains.ts +0 -35
  245. package/packages/orq-rc/src/mcp-server/tools/evalsContainsAll.ts +0 -35
  246. package/packages/orq-rc/src/mcp-server/tools/evalsContainsAny.ts +0 -35
  247. package/packages/orq-rc/src/mcp-server/tools/evalsContainsEmail.ts +0 -35
  248. package/packages/orq-rc/src/mcp-server/tools/evalsContainsNone.ts +0 -35
  249. package/packages/orq-rc/src/mcp-server/tools/evalsContainsUrl.ts +0 -35
  250. package/packages/orq-rc/src/mcp-server/tools/evalsContainsValidLink.ts +0 -36
  251. package/packages/orq-rc/src/mcp-server/tools/evalsCreate.ts +0 -35
  252. package/packages/orq-rc/src/mcp-server/tools/evalsDelete.ts +0 -33
  253. package/packages/orq-rc/src/mcp-server/tools/evalsEndsWith.ts +0 -35
  254. package/packages/orq-rc/src/mcp-server/tools/evalsExactMatch.ts +0 -35
  255. package/packages/orq-rc/src/mcp-server/tools/evalsFactCheckingKnowledgeBase.ts +0 -37
  256. package/packages/orq-rc/src/mcp-server/tools/evalsGrammar.ts +0 -35
  257. package/packages/orq-rc/src/mcp-server/tools/evalsInvoke.ts +0 -35
  258. package/packages/orq-rc/src/mcp-server/tools/evalsLengthBetween.ts +0 -35
  259. package/packages/orq-rc/src/mcp-server/tools/evalsLengthGreaterThan.ts +0 -36
  260. package/packages/orq-rc/src/mcp-server/tools/evalsLengthLessThan.ts +0 -35
  261. package/packages/orq-rc/src/mcp-server/tools/evalsLocalization.ts +0 -35
  262. package/packages/orq-rc/src/mcp-server/tools/evalsPii.ts +0 -35
  263. package/packages/orq-rc/src/mcp-server/tools/evalsRagasCoherence.ts +0 -35
  264. package/packages/orq-rc/src/mcp-server/tools/evalsRagasConciseness.ts +0 -35
  265. package/packages/orq-rc/src/mcp-server/tools/evalsRagasContextEntitiesRecall.ts +0 -37
  266. package/packages/orq-rc/src/mcp-server/tools/evalsRagasContextPrecision.ts +0 -36
  267. package/packages/orq-rc/src/mcp-server/tools/evalsRagasContextRecall.ts +0 -36
  268. package/packages/orq-rc/src/mcp-server/tools/evalsRagasCorrectness.ts +0 -35
  269. package/packages/orq-rc/src/mcp-server/tools/evalsRagasFaithfulness.ts +0 -36
  270. package/packages/orq-rc/src/mcp-server/tools/evalsRagasHarmfulness.ts +0 -35
  271. package/packages/orq-rc/src/mcp-server/tools/evalsRagasMaliciousness.ts +0 -36
  272. package/packages/orq-rc/src/mcp-server/tools/evalsRagasNoiseSensitivity.ts +0 -36
  273. package/packages/orq-rc/src/mcp-server/tools/evalsRagasResponseRelevancy.ts +0 -36
  274. package/packages/orq-rc/src/mcp-server/tools/evalsRagasSummarization.ts +0 -36
  275. package/packages/orq-rc/src/mcp-server/tools/evalsSentimentClassification.ts +0 -36
  276. package/packages/orq-rc/src/mcp-server/tools/evalsSummarization.ts +0 -35
  277. package/packages/orq-rc/src/mcp-server/tools/evalsToneOfVoice.ts +0 -35
  278. package/packages/orq-rc/src/mcp-server/tools/evalsTranslation.ts +0 -35
  279. package/packages/orq-rc/src/mcp-server/tools/evalsUpdate.ts +0 -35
  280. package/packages/orq-rc/src/mcp-server/tools/evalsValidJson.ts +0 -35
  281. package/packages/orq-rc/src/mcp-server/tools/feedbackCreate.ts +0 -37
  282. package/packages/orq-rc/src/mcp-server/tools/filesCreate.ts +0 -37
  283. package/packages/orq-rc/src/mcp-server/tools/filesDelete.ts +0 -33
  284. package/packages/orq-rc/src/mcp-server/tools/filesGet.ts +0 -37
  285. package/packages/orq-rc/src/mcp-server/tools/filesList.ts +0 -37
  286. package/packages/orq-rc/src/mcp-server/tools/knowledgeCreate.ts +0 -35
  287. package/packages/orq-rc/src/mcp-server/tools/knowledgeCreateChunks.ts +0 -35
  288. package/packages/orq-rc/src/mcp-server/tools/knowledgeCreateDatasource.ts +0 -35
  289. package/packages/orq-rc/src/mcp-server/tools/knowledgeDelete.ts +0 -35
  290. package/packages/orq-rc/src/mcp-server/tools/knowledgeDeleteChunk.ts +0 -33
  291. package/packages/orq-rc/src/mcp-server/tools/knowledgeDeleteDatasource.ts +0 -35
  292. package/packages/orq-rc/src/mcp-server/tools/knowledgeList.ts +0 -37
  293. package/packages/orq-rc/src/mcp-server/tools/knowledgeListChunks.ts +0 -35
  294. package/packages/orq-rc/src/mcp-server/tools/knowledgeListDatasources.ts +0 -35
  295. package/packages/orq-rc/src/mcp-server/tools/knowledgeRetrieve.ts +0 -37
  296. package/packages/orq-rc/src/mcp-server/tools/knowledgeRetrieveChunk.ts +0 -35
  297. package/packages/orq-rc/src/mcp-server/tools/knowledgeRetrieveDatasource.ts +0 -35
  298. package/packages/orq-rc/src/mcp-server/tools/knowledgeSearch.ts +0 -37
  299. package/packages/orq-rc/src/mcp-server/tools/knowledgeUpdate.ts +0 -35
  300. package/packages/orq-rc/src/mcp-server/tools/knowledgeUpdateChunk.ts +0 -35
  301. package/packages/orq-rc/src/mcp-server/tools/knowledgeUpdateDatasource.ts +0 -35
  302. package/packages/orq-rc/src/mcp-server/tools/modelsList.ts +0 -30
  303. package/packages/orq-rc/src/mcp-server/tools/promptsCreate.ts +0 -35
  304. package/packages/orq-rc/src/mcp-server/tools/promptsDelete.ts +0 -33
  305. package/packages/orq-rc/src/mcp-server/tools/promptsGetVersion.ts +0 -37
  306. package/packages/orq-rc/src/mcp-server/tools/promptsList.ts +0 -37
  307. package/packages/orq-rc/src/mcp-server/tools/promptsListVersions.ts +0 -37
  308. package/packages/orq-rc/src/mcp-server/tools/promptsRetrieve.ts +0 -37
  309. package/packages/orq-rc/src/mcp-server/tools/promptsUpdate.ts +0 -35
  310. package/packages/orq-rc/src/mcp-server/tools/remoteconfigsRetrieve.ts +0 -36
  311. package/packages/orq-rc/src/mcp-server/tools.ts +0 -129
  312. package/packages/orq-rc/src/models/components/deployments.ts +0 -7246
  313. package/packages/orq-rc/src/models/components/index.ts +0 -6
  314. package/packages/orq-rc/src/models/components/security.ts +0 -71
  315. package/packages/orq-rc/src/models/errors/apierror.ts +0 -40
  316. package/packages/orq-rc/src/models/errors/createeval.ts +0 -80
  317. package/packages/orq-rc/src/models/errors/deletecontact.ts +0 -91
  318. package/packages/orq-rc/src/models/errors/deleteeval.ts +0 -80
  319. package/packages/orq-rc/src/models/errors/evalsageappropriate.ts +0 -156
  320. package/packages/orq-rc/src/models/errors/evalsbertscore.ts +0 -154
  321. package/packages/orq-rc/src/models/errors/evalsbleuscore.ts +0 -154
  322. package/packages/orq-rc/src/models/errors/evalsbotdetection.ts +0 -155
  323. package/packages/orq-rc/src/models/errors/evalscontains.ts +0 -154
  324. package/packages/orq-rc/src/models/errors/evalscontainsall.ts +0 -155
  325. package/packages/orq-rc/src/models/errors/evalscontainsany.ts +0 -155
  326. package/packages/orq-rc/src/models/errors/evalscontainsemail.ts +0 -156
  327. package/packages/orq-rc/src/models/errors/evalscontainsnone.ts +0 -155
  328. package/packages/orq-rc/src/models/errors/evalscontainsurl.ts +0 -155
  329. package/packages/orq-rc/src/models/errors/evalscontainsvalidlink.ts +0 -157
  330. package/packages/orq-rc/src/models/errors/evalsendswith.ts +0 -154
  331. package/packages/orq-rc/src/models/errors/evalsexactmatch.ts +0 -154
  332. package/packages/orq-rc/src/models/errors/evalsfactcheckingknowledgebase.ts +0 -160
  333. package/packages/orq-rc/src/models/errors/evalsgrammar.ts +0 -154
  334. package/packages/orq-rc/src/models/errors/evalslengthbetween.ts +0 -156
  335. package/packages/orq-rc/src/models/errors/evalslengthgreaterthan.ts +0 -157
  336. package/packages/orq-rc/src/models/errors/evalslengthlessthan.ts +0 -156
  337. package/packages/orq-rc/src/models/errors/evalslocalization.ts +0 -155
  338. package/packages/orq-rc/src/models/errors/evalspii.ts +0 -154
  339. package/packages/orq-rc/src/models/errors/evalsragascoherence.ts +0 -156
  340. package/packages/orq-rc/src/models/errors/evalsragasconciseness.ts +0 -157
  341. package/packages/orq-rc/src/models/errors/evalsragascontextentitiesrecall.ts +0 -163
  342. package/packages/orq-rc/src/models/errors/evalsragascontextprecision.ts +0 -160
  343. package/packages/orq-rc/src/models/errors/evalsragascontextrecall.ts +0 -158
  344. package/packages/orq-rc/src/models/errors/evalsragascorrectness.ts +0 -157
  345. package/packages/orq-rc/src/models/errors/evalsragasfaithfulness.ts +0 -157
  346. package/packages/orq-rc/src/models/errors/evalsragasharmfulness.ts +0 -157
  347. package/packages/orq-rc/src/models/errors/evalsragasmaliciousness.ts +0 -158
  348. package/packages/orq-rc/src/models/errors/evalsragasnoisesensitivity.ts +0 -160
  349. package/packages/orq-rc/src/models/errors/evalsragasresponserelevancy.ts +0 -160
  350. package/packages/orq-rc/src/models/errors/evalsragassummarization.ts +0 -158
  351. package/packages/orq-rc/src/models/errors/evalssentimentclassification.ts +0 -160
  352. package/packages/orq-rc/src/models/errors/evalssummarization.ts +0 -156
  353. package/packages/orq-rc/src/models/errors/evalstoneofvoice.ts +0 -155
  354. package/packages/orq-rc/src/models/errors/evalstranslation.ts +0 -155
  355. package/packages/orq-rc/src/models/errors/evalsvalidjson.ts +0 -154
  356. package/packages/orq-rc/src/models/errors/getevals.ts +0 -80
  357. package/packages/orq-rc/src/models/errors/getpromptversion.ts +0 -80
  358. package/packages/orq-rc/src/models/errors/honoapierror.ts +0 -90
  359. package/packages/orq-rc/src/models/errors/httpclienterrors.ts +0 -62
  360. package/packages/orq-rc/src/models/errors/index.ts +0 -56
  361. package/packages/orq-rc/src/models/errors/invokeeval.ts +0 -154
  362. package/packages/orq-rc/src/models/errors/orqerror.ts +0 -35
  363. package/packages/orq-rc/src/models/errors/responsevalidationerror.ts +0 -50
  364. package/packages/orq-rc/src/models/errors/retrievecontact.ts +0 -91
  365. package/packages/orq-rc/src/models/errors/sdkvalidationerror.ts +0 -109
  366. package/packages/orq-rc/src/models/errors/updatecontact.ts +0 -83
  367. package/packages/orq-rc/src/models/errors/updateeval.ts +0 -80
  368. package/packages/orq-rc/src/models/errors/updateprompt.ts +0 -80
  369. package/packages/orq-rc/src/models/operations/cleardataset.ts +0 -75
  370. package/packages/orq-rc/src/models/operations/createchunk.ts +0 -428
  371. package/packages/orq-rc/src/models/operations/createcontact.ts +0 -267
  372. package/packages/orq-rc/src/models/operations/createdataset.ts +0 -296
  373. package/packages/orq-rc/src/models/operations/createdatasetitem.ts +0 -5222
  374. package/packages/orq-rc/src/models/operations/createdatasource.ts +0 -852
  375. package/packages/orq-rc/src/models/operations/createeval.ts +0 -3830
  376. package/packages/orq-rc/src/models/operations/createfeedback.ts +0 -286
  377. package/packages/orq-rc/src/models/operations/createknowledge.ts +0 -846
  378. package/packages/orq-rc/src/models/operations/createprompt.ts +0 -4087
  379. package/packages/orq-rc/src/models/operations/deletechunk.ts +0 -96
  380. package/packages/orq-rc/src/models/operations/deletecontact.ts +0 -69
  381. package/packages/orq-rc/src/models/operations/deletedatapoint.ts +0 -81
  382. package/packages/orq-rc/src/models/operations/deletedataset.ts +0 -75
  383. package/packages/orq-rc/src/models/operations/deletedatasource.ts +0 -87
  384. package/packages/orq-rc/src/models/operations/deleteeval.ts +0 -66
  385. package/packages/orq-rc/src/models/operations/deleteknowledge.ts +0 -78
  386. package/packages/orq-rc/src/models/operations/deleteprompt.ts +0 -69
  387. package/packages/orq-rc/src/models/operations/deploymentcreatemetric.ts +0 -5439
  388. package/packages/orq-rc/src/models/operations/deploymentgetconfig.ts +0 -9336
  389. package/packages/orq-rc/src/models/operations/deploymentinvoke.ts +0 -1258
  390. package/packages/orq-rc/src/models/operations/deployments.ts +0 -2330
  391. package/packages/orq-rc/src/models/operations/deploymentstream.ts +0 -9449
  392. package/packages/orq-rc/src/models/operations/evalsageappropriate.ts +0 -253
  393. package/packages/orq-rc/src/models/operations/evalsbertscore.ts +0 -197
  394. package/packages/orq-rc/src/models/operations/evalsbleuscore.ts +0 -131
  395. package/packages/orq-rc/src/models/operations/evalsbotdetection.ts +0 -249
  396. package/packages/orq-rc/src/models/operations/evalscontains.ts +0 -250
  397. package/packages/orq-rc/src/models/operations/evalscontainsall.ts +0 -248
  398. package/packages/orq-rc/src/models/operations/evalscontainsany.ts +0 -254
  399. package/packages/orq-rc/src/models/operations/evalscontainsemail.ts +0 -181
  400. package/packages/orq-rc/src/models/operations/evalscontainsnone.ts +0 -254
  401. package/packages/orq-rc/src/models/operations/evalscontainsurl.ts +0 -181
  402. package/packages/orq-rc/src/models/operations/evalscontainsvalidlink.ts +0 -186
  403. package/packages/orq-rc/src/models/operations/evalsendswith.ts +0 -250
  404. package/packages/orq-rc/src/models/operations/evalsexactmatch.ts +0 -183
  405. package/packages/orq-rc/src/models/operations/evalsfactcheckingknowledgebase.ts +0 -299
  406. package/packages/orq-rc/src/models/operations/evalsgrammar.ts +0 -243
  407. package/packages/orq-rc/src/models/operations/evalslengthbetween.ts +0 -268
  408. package/packages/orq-rc/src/models/operations/evalslengthgreaterthan.ts +0 -266
  409. package/packages/orq-rc/src/models/operations/evalslengthlessthan.ts +0 -259
  410. package/packages/orq-rc/src/models/operations/evalslocalization.ts +0 -253
  411. package/packages/orq-rc/src/models/operations/evalspii.ts +0 -243
  412. package/packages/orq-rc/src/models/operations/evalsragascoherence.ts +0 -152
  413. package/packages/orq-rc/src/models/operations/evalsragasconciseness.ts +0 -153
  414. package/packages/orq-rc/src/models/operations/evalsragascontextentitiesrecall.ts +0 -164
  415. package/packages/orq-rc/src/models/operations/evalsragascontextprecision.ts +0 -166
  416. package/packages/orq-rc/src/models/operations/evalsragascontextrecall.ts +0 -164
  417. package/packages/orq-rc/src/models/operations/evalsragascorrectness.ts +0 -153
  418. package/packages/orq-rc/src/models/operations/evalsragasfaithfulness.ts +0 -155
  419. package/packages/orq-rc/src/models/operations/evalsragasharmfulness.ts +0 -146
  420. package/packages/orq-rc/src/models/operations/evalsragasmaliciousness.ts +0 -157
  421. package/packages/orq-rc/src/models/operations/evalsragasnoisesensitivity.ts +0 -166
  422. package/packages/orq-rc/src/models/operations/evalsragasresponserelevancy.ts +0 -165
  423. package/packages/orq-rc/src/models/operations/evalsragassummarization.ts +0 -150
  424. package/packages/orq-rc/src/models/operations/evalssentimentclassification.ts +0 -285
  425. package/packages/orq-rc/src/models/operations/evalssummarization.ts +0 -253
  426. package/packages/orq-rc/src/models/operations/evalstoneofvoice.ts +0 -251
  427. package/packages/orq-rc/src/models/operations/evalstranslation.ts +0 -251
  428. package/packages/orq-rc/src/models/operations/evalsvalidjson.ts +0 -177
  429. package/packages/orq-rc/src/models/operations/filedelete.ts +0 -78
  430. package/packages/orq-rc/src/models/operations/fileget.ts +0 -223
  431. package/packages/orq-rc/src/models/operations/filelist.ts +0 -337
  432. package/packages/orq-rc/src/models/operations/fileupload.ts +0 -327
  433. package/packages/orq-rc/src/models/operations/getallprompts.ts +0 -2298
  434. package/packages/orq-rc/src/models/operations/getevals.ts +0 -7290
  435. package/packages/orq-rc/src/models/operations/getonechunk.ts +0 -315
  436. package/packages/orq-rc/src/models/operations/getoneknowledge.ts +0 -537
  437. package/packages/orq-rc/src/models/operations/getoneprompt.ts +0 -2159
  438. package/packages/orq-rc/src/models/operations/getpromptversion.ts +0 -2164
  439. package/packages/orq-rc/src/models/operations/index.ts +0 -98
  440. package/packages/orq-rc/src/models/operations/invokeeval.ts +0 -2520
  441. package/packages/orq-rc/src/models/operations/listchunks.ts +0 -494
  442. package/packages/orq-rc/src/models/operations/listcontacts.ts +0 -490
  443. package/packages/orq-rc/src/models/operations/listdatasetdatapoints.ts +0 -2784
  444. package/packages/orq-rc/src/models/operations/listdatasets.ts +0 -406
  445. package/packages/orq-rc/src/models/operations/listdatasources.ts +0 -447
  446. package/packages/orq-rc/src/models/operations/listknowledgebases.ts +0 -663
  447. package/packages/orq-rc/src/models/operations/listmodels.ts +0 -273
  448. package/packages/orq-rc/src/models/operations/listpromptversions.ts +0 -2296
  449. package/packages/orq-rc/src/models/operations/parse.ts +0 -1610
  450. package/packages/orq-rc/src/models/operations/remoteconfigsgetconfig.ts +0 -190
  451. package/packages/orq-rc/src/models/operations/retrievecontact.ts +0 -210
  452. package/packages/orq-rc/src/models/operations/retrievedatapoint.ts +0 -2586
  453. package/packages/orq-rc/src/models/operations/retrievedataset.ts +0 -288
  454. package/packages/orq-rc/src/models/operations/retrievedatasource.ts +0 -273
  455. package/packages/orq-rc/src/models/operations/searchknowledge.ts +0 -3367
  456. package/packages/orq-rc/src/models/operations/updatechunk.ts +0 -448
  457. package/packages/orq-rc/src/models/operations/updatecontact.ts +0 -325
  458. package/packages/orq-rc/src/models/operations/updatedatapoint.ts +0 -5155
  459. package/packages/orq-rc/src/models/operations/updatedataset.ts +0 -393
  460. package/packages/orq-rc/src/models/operations/updatedatasource.ts +0 -345
  461. package/packages/orq-rc/src/models/operations/updateeval.ts +0 -4131
  462. package/packages/orq-rc/src/models/operations/updateknowledge.ts +0 -980
  463. package/packages/orq-rc/src/models/operations/updateprompt.ts +0 -4224
  464. package/packages/orq-rc/src/sdk/chunking.ts +0 -27
  465. package/packages/orq-rc/src/sdk/contacts.ts +0 -99
  466. package/packages/orq-rc/src/sdk/datasets.ts +0 -204
  467. package/packages/orq-rc/src/sdk/deployments.ts +0 -89
  468. package/packages/orq-rc/src/sdk/evals.ts +0 -639
  469. package/packages/orq-rc/src/sdk/feedback.ts +0 -27
  470. package/packages/orq-rc/src/sdk/files.ts +0 -78
  471. package/packages/orq-rc/src/sdk/index.ts +0 -5
  472. package/packages/orq-rc/src/sdk/knowledge.ts +0 -264
  473. package/packages/orq-rc/src/sdk/metrics.ts +0 -27
  474. package/packages/orq-rc/src/sdk/models.ts +0 -25
  475. package/packages/orq-rc/src/sdk/prompts.ts +0 -126
  476. package/packages/orq-rc/src/sdk/remoteconfigs.ts +0 -24
  477. package/packages/orq-rc/src/sdk/sdk.ts +0 -73
  478. package/packages/orq-rc/src/types/async.ts +0 -68
  479. package/packages/orq-rc/src/types/blobs.ts +0 -31
  480. package/packages/orq-rc/src/types/constdatetime.ts +0 -15
  481. package/packages/orq-rc/src/types/enums.ts +0 -16
  482. package/packages/orq-rc/src/types/fp.ts +0 -50
  483. package/packages/orq-rc/src/types/index.ts +0 -11
  484. package/packages/orq-rc/src/types/operations.ts +0 -105
  485. package/packages/orq-rc/src/types/rfcdate.ts +0 -54
  486. package/packages/orq-rc/src/types/streams.ts +0 -21
  487. package/packages/orq-rc/tsconfig.json +0 -41
@@ -1,960 +0,0 @@
1
- # @orq-ai/node
2
-
3
- Developer-friendly & type-safe Typescript SDK specifically catered to leverage *@orq-ai/node* API.
4
-
5
- <div align="left">
6
- <a href="https://www.speakeasy.com/?utm_source=@orq-ai/node&utm_campaign=typescript"><img src="https://custom-icon-badges.demolab.com/badge/-Built%20By%20Speakeasy-212015?style=for-the-badge&logoColor=FBE331&logo=speakeasy&labelColor=545454" /></a>
7
- <a href="https://opensource.org/licenses/MIT">
8
- <img src="https://img.shields.io/badge/License-MIT-blue.svg" style="width: 100px; height: 28px;" />
9
- </a>
10
- </div>
11
-
12
- <!-- Start Summary [summary] -->
13
- ## Summary
14
-
15
- orq.ai API: orq.ai API documentation
16
-
17
- For more information about the API: [orq.ai Documentation](https://docs.orq.ai)
18
- <!-- End Summary [summary] -->
19
-
20
- <!-- Start Table of Contents [toc] -->
21
- ## Table of Contents
22
- <!-- $toc-max-depth=2 -->
23
- * [@orq-ai/node](#orq-ainode)
24
- * [SDK Installation](#sdk-installation)
25
- * [Requirements](#requirements)
26
- * [SDK Example Usage](#sdk-example-usage)
27
- * [Authentication](#authentication)
28
- * [Available Resources and Operations](#available-resources-and-operations)
29
- * [Standalone functions](#standalone-functions)
30
- * [Server-sent event streaming](#server-sent-event-streaming)
31
- * [File uploads](#file-uploads)
32
- * [Retries](#retries)
33
- * [Error Handling](#error-handling)
34
- * [Server Selection](#server-selection)
35
- * [Custom HTTP Client](#custom-http-client)
36
- * [Debugging](#debugging)
37
- * [Development](#development)
38
- * [Maturity](#maturity)
39
- * [Contributions](#contributions)
40
-
41
- <!-- End Table of Contents [toc] -->
42
-
43
- <!-- Start SDK Installation [installation] -->
44
- ## SDK Installation
45
-
46
- The SDK can be installed with either [npm](https://www.npmjs.com/), [pnpm](https://pnpm.io/), [bun](https://bun.sh/) or [yarn](https://classic.yarnpkg.com/en/) package managers.
47
-
48
- ### NPM
49
-
50
- ```bash
51
- npm add @orq-ai/node
52
- ```
53
-
54
- ### PNPM
55
-
56
- ```bash
57
- pnpm add @orq-ai/node
58
- ```
59
-
60
- ### Bun
61
-
62
- ```bash
63
- bun add @orq-ai/node
64
- ```
65
-
66
- ### Yarn
67
-
68
- ```bash
69
- yarn add @orq-ai/node zod
70
-
71
- # Note that Yarn does not install peer dependencies automatically. You will need
72
- # to install zod as shown above.
73
- ```
74
-
75
-
76
-
77
- ### Model Context Protocol (MCP) Server
78
-
79
- This SDK is also an installable MCP server where the various SDK methods are
80
- exposed as tools that can be invoked by AI applications.
81
-
82
- > Node.js v20 or greater is required to run the MCP server from npm.
83
-
84
- <details>
85
- <summary>Claude installation steps</summary>
86
-
87
- Add the following server definition to your `claude_desktop_config.json` file:
88
-
89
- ```json
90
- {
91
- "mcpServers": {
92
- "Orq": {
93
- "command": "npx",
94
- "args": [
95
- "-y", "--package", "@orq-ai/node",
96
- "--",
97
- "mcp", "start",
98
- "--api-key", "...",
99
- "--contact-id", "...",
100
- "--environment", "..."
101
- ]
102
- }
103
- }
104
- }
105
- ```
106
-
107
- </details>
108
-
109
- <details>
110
- <summary>Cursor installation steps</summary>
111
-
112
- Create a `.cursor/mcp.json` file in your project root with the following content:
113
-
114
- ```json
115
- {
116
- "mcpServers": {
117
- "Orq": {
118
- "command": "npx",
119
- "args": [
120
- "-y", "--package", "@orq-ai/node",
121
- "--",
122
- "mcp", "start",
123
- "--api-key", "...",
124
- "--contact-id", "...",
125
- "--environment", "..."
126
- ]
127
- }
128
- }
129
- }
130
- ```
131
-
132
- </details>
133
-
134
- You can also run MCP servers as a standalone binary with no additional dependencies. You must pull these binaries from available Github releases:
135
-
136
- ```bash
137
- curl -L -o mcp-server \
138
- https://github.com/{org}/{repo}/releases/download/{tag}/mcp-server-bun-darwin-arm64 && \
139
- chmod +x mcp-server
140
- ```
141
-
142
- If the repo is a private repo you must add your Github PAT to download a release `-H "Authorization: Bearer {GITHUB_PAT}"`.
143
-
144
-
145
- ```json
146
- {
147
- "mcpServers": {
148
- "Todos": {
149
- "command": "./DOWNLOAD/PATH/mcp-server",
150
- "args": [
151
- "start"
152
- ]
153
- }
154
- }
155
- }
156
- ```
157
-
158
- For a full list of server arguments, run:
159
-
160
- ```sh
161
- npx -y --package @orq-ai/node -- mcp start --help
162
- ```
163
- <!-- End SDK Installation [installation] -->
164
-
165
- <!-- Start Requirements [requirements] -->
166
- ## Requirements
167
-
168
- For supported JavaScript runtimes, please consult [RUNTIMES.md](RUNTIMES.md).
169
- <!-- End Requirements [requirements] -->
170
-
171
- <!-- Start SDK Example Usage [usage] -->
172
- ## SDK Example Usage
173
-
174
- ### Example
175
-
176
- ```typescript
177
- import { Orq } from "@orq-ai/node";
178
-
179
- const orq = new Orq({
180
- apiKey: process.env["ORQ_API_KEY"] ?? "",
181
- });
182
-
183
- async function run() {
184
- const result = await orq.contacts.create({
185
- externalId: "user_12345",
186
- displayName: "Jane Smith",
187
- email: "jane.smith@example.com",
188
- avatarUrl: "https://example.com/avatars/jane-smith.jpg",
189
- tags: [
190
- "premium",
191
- "beta-user",
192
- "enterprise",
193
- ],
194
- metadata: {
195
- "department": "Engineering",
196
- "role": "Senior Developer",
197
- "subscription_tier": "premium",
198
- "last_login": "2024-01-15T10:30:00Z",
199
- },
200
- });
201
-
202
- console.log(result);
203
- }
204
-
205
- run();
206
-
207
- ```
208
- <!-- End SDK Example Usage [usage] -->
209
-
210
- <!-- Start Authentication [security] -->
211
- ## Authentication
212
-
213
- ### Per-Client Security Schemes
214
-
215
- This SDK supports the following security scheme globally:
216
-
217
- | Name | Type | Scheme | Environment Variable |
218
- | -------- | ---- | ----------- | -------------------- |
219
- | `apiKey` | http | HTTP Bearer | `ORQ_API_KEY` |
220
-
221
- To authenticate with the API the `apiKey` parameter must be set when initializing the SDK client instance. For example:
222
- ```typescript
223
- import { Orq } from "@orq-ai/node";
224
-
225
- const orq = new Orq({
226
- apiKey: process.env["ORQ_API_KEY"] ?? "",
227
- });
228
-
229
- async function run() {
230
- const result = await orq.contacts.create({
231
- externalId: "user_12345",
232
- displayName: "Jane Smith",
233
- email: "jane.smith@example.com",
234
- avatarUrl: "https://example.com/avatars/jane-smith.jpg",
235
- tags: [
236
- "premium",
237
- "beta-user",
238
- "enterprise",
239
- ],
240
- metadata: {
241
- "department": "Engineering",
242
- "role": "Senior Developer",
243
- "subscription_tier": "premium",
244
- "last_login": "2024-01-15T10:30:00Z",
245
- },
246
- });
247
-
248
- console.log(result);
249
- }
250
-
251
- run();
252
-
253
- ```
254
- <!-- End Authentication [security] -->
255
-
256
- <!-- Start Available Resources and Operations [operations] -->
257
- ## Available Resources and Operations
258
-
259
- <details open>
260
- <summary>Available methods</summary>
261
-
262
- ### [chunking](docs/sdks/chunking/README.md)
263
-
264
- * [parse](docs/sdks/chunking/README.md#parse) - Parse text
265
-
266
- ### [contacts](docs/sdks/contacts/README.md)
267
-
268
- * [create](docs/sdks/contacts/README.md#create) - Create a contact
269
- * [list](docs/sdks/contacts/README.md#list) - List contacts
270
- * [retrieve](docs/sdks/contacts/README.md#retrieve) - Retrieve a contact
271
- * [update](docs/sdks/contacts/README.md#update) - Update a contact
272
- * [delete](docs/sdks/contacts/README.md#delete) - Delete a contact
273
-
274
- ### [datasets](docs/sdks/datasets/README.md)
275
-
276
- * [list](docs/sdks/datasets/README.md#list) - List datasets
277
- * [create](docs/sdks/datasets/README.md#create) - Create a dataset
278
- * [retrieve](docs/sdks/datasets/README.md#retrieve) - Retrieve a dataset
279
- * [update](docs/sdks/datasets/README.md#update) - Update a dataset
280
- * [delete](docs/sdks/datasets/README.md#delete) - Delete a dataset
281
- * [listDatapoints](docs/sdks/datasets/README.md#listdatapoints) - List datapoints
282
- * [createDatapoint](docs/sdks/datasets/README.md#createdatapoint) - Create a datapoint
283
- * [retrieveDatapoint](docs/sdks/datasets/README.md#retrievedatapoint) - Retrieve a datapoint
284
- * [updateDatapoint](docs/sdks/datasets/README.md#updatedatapoint) - Update a datapoint
285
- * [deleteDatapoint](docs/sdks/datasets/README.md#deletedatapoint) - Delete a datapoint
286
- * [clear](docs/sdks/datasets/README.md#clear) - Delete all datapoints
287
-
288
- ### [deployments](docs/sdks/deployments/README.md)
289
-
290
- * [list](docs/sdks/deployments/README.md#list) - List all deployments
291
- * [getConfig](docs/sdks/deployments/README.md#getconfig) - Get config
292
- * [invoke](docs/sdks/deployments/README.md#invoke) - Invoke
293
- * [stream](docs/sdks/deployments/README.md#stream) - Stream
294
-
295
- #### [deployments.metrics](docs/sdks/metrics/README.md)
296
-
297
- * [create](docs/sdks/metrics/README.md#create) - Add metrics
298
-
299
- ### [evals](docs/sdks/evals/README.md)
300
-
301
- * [all](docs/sdks/evals/README.md#all) - Get all Evaluators
302
- * [create](docs/sdks/evals/README.md#create) - Create an Evaluator
303
- * [update](docs/sdks/evals/README.md#update) - Update an Evaluator
304
- * [delete](docs/sdks/evals/README.md#delete) - Delete an Evaluator
305
- * [bertScore](docs/sdks/evals/README.md#bertscore) - Run BertScore Evaluator
306
- * [bleuScore](docs/sdks/evals/README.md#bleuscore) - Run BLEU Score Evaluator
307
- * [containsAll](docs/sdks/evals/README.md#containsall) - Run Contains All Evaluator
308
- * [containsAny](docs/sdks/evals/README.md#containsany) - Run Contains Any Evaluator
309
- * [containsEmail](docs/sdks/evals/README.md#containsemail) - Run Contains Email Evaluator
310
- * [containsNone](docs/sdks/evals/README.md#containsnone) - Run Contains None Evaluator
311
- * [containsUrl](docs/sdks/evals/README.md#containsurl) - Run Contains URL Evaluator
312
- * [containsValidLink](docs/sdks/evals/README.md#containsvalidlink) - Run Contains Valid Link Evaluator
313
- * [contains](docs/sdks/evals/README.md#contains) - Run Contains Evaluator
314
- * [endsWith](docs/sdks/evals/README.md#endswith) - Run Ends With Evaluator
315
- * [exactMatch](docs/sdks/evals/README.md#exactmatch) - Run Exact Match Evaluator
316
- * [lengthBetween](docs/sdks/evals/README.md#lengthbetween) - Run Length Between Evaluator
317
- * [lengthGreaterThan](docs/sdks/evals/README.md#lengthgreaterthan) - Run Length Greater Than Evaluator
318
- * [lengthLessThan](docs/sdks/evals/README.md#lengthlessthan) - Run Length Less Than Evaluator
319
- * [validJson](docs/sdks/evals/README.md#validjson) - Run JSON Validation Evaluator
320
- * [ageAppropriate](docs/sdks/evals/README.md#ageappropriate) - Run Age Appropriate Evaluator
321
- * [botDetection](docs/sdks/evals/README.md#botdetection) - Run Bot Detection Evaluator
322
- * [factCheckingKnowledgeBase](docs/sdks/evals/README.md#factcheckingknowledgebase) - Run Fact Checking Knowledge Base Evaluator
323
- * [grammar](docs/sdks/evals/README.md#grammar) - Run Grammar Evaluator
324
- * [localization](docs/sdks/evals/README.md#localization) - Run Localization Evaluator
325
- * [pii](docs/sdks/evals/README.md#pii) - Run PII Evaluator
326
- * [sentimentClassification](docs/sdks/evals/README.md#sentimentclassification) - Run Sentiment Classification Evaluator
327
- * [summarization](docs/sdks/evals/README.md#summarization) - Run Summarization Evaluator
328
- * [toneOfVoice](docs/sdks/evals/README.md#toneofvoice) - Run Tone of Voice Evaluator
329
- * [translation](docs/sdks/evals/README.md#translation) - Run Translation Evaluator
330
- * [ragasCoherence](docs/sdks/evals/README.md#ragascoherence) - Run Coherence Evaluator
331
- * [ragasConciseness](docs/sdks/evals/README.md#ragasconciseness) - Run Conciseness Evaluator
332
- * [ragasContextPrecision](docs/sdks/evals/README.md#ragascontextprecision) - Run Context Precision Evaluator
333
- * [ragasContextRecall](docs/sdks/evals/README.md#ragascontextrecall) - Run Context Recall Evaluator
334
- * [ragasContextEntitiesRecall](docs/sdks/evals/README.md#ragascontextentitiesrecall) - Run Context Entities Recall Evaluator
335
- * [ragasCorrectness](docs/sdks/evals/README.md#ragascorrectness) - Run Correctness Evaluator
336
- * [ragasFaithfulness](docs/sdks/evals/README.md#ragasfaithfulness) - Run Faithfulness Evaluator
337
- * [ragasHarmfulness](docs/sdks/evals/README.md#ragasharmfulness) - Run Harmfulness Evaluator
338
- * [ragasMaliciousness](docs/sdks/evals/README.md#ragasmaliciousness) - Run Maliciousness Evaluator
339
- * [ragasNoiseSensitivity](docs/sdks/evals/README.md#ragasnoisesensitivity) - Run Noise Sensitivity Evaluator
340
- * [ragasResponseRelevancy](docs/sdks/evals/README.md#ragasresponserelevancy) - Run Response Relevancy Evaluator
341
- * [ragasSummarization](docs/sdks/evals/README.md#ragassummarization) - Run Summarization Evaluator
342
- * [invoke](docs/sdks/evals/README.md#invoke) - Invoke a Custom Evaluator
343
-
344
- ### [feedback](docs/sdks/feedback/README.md)
345
-
346
- * [create](docs/sdks/feedback/README.md#create) - Submit feedback
347
-
348
- ### [files](docs/sdks/files/README.md)
349
-
350
- * [create](docs/sdks/files/README.md#create) - Create file
351
- * [list](docs/sdks/files/README.md#list) - List all files
352
- * [get](docs/sdks/files/README.md#get) - Retrieve a file
353
- * [delete](docs/sdks/files/README.md#delete) - Delete file
354
-
355
- ### [knowledge](docs/sdks/knowledge/README.md)
356
-
357
- * [list](docs/sdks/knowledge/README.md#list) - List all knowledge bases
358
- * [create](docs/sdks/knowledge/README.md#create) - Create a knowledge
359
- * [retrieve](docs/sdks/knowledge/README.md#retrieve) - Retrieves a knowledge base
360
- * [update](docs/sdks/knowledge/README.md#update) - Updates a knowledge
361
- * [delete](docs/sdks/knowledge/README.md#delete) - Deletes a knowledge
362
- * [search](docs/sdks/knowledge/README.md#search) - Search knowledge base
363
- * [listDatasources](docs/sdks/knowledge/README.md#listdatasources) - List all datasources
364
- * [createDatasource](docs/sdks/knowledge/README.md#createdatasource) - Create a new datasource
365
- * [retrieveDatasource](docs/sdks/knowledge/README.md#retrievedatasource) - Retrieve a datasource
366
- * [deleteDatasource](docs/sdks/knowledge/README.md#deletedatasource) - Deletes a datasource
367
- * [updateDatasource](docs/sdks/knowledge/README.md#updatedatasource) - Update a datasource
368
- * [createChunks](docs/sdks/knowledge/README.md#createchunks) - Create chunks for a datasource
369
- * [listChunks](docs/sdks/knowledge/README.md#listchunks) - List all chunks for a datasource
370
- * [updateChunk](docs/sdks/knowledge/README.md#updatechunk) - Update a chunk
371
- * [deleteChunk](docs/sdks/knowledge/README.md#deletechunk) - Delete a chunk
372
- * [retrieveChunk](docs/sdks/knowledge/README.md#retrievechunk) - Retrieve a chunk
373
-
374
- ### [models](docs/sdks/models/README.md)
375
-
376
- * [list](docs/sdks/models/README.md#list) - List models
377
-
378
-
379
- ### [prompts](docs/sdks/prompts/README.md)
380
-
381
- * [list](docs/sdks/prompts/README.md#list) - List all prompts
382
- * [create](docs/sdks/prompts/README.md#create) - Create a prompt
383
- * [retrieve](docs/sdks/prompts/README.md#retrieve) - Retrieve a prompt
384
- * [update](docs/sdks/prompts/README.md#update) - Update a prompt
385
- * [delete](docs/sdks/prompts/README.md#delete) - Delete a prompt
386
- * [listVersions](docs/sdks/prompts/README.md#listversions) - List all prompt versions
387
- * [getVersion](docs/sdks/prompts/README.md#getversion) - Retrieve a prompt version
388
-
389
- ### [remoteconfigs](docs/sdks/remoteconfigs/README.md)
390
-
391
- * [retrieve](docs/sdks/remoteconfigs/README.md#retrieve) - Retrieve a remote config
392
-
393
- </details>
394
- <!-- End Available Resources and Operations [operations] -->
395
-
396
- <!-- Start Standalone functions [standalone-funcs] -->
397
- ## Standalone functions
398
-
399
- All the methods listed above are available as standalone functions. These
400
- functions are ideal for use in applications running in the browser, serverless
401
- runtimes or other environments where application bundle size is a primary
402
- concern. When using a bundler to build your application, all unused
403
- functionality will be either excluded from the final bundle or tree-shaken away.
404
-
405
- To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md).
406
-
407
- <details>
408
-
409
- <summary>Available standalone functions</summary>
410
-
411
- - [`chunkingParse`](docs/sdks/chunking/README.md#parse) - Parse text
412
- - [`contactsCreate`](docs/sdks/contacts/README.md#create) - Create a contact
413
- - [`contactsDelete`](docs/sdks/contacts/README.md#delete) - Delete a contact
414
- - [`contactsList`](docs/sdks/contacts/README.md#list) - List contacts
415
- - [`contactsRetrieve`](docs/sdks/contacts/README.md#retrieve) - Retrieve a contact
416
- - [`contactsUpdate`](docs/sdks/contacts/README.md#update) - Update a contact
417
- - [`datasetsClear`](docs/sdks/datasets/README.md#clear) - Delete all datapoints
418
- - [`datasetsCreate`](docs/sdks/datasets/README.md#create) - Create a dataset
419
- - [`datasetsCreateDatapoint`](docs/sdks/datasets/README.md#createdatapoint) - Create a datapoint
420
- - [`datasetsDelete`](docs/sdks/datasets/README.md#delete) - Delete a dataset
421
- - [`datasetsDeleteDatapoint`](docs/sdks/datasets/README.md#deletedatapoint) - Delete a datapoint
422
- - [`datasetsList`](docs/sdks/datasets/README.md#list) - List datasets
423
- - [`datasetsListDatapoints`](docs/sdks/datasets/README.md#listdatapoints) - List datapoints
424
- - [`datasetsRetrieve`](docs/sdks/datasets/README.md#retrieve) - Retrieve a dataset
425
- - [`datasetsRetrieveDatapoint`](docs/sdks/datasets/README.md#retrievedatapoint) - Retrieve a datapoint
426
- - [`datasetsUpdate`](docs/sdks/datasets/README.md#update) - Update a dataset
427
- - [`datasetsUpdateDatapoint`](docs/sdks/datasets/README.md#updatedatapoint) - Update a datapoint
428
- - [`deploymentsGetConfig`](docs/sdks/deployments/README.md#getconfig) - Get config
429
- - [`deploymentsInvoke`](docs/sdks/deployments/README.md#invoke) - Invoke
430
- - [`deploymentsList`](docs/sdks/deployments/README.md#list) - List all deployments
431
- - [`deploymentsMetricsCreate`](docs/sdks/metrics/README.md#create) - Add metrics
432
- - [`deploymentsStream`](docs/sdks/deployments/README.md#stream) - Stream
433
- - [`evalsAgeAppropriate`](docs/sdks/evals/README.md#ageappropriate) - Run Age Appropriate Evaluator
434
- - [`evalsAll`](docs/sdks/evals/README.md#all) - Get all Evaluators
435
- - [`evalsBertScore`](docs/sdks/evals/README.md#bertscore) - Run BertScore Evaluator
436
- - [`evalsBleuScore`](docs/sdks/evals/README.md#bleuscore) - Run BLEU Score Evaluator
437
- - [`evalsBotDetection`](docs/sdks/evals/README.md#botdetection) - Run Bot Detection Evaluator
438
- - [`evalsContains`](docs/sdks/evals/README.md#contains) - Run Contains Evaluator
439
- - [`evalsContainsAll`](docs/sdks/evals/README.md#containsall) - Run Contains All Evaluator
440
- - [`evalsContainsAny`](docs/sdks/evals/README.md#containsany) - Run Contains Any Evaluator
441
- - [`evalsContainsEmail`](docs/sdks/evals/README.md#containsemail) - Run Contains Email Evaluator
442
- - [`evalsContainsNone`](docs/sdks/evals/README.md#containsnone) - Run Contains None Evaluator
443
- - [`evalsContainsUrl`](docs/sdks/evals/README.md#containsurl) - Run Contains URL Evaluator
444
- - [`evalsContainsValidLink`](docs/sdks/evals/README.md#containsvalidlink) - Run Contains Valid Link Evaluator
445
- - [`evalsCreate`](docs/sdks/evals/README.md#create) - Create an Evaluator
446
- - [`evalsDelete`](docs/sdks/evals/README.md#delete) - Delete an Evaluator
447
- - [`evalsEndsWith`](docs/sdks/evals/README.md#endswith) - Run Ends With Evaluator
448
- - [`evalsExactMatch`](docs/sdks/evals/README.md#exactmatch) - Run Exact Match Evaluator
449
- - [`evalsFactCheckingKnowledgeBase`](docs/sdks/evals/README.md#factcheckingknowledgebase) - Run Fact Checking Knowledge Base Evaluator
450
- - [`evalsGrammar`](docs/sdks/evals/README.md#grammar) - Run Grammar Evaluator
451
- - [`evalsInvoke`](docs/sdks/evals/README.md#invoke) - Invoke a Custom Evaluator
452
- - [`evalsLengthBetween`](docs/sdks/evals/README.md#lengthbetween) - Run Length Between Evaluator
453
- - [`evalsLengthGreaterThan`](docs/sdks/evals/README.md#lengthgreaterthan) - Run Length Greater Than Evaluator
454
- - [`evalsLengthLessThan`](docs/sdks/evals/README.md#lengthlessthan) - Run Length Less Than Evaluator
455
- - [`evalsLocalization`](docs/sdks/evals/README.md#localization) - Run Localization Evaluator
456
- - [`evalsPii`](docs/sdks/evals/README.md#pii) - Run PII Evaluator
457
- - [`evalsRagasCoherence`](docs/sdks/evals/README.md#ragascoherence) - Run Coherence Evaluator
458
- - [`evalsRagasConciseness`](docs/sdks/evals/README.md#ragasconciseness) - Run Conciseness Evaluator
459
- - [`evalsRagasContextEntitiesRecall`](docs/sdks/evals/README.md#ragascontextentitiesrecall) - Run Context Entities Recall Evaluator
460
- - [`evalsRagasContextPrecision`](docs/sdks/evals/README.md#ragascontextprecision) - Run Context Precision Evaluator
461
- - [`evalsRagasContextRecall`](docs/sdks/evals/README.md#ragascontextrecall) - Run Context Recall Evaluator
462
- - [`evalsRagasCorrectness`](docs/sdks/evals/README.md#ragascorrectness) - Run Correctness Evaluator
463
- - [`evalsRagasFaithfulness`](docs/sdks/evals/README.md#ragasfaithfulness) - Run Faithfulness Evaluator
464
- - [`evalsRagasHarmfulness`](docs/sdks/evals/README.md#ragasharmfulness) - Run Harmfulness Evaluator
465
- - [`evalsRagasMaliciousness`](docs/sdks/evals/README.md#ragasmaliciousness) - Run Maliciousness Evaluator
466
- - [`evalsRagasNoiseSensitivity`](docs/sdks/evals/README.md#ragasnoisesensitivity) - Run Noise Sensitivity Evaluator
467
- - [`evalsRagasResponseRelevancy`](docs/sdks/evals/README.md#ragasresponserelevancy) - Run Response Relevancy Evaluator
468
- - [`evalsRagasSummarization`](docs/sdks/evals/README.md#ragassummarization) - Run Summarization Evaluator
469
- - [`evalsSentimentClassification`](docs/sdks/evals/README.md#sentimentclassification) - Run Sentiment Classification Evaluator
470
- - [`evalsSummarization`](docs/sdks/evals/README.md#summarization) - Run Summarization Evaluator
471
- - [`evalsToneOfVoice`](docs/sdks/evals/README.md#toneofvoice) - Run Tone of Voice Evaluator
472
- - [`evalsTranslation`](docs/sdks/evals/README.md#translation) - Run Translation Evaluator
473
- - [`evalsUpdate`](docs/sdks/evals/README.md#update) - Update an Evaluator
474
- - [`evalsValidJson`](docs/sdks/evals/README.md#validjson) - Run JSON Validation Evaluator
475
- - [`feedbackCreate`](docs/sdks/feedback/README.md#create) - Submit feedback
476
- - [`filesCreate`](docs/sdks/files/README.md#create) - Create file
477
- - [`filesDelete`](docs/sdks/files/README.md#delete) - Delete file
478
- - [`filesGet`](docs/sdks/files/README.md#get) - Retrieve a file
479
- - [`filesList`](docs/sdks/files/README.md#list) - List all files
480
- - [`knowledgeCreate`](docs/sdks/knowledge/README.md#create) - Create a knowledge
481
- - [`knowledgeCreateChunks`](docs/sdks/knowledge/README.md#createchunks) - Create chunks for a datasource
482
- - [`knowledgeCreateDatasource`](docs/sdks/knowledge/README.md#createdatasource) - Create a new datasource
483
- - [`knowledgeDelete`](docs/sdks/knowledge/README.md#delete) - Deletes a knowledge
484
- - [`knowledgeDeleteChunk`](docs/sdks/knowledge/README.md#deletechunk) - Delete a chunk
485
- - [`knowledgeDeleteDatasource`](docs/sdks/knowledge/README.md#deletedatasource) - Deletes a datasource
486
- - [`knowledgeList`](docs/sdks/knowledge/README.md#list) - List all knowledge bases
487
- - [`knowledgeListChunks`](docs/sdks/knowledge/README.md#listchunks) - List all chunks for a datasource
488
- - [`knowledgeListDatasources`](docs/sdks/knowledge/README.md#listdatasources) - List all datasources
489
- - [`knowledgeRetrieve`](docs/sdks/knowledge/README.md#retrieve) - Retrieves a knowledge base
490
- - [`knowledgeRetrieveChunk`](docs/sdks/knowledge/README.md#retrievechunk) - Retrieve a chunk
491
- - [`knowledgeRetrieveDatasource`](docs/sdks/knowledge/README.md#retrievedatasource) - Retrieve a datasource
492
- - [`knowledgeSearch`](docs/sdks/knowledge/README.md#search) - Search knowledge base
493
- - [`knowledgeUpdate`](docs/sdks/knowledge/README.md#update) - Updates a knowledge
494
- - [`knowledgeUpdateChunk`](docs/sdks/knowledge/README.md#updatechunk) - Update a chunk
495
- - [`knowledgeUpdateDatasource`](docs/sdks/knowledge/README.md#updatedatasource) - Update a datasource
496
- - [`modelsList`](docs/sdks/models/README.md#list) - List models
497
- - [`promptsCreate`](docs/sdks/prompts/README.md#create) - Create a prompt
498
- - [`promptsDelete`](docs/sdks/prompts/README.md#delete) - Delete a prompt
499
- - [`promptsGetVersion`](docs/sdks/prompts/README.md#getversion) - Retrieve a prompt version
500
- - [`promptsList`](docs/sdks/prompts/README.md#list) - List all prompts
501
- - [`promptsListVersions`](docs/sdks/prompts/README.md#listversions) - List all prompt versions
502
- - [`promptsRetrieve`](docs/sdks/prompts/README.md#retrieve) - Retrieve a prompt
503
- - [`promptsUpdate`](docs/sdks/prompts/README.md#update) - Update a prompt
504
- - [`remoteconfigsRetrieve`](docs/sdks/remoteconfigs/README.md#retrieve) - Retrieve a remote config
505
-
506
- </details>
507
- <!-- End Standalone functions [standalone-funcs] -->
508
-
509
- <!-- Start Server-sent event streaming [eventstream] -->
510
- ## Server-sent event streaming
511
-
512
- [Server-sent events][mdn-sse] are used to stream content from certain
513
- operations. These operations will expose the stream as an async iterable that
514
- can be consumed using a [`for await...of`][mdn-for-await-of] loop. The loop will
515
- terminate when the server no longer has any events to send and closes the
516
- underlying connection.
517
-
518
- ```typescript
519
- import { Orq } from "@orq-ai/node";
520
-
521
- const orq = new Orq({
522
- environment: "<value>",
523
- contactId: "<id>",
524
- apiKey: process.env["ORQ_API_KEY"] ?? "",
525
- });
526
-
527
- async function run() {
528
- const result = await orq.deployments.stream({
529
- key: "<key>",
530
- });
531
-
532
- for await (const event of result) {
533
- // Handle the event
534
- console.log(event);
535
- }
536
- }
537
-
538
- run();
539
-
540
- ```
541
-
542
- [mdn-sse]: https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events
543
- [mdn-for-await-of]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for-await...of
544
- <!-- End Server-sent event streaming [eventstream] -->
545
-
546
- <!-- Start File uploads [file-upload] -->
547
- ## File uploads
548
-
549
- Certain SDK methods accept files as part of a multi-part request. It is possible and typically recommended to upload files as a stream rather than reading the entire contents into memory. This avoids excessive memory consumption and potentially crashing with out-of-memory errors when working with very large files. The following example demonstrates how to attach a file stream to a request.
550
-
551
- > [!TIP]
552
- >
553
- > Depending on your JavaScript runtime, there are convenient utilities that return a handle to a file without reading the entire contents into memory:
554
- >
555
- > - **Node.js v20+:** Since v20, Node.js comes with a native `openAsBlob` function in [`node:fs`](https://nodejs.org/docs/latest-v20.x/api/fs.html#fsopenasblobpath-options).
556
- > - **Bun:** The native [`Bun.file`](https://bun.sh/docs/api/file-io#reading-files-bun-file) function produces a file handle that can be used for streaming file uploads.
557
- > - **Browsers:** All supported browsers return an instance to a [`File`](https://developer.mozilla.org/en-US/docs/Web/API/File) when reading the value from an `<input type="file">` element.
558
- > - **Node.js v18:** A file stream can be created using the `fileFrom` helper from [`fetch-blob/from.js`](https://www.npmjs.com/package/fetch-blob).
559
-
560
- ```typescript
561
- import { Orq } from "@orq-ai/node";
562
- import { openAsBlob } from "node:fs";
563
-
564
- const orq = new Orq({
565
- apiKey: process.env["ORQ_API_KEY"] ?? "",
566
- });
567
-
568
- async function run() {
569
- const result = await orq.files.create({
570
- file: await openAsBlob("example.file"),
571
- });
572
-
573
- console.log(result);
574
- }
575
-
576
- run();
577
-
578
- ```
579
- <!-- End File uploads [file-upload] -->
580
-
581
- <!-- Start Retries [retries] -->
582
- ## Retries
583
-
584
- Some of the endpoints in this SDK support retries. If you use the SDK without any configuration, it will fall back to the default retry strategy provided by the API. However, the default retry strategy can be overridden on a per-operation basis, or across the entire SDK.
585
-
586
- To change the default retry strategy for a single API call, simply provide a retryConfig object to the call:
587
- ```typescript
588
- import { Orq } from "@orq-ai/node";
589
-
590
- const orq = new Orq({
591
- apiKey: process.env["ORQ_API_KEY"] ?? "",
592
- });
593
-
594
- async function run() {
595
- const result = await orq.contacts.create({
596
- externalId: "user_12345",
597
- displayName: "Jane Smith",
598
- email: "jane.smith@example.com",
599
- avatarUrl: "https://example.com/avatars/jane-smith.jpg",
600
- tags: [
601
- "premium",
602
- "beta-user",
603
- "enterprise",
604
- ],
605
- metadata: {
606
- "department": "Engineering",
607
- "role": "Senior Developer",
608
- "subscription_tier": "premium",
609
- "last_login": "2024-01-15T10:30:00Z",
610
- },
611
- }, {
612
- retries: {
613
- strategy: "backoff",
614
- backoff: {
615
- initialInterval: 1,
616
- maxInterval: 50,
617
- exponent: 1.1,
618
- maxElapsedTime: 100,
619
- },
620
- retryConnectionErrors: false,
621
- },
622
- });
623
-
624
- console.log(result);
625
- }
626
-
627
- run();
628
-
629
- ```
630
-
631
- If you'd like to override the default retry strategy for all operations that support retries, you can provide a retryConfig at SDK initialization:
632
- ```typescript
633
- import { Orq } from "@orq-ai/node";
634
-
635
- const orq = new Orq({
636
- retryConfig: {
637
- strategy: "backoff",
638
- backoff: {
639
- initialInterval: 1,
640
- maxInterval: 50,
641
- exponent: 1.1,
642
- maxElapsedTime: 100,
643
- },
644
- retryConnectionErrors: false,
645
- },
646
- apiKey: process.env["ORQ_API_KEY"] ?? "",
647
- });
648
-
649
- async function run() {
650
- const result = await orq.contacts.create({
651
- externalId: "user_12345",
652
- displayName: "Jane Smith",
653
- email: "jane.smith@example.com",
654
- avatarUrl: "https://example.com/avatars/jane-smith.jpg",
655
- tags: [
656
- "premium",
657
- "beta-user",
658
- "enterprise",
659
- ],
660
- metadata: {
661
- "department": "Engineering",
662
- "role": "Senior Developer",
663
- "subscription_tier": "premium",
664
- "last_login": "2024-01-15T10:30:00Z",
665
- },
666
- });
667
-
668
- console.log(result);
669
- }
670
-
671
- run();
672
-
673
- ```
674
- <!-- End Retries [retries] -->
675
-
676
- <!-- Start Error Handling [errors] -->
677
- ## Error Handling
678
-
679
- [`OrqError`](./src/models/errors/orqerror.ts) is the base class for all HTTP error responses. It has the following properties:
680
-
681
- | Property | Type | Description |
682
- | ------------------- | ---------- | --------------------------------------------------------------------------------------- |
683
- | `error.message` | `string` | Error message |
684
- | `error.statusCode` | `number` | HTTP response status code eg `404` |
685
- | `error.headers` | `Headers` | HTTP response headers |
686
- | `error.body` | `string` | HTTP body. Can be empty string if no body is returned. |
687
- | `error.rawResponse` | `Response` | Raw HTTP response |
688
- | `error.data$` | | Optional. Some errors may contain structured data. [See Error Classes](#error-classes). |
689
-
690
- ### Example
691
- ```typescript
692
- import { Orq } from "@orq-ai/node";
693
- import * as errors from "@orq-ai/node/models/errors";
694
-
695
- const orq = new Orq({
696
- apiKey: process.env["ORQ_API_KEY"] ?? "",
697
- });
698
-
699
- async function run() {
700
- try {
701
- const result = await orq.contacts.retrieve({
702
- id: "<id>",
703
- });
704
-
705
- console.log(result);
706
- } catch (error) {
707
- // The base class for HTTP error responses
708
- if (error instanceof errors.OrqError) {
709
- console.log(error.message);
710
- console.log(error.statusCode);
711
- console.log(error.body);
712
- console.log(error.headers);
713
-
714
- // Depending on the method different errors may be thrown
715
- if (error instanceof errors.RetrieveContactResponseBody) {
716
- console.log(error.data$.error); // string
717
- }
718
- }
719
- }
720
- }
721
-
722
- run();
723
-
724
- ```
725
-
726
- ### Error Classes
727
- **Primary error:**
728
- * [`OrqError`](./src/models/errors/orqerror.ts): The base class for HTTP error responses.
729
-
730
- <details><summary>Less common errors (92)</summary>
731
-
732
- <br />
733
-
734
- **Network errors:**
735
- * [`ConnectionError`](./src/models/errors/httpclienterrors.ts): HTTP client was unable to make a request to a server.
736
- * [`RequestTimeoutError`](./src/models/errors/httpclienterrors.ts): HTTP request timed out due to an AbortSignal signal.
737
- * [`RequestAbortedError`](./src/models/errors/httpclienterrors.ts): HTTP request was aborted by the client.
738
- * [`InvalidRequestError`](./src/models/errors/httpclienterrors.ts): Any input used to create a request is invalid.
739
- * [`UnexpectedClientError`](./src/models/errors/httpclienterrors.ts): Unrecognised or unexpected error.
740
-
741
-
742
- **Inherit from [`OrqError`](./src/models/errors/orqerror.ts)**:
743
- * [`HonoApiError`](./src/models/errors/honoapierror.ts): Applicable to 6 of 94 methods.*
744
- * [`RetrieveContactResponseBody`](./src/models/errors/retrievecontactresponsebody.ts): Contact not found. Status code `404`. Applicable to 1 of 94 methods.*
745
- * [`UpdateContactResponseBody`](./src/models/errors/updatecontactresponsebody.ts): Contact not found. Status code `404`. Applicable to 1 of 94 methods.*
746
- * [`DeleteContactResponseBody`](./src/models/errors/deletecontactresponsebody.ts): Contact not found. Status code `404`. Applicable to 1 of 94 methods.*
747
- * [`UpdatePromptResponseBody`](./src/models/errors/updatepromptresponsebody.ts): Prompt not found. Status code `404`. Applicable to 1 of 94 methods.*
748
- * [`GetPromptVersionResponseBody`](./src/models/errors/getpromptversionresponsebody.ts): Not Found - The prompt or prompt version does not exist. Status code `404`. Applicable to 1 of 94 methods.*
749
- * [`GetEvalsResponseBody`](./src/models/errors/getevalsresponsebody.ts): Workspace ID is not found on the request. Status code `404`. Applicable to 1 of 94 methods.*
750
- * [`CreateEvalResponseBody`](./src/models/errors/createevalresponsebody.ts): Workspace ID is not found on the request. Status code `404`. Applicable to 1 of 94 methods.*
751
- * [`UpdateEvalResponseBody`](./src/models/errors/updateevalresponsebody.ts): Workspace ID is not found on the request. Status code `404`. Applicable to 1 of 94 methods.*
752
- * [`DeleteEvalResponseBody`](./src/models/errors/deleteevalresponsebody.ts): Workspace ID is not found on the request. Status code `404`. Applicable to 1 of 94 methods.*
753
- * [`EvalsBertScoreResponseBody`](./src/models/errors/evalsbertscoreresponsebody.ts): Evaluator not found. Status code `404`. Applicable to 1 of 94 methods.*
754
- * [`EvalsBleuScoreResponseBody`](./src/models/errors/evalsbleuscoreresponsebody.ts): Evaluator not found. Status code `404`. Applicable to 1 of 94 methods.*
755
- * [`EvalsContainsAllResponseBody`](./src/models/errors/evalscontainsallresponsebody.ts): Evaluator not found. Status code `404`. Applicable to 1 of 94 methods.*
756
- * [`EvalsContainsAnyResponseBody`](./src/models/errors/evalscontainsanyresponsebody.ts): Evaluator not found. Status code `404`. Applicable to 1 of 94 methods.*
757
- * [`EvalsContainsEmailResponseBody`](./src/models/errors/evalscontainsemailresponsebody.ts): Evaluator not found. Status code `404`. Applicable to 1 of 94 methods.*
758
- * [`EvalsContainsNoneResponseBody`](./src/models/errors/evalscontainsnoneresponsebody.ts): Evaluator not found. Status code `404`. Applicable to 1 of 94 methods.*
759
- * [`EvalsContainsUrlResponseBody`](./src/models/errors/evalscontainsurlresponsebody.ts): Evaluator not found. Status code `404`. Applicable to 1 of 94 methods.*
760
- * [`EvalsContainsValidLinkResponseBody`](./src/models/errors/evalscontainsvalidlinkresponsebody.ts): Evaluator not found. Status code `404`. Applicable to 1 of 94 methods.*
761
- * [`EvalsContainsResponseBody`](./src/models/errors/evalscontainsresponsebody.ts): Evaluator not found. Status code `404`. Applicable to 1 of 94 methods.*
762
- * [`EvalsEndsWithResponseBody`](./src/models/errors/evalsendswithresponsebody.ts): Evaluator not found. Status code `404`. Applicable to 1 of 94 methods.*
763
- * [`EvalsExactMatchResponseBody`](./src/models/errors/evalsexactmatchresponsebody.ts): Evaluator not found. Status code `404`. Applicable to 1 of 94 methods.*
764
- * [`EvalsLengthBetweenResponseBody`](./src/models/errors/evalslengthbetweenresponsebody.ts): Evaluator not found. Status code `404`. Applicable to 1 of 94 methods.*
765
- * [`EvalsLengthGreaterThanResponseBody`](./src/models/errors/evalslengthgreaterthanresponsebody.ts): Evaluator not found. Status code `404`. Applicable to 1 of 94 methods.*
766
- * [`EvalsLengthLessThanResponseBody`](./src/models/errors/evalslengthlessthanresponsebody.ts): Evaluator not found. Status code `404`. Applicable to 1 of 94 methods.*
767
- * [`EvalsValidJsonResponseBody`](./src/models/errors/evalsvalidjsonresponsebody.ts): Evaluator not found. Status code `404`. Applicable to 1 of 94 methods.*
768
- * [`EvalsAgeAppropriateResponseBody`](./src/models/errors/evalsageappropriateresponsebody.ts): Evaluator not found. Status code `404`. Applicable to 1 of 94 methods.*
769
- * [`EvalsBotDetectionResponseBody`](./src/models/errors/evalsbotdetectionresponsebody.ts): Evaluator not found. Status code `404`. Applicable to 1 of 94 methods.*
770
- * [`EvalsFactCheckingKnowledgeBaseResponseBody`](./src/models/errors/evalsfactcheckingknowledgebaseresponsebody.ts): Evaluator not found. Status code `404`. Applicable to 1 of 94 methods.*
771
- * [`EvalsGrammarResponseBody`](./src/models/errors/evalsgrammarresponsebody.ts): Evaluator not found. Status code `404`. Applicable to 1 of 94 methods.*
772
- * [`EvalsLocalizationResponseBody`](./src/models/errors/evalslocalizationresponsebody.ts): Evaluator not found. Status code `404`. Applicable to 1 of 94 methods.*
773
- * [`EvalsPiiResponseBody`](./src/models/errors/evalspiiresponsebody.ts): Evaluator not found. Status code `404`. Applicable to 1 of 94 methods.*
774
- * [`EvalsSentimentClassificationResponseBody`](./src/models/errors/evalssentimentclassificationresponsebody.ts): Evaluator not found. Status code `404`. Applicable to 1 of 94 methods.*
775
- * [`EvalsSummarizationResponseBody`](./src/models/errors/evalssummarizationresponsebody.ts): Evaluator not found. Status code `404`. Applicable to 1 of 94 methods.*
776
- * [`EvalsToneOfVoiceResponseBody`](./src/models/errors/evalstoneofvoiceresponsebody.ts): Evaluator not found. Status code `404`. Applicable to 1 of 94 methods.*
777
- * [`EvalsTranslationResponseBody`](./src/models/errors/evalstranslationresponsebody.ts): Evaluator not found. Status code `404`. Applicable to 1 of 94 methods.*
778
- * [`EvalsRagasCoherenceResponseBody`](./src/models/errors/evalsragascoherenceresponsebody.ts): Evaluator not found. Status code `404`. Applicable to 1 of 94 methods.*
779
- * [`EvalsRagasConcisenessResponseBody`](./src/models/errors/evalsragasconcisenessresponsebody.ts): Evaluator not found. Status code `404`. Applicable to 1 of 94 methods.*
780
- * [`EvalsRagasContextPrecisionResponseBody`](./src/models/errors/evalsragascontextprecisionresponsebody.ts): Evaluator not found. Status code `404`. Applicable to 1 of 94 methods.*
781
- * [`EvalsRagasContextRecallResponseBody`](./src/models/errors/evalsragascontextrecallresponsebody.ts): Evaluator not found. Status code `404`. Applicable to 1 of 94 methods.*
782
- * [`EvalsRagasContextEntitiesRecallResponseBody`](./src/models/errors/evalsragascontextentitiesrecallresponsebody.ts): Evaluator not found. Status code `404`. Applicable to 1 of 94 methods.*
783
- * [`EvalsRagasCorrectnessResponseBody`](./src/models/errors/evalsragascorrectnessresponsebody.ts): Evaluator not found. Status code `404`. Applicable to 1 of 94 methods.*
784
- * [`EvalsRagasFaithfulnessResponseBody`](./src/models/errors/evalsragasfaithfulnessresponsebody.ts): Evaluator not found. Status code `404`. Applicable to 1 of 94 methods.*
785
- * [`EvalsRagasHarmfulnessResponseBody`](./src/models/errors/evalsragasharmfulnessresponsebody.ts): Evaluator not found. Status code `404`. Applicable to 1 of 94 methods.*
786
- * [`EvalsRagasMaliciousnessResponseBody`](./src/models/errors/evalsragasmaliciousnessresponsebody.ts): Evaluator not found. Status code `404`. Applicable to 1 of 94 methods.*
787
- * [`EvalsRagasNoiseSensitivityResponseBody`](./src/models/errors/evalsragasnoisesensitivityresponsebody.ts): Evaluator not found. Status code `404`. Applicable to 1 of 94 methods.*
788
- * [`EvalsRagasResponseRelevancyResponseBody`](./src/models/errors/evalsragasresponserelevancyresponsebody.ts): Evaluator not found. Status code `404`. Applicable to 1 of 94 methods.*
789
- * [`EvalsRagasSummarizationResponseBody`](./src/models/errors/evalsragassummarizationresponsebody.ts): Evaluator not found. Status code `404`. Applicable to 1 of 94 methods.*
790
- * [`InvokeEvalResponseBody`](./src/models/errors/invokeevalresponsebody.ts): Workspace ID is not found on the request. Status code `404`. Applicable to 1 of 94 methods.*
791
- * [`EvalsBertScoreEvalsResponseBody`](./src/models/errors/evalsbertscoreevalsresponsebody.ts): Internal server error. Status code `500`. Applicable to 1 of 94 methods.*
792
- * [`EvalsBleuScoreEvalsResponseBody`](./src/models/errors/evalsbleuscoreevalsresponsebody.ts): Internal server error. Status code `500`. Applicable to 1 of 94 methods.*
793
- * [`EvalsContainsAllEvalsResponseBody`](./src/models/errors/evalscontainsallevalsresponsebody.ts): Internal server error. Status code `500`. Applicable to 1 of 94 methods.*
794
- * [`EvalsContainsAnyEvalsResponseBody`](./src/models/errors/evalscontainsanyevalsresponsebody.ts): Internal server error. Status code `500`. Applicable to 1 of 94 methods.*
795
- * [`EvalsContainsEmailEvalsResponseBody`](./src/models/errors/evalscontainsemailevalsresponsebody.ts): Internal server error. Status code `500`. Applicable to 1 of 94 methods.*
796
- * [`EvalsContainsNoneEvalsResponseBody`](./src/models/errors/evalscontainsnoneevalsresponsebody.ts): Internal server error. Status code `500`. Applicable to 1 of 94 methods.*
797
- * [`EvalsContainsUrlEvalsResponseBody`](./src/models/errors/evalscontainsurlevalsresponsebody.ts): Internal server error. Status code `500`. Applicable to 1 of 94 methods.*
798
- * [`EvalsContainsValidLinkEvalsResponseBody`](./src/models/errors/evalscontainsvalidlinkevalsresponsebody.ts): Internal server error. Status code `500`. Applicable to 1 of 94 methods.*
799
- * [`EvalsContainsEvalsResponseBody`](./src/models/errors/evalscontainsevalsresponsebody.ts): Internal server error. Status code `500`. Applicable to 1 of 94 methods.*
800
- * [`EvalsEndsWithEvalsResponseBody`](./src/models/errors/evalsendswithevalsresponsebody.ts): Internal server error. Status code `500`. Applicable to 1 of 94 methods.*
801
- * [`EvalsExactMatchEvalsResponseBody`](./src/models/errors/evalsexactmatchevalsresponsebody.ts): Internal server error. Status code `500`. Applicable to 1 of 94 methods.*
802
- * [`EvalsLengthBetweenEvalsResponseBody`](./src/models/errors/evalslengthbetweenevalsresponsebody.ts): Internal server error. Status code `500`. Applicable to 1 of 94 methods.*
803
- * [`EvalsLengthGreaterThanEvalsResponseBody`](./src/models/errors/evalslengthgreaterthanevalsresponsebody.ts): Internal server error. Status code `500`. Applicable to 1 of 94 methods.*
804
- * [`EvalsLengthLessThanEvalsResponseBody`](./src/models/errors/evalslengthlessthanevalsresponsebody.ts): Internal server error. Status code `500`. Applicable to 1 of 94 methods.*
805
- * [`EvalsValidJsonEvalsResponseBody`](./src/models/errors/evalsvalidjsonevalsresponsebody.ts): Internal server error. Status code `500`. Applicable to 1 of 94 methods.*
806
- * [`EvalsAgeAppropriateEvalsResponseBody`](./src/models/errors/evalsageappropriateevalsresponsebody.ts): Internal server error. Status code `500`. Applicable to 1 of 94 methods.*
807
- * [`EvalsBotDetectionEvalsResponseBody`](./src/models/errors/evalsbotdetectionevalsresponsebody.ts): Internal server error. Status code `500`. Applicable to 1 of 94 methods.*
808
- * [`EvalsFactCheckingKnowledgeBaseEvalsResponseBody`](./src/models/errors/evalsfactcheckingknowledgebaseevalsresponsebody.ts): Internal server error. Status code `500`. Applicable to 1 of 94 methods.*
809
- * [`EvalsGrammarEvalsResponseBody`](./src/models/errors/evalsgrammarevalsresponsebody.ts): Internal server error. Status code `500`. Applicable to 1 of 94 methods.*
810
- * [`EvalsLocalizationEvalsResponseBody`](./src/models/errors/evalslocalizationevalsresponsebody.ts): Internal server error. Status code `500`. Applicable to 1 of 94 methods.*
811
- * [`EvalsPiiEvalsResponseBody`](./src/models/errors/evalspiievalsresponsebody.ts): Internal server error. Status code `500`. Applicable to 1 of 94 methods.*
812
- * [`EvalsSentimentClassificationEvalsResponseBody`](./src/models/errors/evalssentimentclassificationevalsresponsebody.ts): Internal server error. Status code `500`. Applicable to 1 of 94 methods.*
813
- * [`EvalsSummarizationEvalsResponseBody`](./src/models/errors/evalssummarizationevalsresponsebody.ts): Internal server error. Status code `500`. Applicable to 1 of 94 methods.*
814
- * [`EvalsToneOfVoiceEvalsResponseBody`](./src/models/errors/evalstoneofvoiceevalsresponsebody.ts): Internal server error. Status code `500`. Applicable to 1 of 94 methods.*
815
- * [`EvalsTranslationEvalsResponseBody`](./src/models/errors/evalstranslationevalsresponsebody.ts): Internal server error. Status code `500`. Applicable to 1 of 94 methods.*
816
- * [`EvalsRagasCoherenceEvalsResponseBody`](./src/models/errors/evalsragascoherenceevalsresponsebody.ts): Internal server error. Status code `500`. Applicable to 1 of 94 methods.*
817
- * [`EvalsRagasConcisenessEvalsResponseBody`](./src/models/errors/evalsragasconcisenessevalsresponsebody.ts): Internal server error. Status code `500`. Applicable to 1 of 94 methods.*
818
- * [`EvalsRagasContextPrecisionEvalsResponseBody`](./src/models/errors/evalsragascontextprecisionevalsresponsebody.ts): Internal server error. Status code `500`. Applicable to 1 of 94 methods.*
819
- * [`EvalsRagasContextRecallEvalsResponseBody`](./src/models/errors/evalsragascontextrecallevalsresponsebody.ts): Internal server error. Status code `500`. Applicable to 1 of 94 methods.*
820
- * [`EvalsRagasContextEntitiesRecallEvalsResponseBody`](./src/models/errors/evalsragascontextentitiesrecallevalsresponsebody.ts): Internal server error. Status code `500`. Applicable to 1 of 94 methods.*
821
- * [`EvalsRagasCorrectnessEvalsResponseBody`](./src/models/errors/evalsragascorrectnessevalsresponsebody.ts): Internal server error. Status code `500`. Applicable to 1 of 94 methods.*
822
- * [`EvalsRagasFaithfulnessEvalsResponseBody`](./src/models/errors/evalsragasfaithfulnessevalsresponsebody.ts): Internal server error. Status code `500`. Applicable to 1 of 94 methods.*
823
- * [`EvalsRagasHarmfulnessEvalsResponseBody`](./src/models/errors/evalsragasharmfulnessevalsresponsebody.ts): Internal server error. Status code `500`. Applicable to 1 of 94 methods.*
824
- * [`EvalsRagasMaliciousnessEvalsResponseBody`](./src/models/errors/evalsragasmaliciousnessevalsresponsebody.ts): Internal server error. Status code `500`. Applicable to 1 of 94 methods.*
825
- * [`EvalsRagasNoiseSensitivityEvalsResponseBody`](./src/models/errors/evalsragasnoisesensitivityevalsresponsebody.ts): Internal server error. Status code `500`. Applicable to 1 of 94 methods.*
826
- * [`EvalsRagasResponseRelevancyEvalsResponseBody`](./src/models/errors/evalsragasresponserelevancyevalsresponsebody.ts): Internal server error. Status code `500`. Applicable to 1 of 94 methods.*
827
- * [`EvalsRagasSummarizationEvalsResponseBody`](./src/models/errors/evalsragassummarizationevalsresponsebody.ts): Internal server error. Status code `500`. Applicable to 1 of 94 methods.*
828
- * [`InvokeEvalEvalsResponseBody`](./src/models/errors/invokeevalevalsresponsebody.ts): Error running the evaluator. Status code `500`. Applicable to 1 of 94 methods.*
829
- * [`ResponseValidationError`](./src/models/errors/responsevalidationerror.ts): Type mismatch between the data returned from the server and the structure expected by the SDK. See `error.rawValue` for the raw value and `error.pretty()` for a nicely formatted multi-line string.
830
-
831
- </details>
832
-
833
- \* Check [the method documentation](#available-resources-and-operations) to see if the error is applicable.
834
- <!-- End Error Handling [errors] -->
835
-
836
- <!-- Start Server Selection [server] -->
837
- ## Server Selection
838
-
839
- ### Override Server URL Per-Client
840
-
841
- The default server can be overridden globally by passing a URL to the `serverURL: string` optional parameter when initializing the SDK client instance. For example:
842
- ```typescript
843
- import { Orq } from "@orq-ai/node";
844
-
845
- const orq = new Orq({
846
- serverURL: "https://my.orq.ai",
847
- apiKey: process.env["ORQ_API_KEY"] ?? "",
848
- });
849
-
850
- async function run() {
851
- const result = await orq.contacts.create({
852
- externalId: "user_12345",
853
- displayName: "Jane Smith",
854
- email: "jane.smith@example.com",
855
- avatarUrl: "https://example.com/avatars/jane-smith.jpg",
856
- tags: [
857
- "premium",
858
- "beta-user",
859
- "enterprise",
860
- ],
861
- metadata: {
862
- "department": "Engineering",
863
- "role": "Senior Developer",
864
- "subscription_tier": "premium",
865
- "last_login": "2024-01-15T10:30:00Z",
866
- },
867
- });
868
-
869
- console.log(result);
870
- }
871
-
872
- run();
873
-
874
- ```
875
- <!-- End Server Selection [server] -->
876
-
877
- <!-- Start Custom HTTP Client [http-client] -->
878
- ## Custom HTTP Client
879
-
880
- The TypeScript SDK makes API calls using an `HTTPClient` that wraps the native
881
- [Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API). This
882
- client is a thin wrapper around `fetch` and provides the ability to attach hooks
883
- around the request lifecycle that can be used to modify the request or handle
884
- errors and response.
885
-
886
- The `HTTPClient` constructor takes an optional `fetcher` argument that can be
887
- used to integrate a third-party HTTP client or when writing tests to mock out
888
- the HTTP client and feed in fixtures.
889
-
890
- The following example shows how to use the `"beforeRequest"` hook to to add a
891
- custom header and a timeout to requests and how to use the `"requestError"` hook
892
- to log errors:
893
-
894
- ```typescript
895
- import { Orq } from "@orq-ai/node";
896
- import { HTTPClient } from "@orq-ai/node/lib/http";
897
-
898
- const httpClient = new HTTPClient({
899
- // fetcher takes a function that has the same signature as native `fetch`.
900
- fetcher: (request) => {
901
- return fetch(request);
902
- }
903
- });
904
-
905
- httpClient.addHook("beforeRequest", (request) => {
906
- const nextRequest = new Request(request, {
907
- signal: request.signal || AbortSignal.timeout(5000)
908
- });
909
-
910
- nextRequest.headers.set("x-custom-header", "custom value");
911
-
912
- return nextRequest;
913
- });
914
-
915
- httpClient.addHook("requestError", (error, request) => {
916
- console.group("Request Error");
917
- console.log("Reason:", `${error}`);
918
- console.log("Endpoint:", `${request.method} ${request.url}`);
919
- console.groupEnd();
920
- });
921
-
922
- const sdk = new Orq({ httpClient });
923
- ```
924
- <!-- End Custom HTTP Client [http-client] -->
925
-
926
- <!-- Start Debugging [debug] -->
927
- ## Debugging
928
-
929
- You can setup your SDK to emit debug logs for SDK requests and responses.
930
-
931
- You can pass a logger that matches `console`'s interface as an SDK option.
932
-
933
- > [!WARNING]
934
- > Beware that debug logging will reveal secrets, like API tokens in headers, in log messages printed to a console or files. It's recommended to use this feature only during local development and not in production.
935
-
936
- ```typescript
937
- import { Orq } from "@orq-ai/node";
938
-
939
- const sdk = new Orq({ debugLogger: console });
940
- ```
941
-
942
- You can also enable a default debug logger by setting an environment variable `ORQ_DEBUG` to true.
943
- <!-- End Debugging [debug] -->
944
-
945
- <!-- Placeholder for Future Speakeasy SDK Sections -->
946
-
947
- # Development
948
-
949
- ## Maturity
950
-
951
- This SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning usage
952
- to a specific package version. This way, you can install the same version each time without breaking changes unless you are intentionally
953
- looking for the latest version.
954
-
955
- ## Contributions
956
-
957
- While we value open-source contributions to this SDK, this library is generated programmatically. Any manual changes added to internal files will be overwritten on the next generation.
958
- We look forward to hearing your feedback. Feel free to open a PR or an issue with a proof of concept and we'll do our best to include it in a future release.
959
-
960
- ### SDK Created by [Speakeasy](https://www.speakeasy.com/?utm_source=@orq-ai/node&utm_campaign=typescript)