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