@orq-ai/node 4.11.3 → 4.11.9

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 (278) hide show
  1. package/README.md +40 -36
  2. package/funcs/modelsImportLitellm.d.ts +17 -0
  3. package/funcs/modelsImportLitellm.d.ts.map +1 -0
  4. package/funcs/modelsImportLitellm.js +118 -0
  5. package/funcs/modelsImportLitellm.js.map +1 -0
  6. package/funcs/modelsListLitellm.d.ts +18 -0
  7. package/funcs/modelsListLitellm.d.ts.map +1 -0
  8. package/funcs/modelsListLitellm.js +105 -0
  9. package/funcs/modelsListLitellm.js.map +1 -0
  10. package/jsr.json +1 -1
  11. package/lib/config.d.ts +3 -3
  12. package/lib/config.js +3 -3
  13. package/lib/http.d.ts +1 -1
  14. package/lib/http.d.ts.map +1 -1
  15. package/lib/http.js +1 -1
  16. package/lib/http.js.map +1 -1
  17. package/lib/security.d.ts +5 -4
  18. package/lib/security.d.ts.map +1 -1
  19. package/lib/security.js +6 -7
  20. package/lib/security.js.map +1 -1
  21. package/models/components/evaluatorresponsefunction.js +2 -2
  22. package/models/components/evaluatorresponsehttp.js +2 -2
  23. package/models/components/evaluatorresponsejsonschema.js +2 -2
  24. package/models/components/evaluatorresponsellm.js +2 -2
  25. package/models/components/evaluatorresponsepython.js +2 -2
  26. package/models/components/evaluatorresponseragas.js +2 -2
  27. package/models/components/evaluatorresponsetypescript.js +2 -2
  28. package/models/components/index.d.ts +4 -0
  29. package/models/components/index.d.ts.map +1 -1
  30. package/models/components/index.js +4 -0
  31. package/models/components/index.js.map +1 -1
  32. package/models/components/litellmmodel.d.ts +18 -0
  33. package/models/components/litellmmodel.d.ts.map +1 -0
  34. package/models/components/litellmmodel.js +60 -0
  35. package/models/components/litellmmodel.js.map +1 -0
  36. package/models/components/litellmmodelinfo.d.ts +44 -0
  37. package/models/components/litellmmodelinfo.d.ts.map +1 -0
  38. package/models/components/litellmmodelinfo.js +83 -0
  39. package/models/components/litellmmodelinfo.js.map +1 -0
  40. package/models/components/litellmparams.d.ts +18 -0
  41. package/models/components/litellmparams.d.ts.map +1 -0
  42. package/models/components/litellmparams.js +59 -0
  43. package/models/components/litellmparams.js.map +1 -0
  44. package/models/components/modeldocument.d.ts +39 -0
  45. package/models/components/modeldocument.d.ts.map +1 -0
  46. package/models/components/modeldocument.js +99 -0
  47. package/models/components/modeldocument.js.map +1 -0
  48. package/models/components/reasoningpart.js +1 -1
  49. package/models/operations/createdataset.js +1 -1
  50. package/models/operations/createdatasetitem.js +4 -4
  51. package/models/operations/createdatasource.js +1 -1
  52. package/models/operations/createprompt.d.ts +3 -0
  53. package/models/operations/createprompt.d.ts.map +1 -1
  54. package/models/operations/createprompt.js +3 -0
  55. package/models/operations/createprompt.js.map +1 -1
  56. package/models/operations/createtool.js +6 -6
  57. package/models/operations/deploymentinvoke.d.ts +3 -0
  58. package/models/operations/deploymentinvoke.d.ts.map +1 -1
  59. package/models/operations/deploymentinvoke.js +3 -0
  60. package/models/operations/deploymentinvoke.js.map +1 -1
  61. package/models/operations/deployments.d.ts +3 -0
  62. package/models/operations/deployments.d.ts.map +1 -1
  63. package/models/operations/deployments.js +3 -0
  64. package/models/operations/deployments.js.map +1 -1
  65. package/models/operations/deploymentstream.d.ts +3 -0
  66. package/models/operations/deploymentstream.d.ts.map +1 -1
  67. package/models/operations/deploymentstream.js +3 -0
  68. package/models/operations/deploymentstream.js.map +1 -1
  69. package/models/operations/getallprompts.d.ts +3 -0
  70. package/models/operations/getallprompts.d.ts.map +1 -1
  71. package/models/operations/getallprompts.js +3 -0
  72. package/models/operations/getallprompts.js.map +1 -1
  73. package/models/operations/getalltools.js +6 -6
  74. package/models/operations/getoneprompt.d.ts +3 -0
  75. package/models/operations/getoneprompt.d.ts.map +1 -1
  76. package/models/operations/getoneprompt.js +3 -0
  77. package/models/operations/getoneprompt.js.map +1 -1
  78. package/models/operations/getpromptversion.d.ts +3 -0
  79. package/models/operations/getpromptversion.d.ts.map +1 -1
  80. package/models/operations/getpromptversion.js +3 -0
  81. package/models/operations/getpromptversion.js.map +1 -1
  82. package/models/operations/getv2humanevalsets.js +2 -2
  83. package/models/operations/getv2humanevalsetsid.js +2 -2
  84. package/models/operations/invokeeval.d.ts +1 -1
  85. package/models/operations/invokeeval.d.ts.map +1 -1
  86. package/models/operations/invokeeval.js +1 -1
  87. package/models/operations/invokeeval.js.map +1 -1
  88. package/models/operations/listdatasetdatapoints.js +4 -4
  89. package/models/operations/listdatasets.js +1 -1
  90. package/models/operations/listdatasources.js +1 -1
  91. package/models/operations/listpromptversions.d.ts +3 -0
  92. package/models/operations/listpromptversions.d.ts.map +1 -1
  93. package/models/operations/listpromptversions.js +3 -0
  94. package/models/operations/listpromptversions.js.map +1 -1
  95. package/models/operations/patchv2humanevalsetsid.js +2 -2
  96. package/models/operations/postv2feedbackevaluation.js +3 -3
  97. package/models/operations/postv2humanevalsets.js +2 -2
  98. package/models/operations/retrievedatapoint.js +4 -4
  99. package/models/operations/retrievedataset.js +1 -1
  100. package/models/operations/retrievedatasource.js +1 -1
  101. package/models/operations/retrievetool.js +6 -6
  102. package/models/operations/runagent.js +1 -1
  103. package/models/operations/streamrunagent.js +1 -1
  104. package/models/operations/updatedatapoint.js +4 -4
  105. package/models/operations/updatedataset.js +1 -1
  106. package/models/operations/updatedatasource.js +1 -1
  107. package/models/operations/updateprompt.d.ts +3 -0
  108. package/models/operations/updateprompt.d.ts.map +1 -1
  109. package/models/operations/updateprompt.js +3 -0
  110. package/models/operations/updateprompt.js.map +1 -1
  111. package/models/operations/updatetool.js +7 -7
  112. package/package.json +6 -6
  113. package/packages/orq-rc/src/funcs/agentsResponsesCreate.ts +2 -0
  114. package/packages/orq-rc/src/funcs/agentsResponsesGet.ts +2 -0
  115. package/packages/orq-rc/src/funcs/modelsImportLitellm.ts +166 -0
  116. package/packages/orq-rc/src/funcs/modelsListLitellm.ts +144 -0
  117. package/packages/orq-rc/src/funcs/notifiersList.ts +2 -0
  118. package/packages/orq-rc/src/funcs/reportingQuery.ts +3 -1
  119. package/packages/orq-rc/src/funcs/telemetryQuery.ts +162 -0
  120. package/packages/orq-rc/src/funcs/tracesAggregate.ts +3 -1
  121. package/packages/orq-rc/src/lib/config.ts +3 -3
  122. package/packages/orq-rc/src/lib/http.ts +3 -1
  123. package/packages/orq-rc/src/lib/security.ts +10 -5
  124. package/packages/orq-rc/src/models/components/agentstartedstreamingevent.ts +6 -0
  125. package/packages/orq-rc/src/models/components/apikey.ts +6 -0
  126. package/packages/orq-rc/src/models/components/budget.ts +6 -0
  127. package/packages/orq-rc/src/models/components/budgetalert.ts +92 -0
  128. package/packages/orq-rc/src/models/components/budgetalertdimension.ts +22 -0
  129. package/packages/orq-rc/src/models/components/config.ts +44 -0
  130. package/packages/orq-rc/src/models/components/createbudgetrequest.ts +14 -0
  131. package/packages/orq-rc/src/models/components/evaluatorresponsefunction.ts +2 -2
  132. package/packages/orq-rc/src/models/components/evaluatorresponsehttp.ts +2 -2
  133. package/packages/orq-rc/src/models/components/evaluatorresponsejsonschema.ts +2 -2
  134. package/packages/orq-rc/src/models/components/evaluatorresponsellm.ts +2 -2
  135. package/packages/orq-rc/src/models/components/evaluatorresponsepython.ts +2 -2
  136. package/packages/orq-rc/src/models/components/evaluatorresponseragas.ts +2 -2
  137. package/packages/orq-rc/src/models/components/evaluatorresponsetypescript.ts +2 -2
  138. package/packages/orq-rc/src/models/components/filepurpose.ts +1 -0
  139. package/packages/orq-rc/src/models/components/identity.ts +6 -0
  140. package/packages/orq-rc/src/models/components/index.ts +11 -0
  141. package/packages/orq-rc/src/models/components/litellmmodel.ts +50 -0
  142. package/packages/orq-rc/src/models/components/litellmmodelinfo.ts +97 -0
  143. package/packages/orq-rc/src/models/components/litellmparams.ts +43 -0
  144. package/packages/orq-rc/src/models/components/modeldocument.ts +115 -0
  145. package/packages/orq-rc/src/models/components/modelsconfig.ts +1 -0
  146. package/packages/orq-rc/src/models/components/querytelemetrymeta.ts +38 -0
  147. package/packages/orq-rc/src/models/components/querytelemetryrequest.ts +85 -0
  148. package/packages/orq-rc/src/models/components/querytelemetryresponse.ts +42 -0
  149. package/packages/orq-rc/src/models/components/reasoningpart.ts +1 -1
  150. package/packages/orq-rc/src/models/components/telemetryrow.ts +42 -0
  151. package/packages/orq-rc/src/models/components/thinkingconfigenabledschema.ts +1 -0
  152. package/packages/orq-rc/src/models/components/updatebudgetrequest.ts +21 -0
  153. package/packages/orq-rc/src/models/operations/createagentrequest.ts +127 -40
  154. package/packages/orq-rc/src/models/operations/createchatcompletion.ts +1 -0
  155. package/packages/orq-rc/src/models/operations/createdataset.ts +1 -1
  156. package/packages/orq-rc/src/models/operations/createdatasetitem.ts +237 -19
  157. package/packages/orq-rc/src/models/operations/createdatasource.ts +1 -1
  158. package/packages/orq-rc/src/models/operations/createeval.ts +179 -175
  159. package/packages/orq-rc/src/models/operations/createknowledge.ts +18 -10
  160. package/packages/orq-rc/src/models/operations/createprompt.ts +6 -0
  161. package/packages/orq-rc/src/models/operations/createrouterresponse.ts +127 -26
  162. package/packages/orq-rc/src/models/operations/createtool.ts +6 -6
  163. package/packages/orq-rc/src/models/operations/deploymentgetconfig.ts +1 -0
  164. package/packages/orq-rc/src/models/operations/deploymentinvoke.ts +3 -0
  165. package/packages/orq-rc/src/models/operations/deployments.ts +4 -0
  166. package/packages/orq-rc/src/models/operations/deploymentstream.ts +3 -0
  167. package/packages/orq-rc/src/models/operations/getallmemories.ts +1 -1
  168. package/packages/orq-rc/src/models/operations/getallmemorydocuments.ts +1 -1
  169. package/packages/orq-rc/src/models/operations/getallmemorystores.ts +1 -1
  170. package/packages/orq-rc/src/models/operations/getallprompts.ts +6 -1
  171. package/packages/orq-rc/src/models/operations/getalltools.ts +6 -6
  172. package/packages/orq-rc/src/models/operations/getevals.ts +1 -1
  173. package/packages/orq-rc/src/models/operations/getoneprompt.ts +5 -0
  174. package/packages/orq-rc/src/models/operations/getpromptversion.ts +5 -0
  175. package/packages/orq-rc/src/models/operations/getv2evaluatorsidversions.ts +1 -1
  176. package/packages/orq-rc/src/models/operations/getv2humanevalsets.ts +2 -2
  177. package/packages/orq-rc/src/models/operations/getv2humanevalsetsid.ts +2 -2
  178. package/packages/orq-rc/src/models/operations/getv2toolstoolidversions.ts +1 -1
  179. package/packages/orq-rc/src/models/operations/invokeeval.ts +2 -2
  180. package/packages/orq-rc/src/models/operations/listagents.ts +8 -0
  181. package/packages/orq-rc/src/models/operations/listchunks.ts +1 -1
  182. package/packages/orq-rc/src/models/operations/listdatasetdatapoints.ts +314 -85
  183. package/packages/orq-rc/src/models/operations/listdatasets.ts +2 -2
  184. package/packages/orq-rc/src/models/operations/listdatasources.ts +1 -1
  185. package/packages/orq-rc/src/models/operations/listpromptversions.ts +6 -1
  186. package/packages/orq-rc/src/models/operations/modelcreate.ts +2 -0
  187. package/packages/orq-rc/src/models/operations/modelcreateautorouter.ts +2 -0
  188. package/packages/orq-rc/src/models/operations/modelcreateawsbedrock.ts +2 -0
  189. package/packages/orq-rc/src/models/operations/modelcreateopenailike.ts +2 -0
  190. package/packages/orq-rc/src/models/operations/modelcreatevertex.ts +2 -0
  191. package/packages/orq-rc/src/models/operations/modelupdate.ts +2 -0
  192. package/packages/orq-rc/src/models/operations/modelupdateautorouter.ts +2 -0
  193. package/packages/orq-rc/src/models/operations/modelupdateawsbedrock.ts +2 -0
  194. package/packages/orq-rc/src/models/operations/modelupdateopenailike.ts +2 -0
  195. package/packages/orq-rc/src/models/operations/notifierlist.ts +13 -0
  196. package/packages/orq-rc/src/models/operations/patchv2humanevalsetsid.ts +2 -2
  197. package/packages/orq-rc/src/models/operations/postv2feedbackevaluation.ts +119 -11
  198. package/packages/orq-rc/src/models/operations/postv2humanevalsets.ts +2 -2
  199. package/packages/orq-rc/src/models/operations/retrieveagentrequest.ts +8 -0
  200. package/packages/orq-rc/src/models/operations/retrievedatapoint.ts +234 -9
  201. package/packages/orq-rc/src/models/operations/retrievedataset.ts +1 -1
  202. package/packages/orq-rc/src/models/operations/retrievedatasource.ts +1 -1
  203. package/packages/orq-rc/src/models/operations/retrievetool.ts +6 -6
  204. package/packages/orq-rc/src/models/operations/runagent.ts +95 -33
  205. package/packages/orq-rc/src/models/operations/streamrunagent.ts +101 -33
  206. package/packages/orq-rc/src/models/operations/updateagent.ts +129 -40
  207. package/packages/orq-rc/src/models/operations/updatedatapoint.ts +229 -9
  208. package/packages/orq-rc/src/models/operations/updatedataset.ts +1 -1
  209. package/packages/orq-rc/src/models/operations/updatedatasource.ts +1 -1
  210. package/packages/orq-rc/src/models/operations/updateprompt.ts +6 -0
  211. package/packages/orq-rc/src/models/operations/updatetool.ts +7 -7
  212. package/packages/orq-rc/src/sdk/feedback.ts +2 -2
  213. package/packages/orq-rc/src/sdk/humanreviewsets.ts +4 -1
  214. package/packages/orq-rc/src/sdk/models.ts +35 -0
  215. package/packages/orq-rc/src/sdk/orqresponses.ts +4 -0
  216. package/packages/orq-rc/src/sdk/reporting.ts +3 -1
  217. package/packages/orq-rc/src/sdk/sdk.ts +6 -0
  218. package/packages/orq-rc/src/sdk/telemetry.ts +27 -0
  219. package/packages/orq-rc/src/sdk/traces.ts +3 -1
  220. package/sdk/feedback.d.ts +2 -2
  221. package/sdk/feedback.js +2 -2
  222. package/sdk/models.d.ts +17 -0
  223. package/sdk/models.d.ts.map +1 -1
  224. package/sdk/models.js +20 -0
  225. package/sdk/models.js.map +1 -1
  226. package/src/funcs/modelsImportLitellm.ts +166 -0
  227. package/src/funcs/modelsListLitellm.ts +144 -0
  228. package/src/lib/config.ts +3 -3
  229. package/src/lib/http.ts +3 -1
  230. package/src/lib/security.ts +10 -5
  231. package/src/models/components/evaluatorresponsefunction.ts +2 -2
  232. package/src/models/components/evaluatorresponsehttp.ts +2 -2
  233. package/src/models/components/evaluatorresponsejsonschema.ts +2 -2
  234. package/src/models/components/evaluatorresponsellm.ts +2 -2
  235. package/src/models/components/evaluatorresponsepython.ts +2 -2
  236. package/src/models/components/evaluatorresponseragas.ts +2 -2
  237. package/src/models/components/evaluatorresponsetypescript.ts +2 -2
  238. package/src/models/components/index.ts +4 -0
  239. package/src/models/components/litellmmodel.ts +50 -0
  240. package/src/models/components/litellmmodelinfo.ts +97 -0
  241. package/src/models/components/litellmparams.ts +43 -0
  242. package/src/models/components/modeldocument.ts +112 -0
  243. package/src/models/components/reasoningpart.ts +1 -1
  244. package/src/models/operations/createdataset.ts +1 -1
  245. package/src/models/operations/createdatasetitem.ts +4 -4
  246. package/src/models/operations/createdatasource.ts +1 -1
  247. package/src/models/operations/createprompt.ts +3 -0
  248. package/src/models/operations/createtool.ts +6 -6
  249. package/src/models/operations/deploymentinvoke.ts +3 -0
  250. package/src/models/operations/deployments.ts +3 -0
  251. package/src/models/operations/deploymentstream.ts +3 -0
  252. package/src/models/operations/getallprompts.ts +3 -0
  253. package/src/models/operations/getalltools.ts +6 -6
  254. package/src/models/operations/getoneprompt.ts +3 -0
  255. package/src/models/operations/getpromptversion.ts +3 -0
  256. package/src/models/operations/getv2humanevalsets.ts +2 -2
  257. package/src/models/operations/getv2humanevalsetsid.ts +2 -2
  258. package/src/models/operations/invokeeval.ts +2 -2
  259. package/src/models/operations/listdatasetdatapoints.ts +4 -4
  260. package/src/models/operations/listdatasets.ts +1 -1
  261. package/src/models/operations/listdatasources.ts +1 -1
  262. package/src/models/operations/listpromptversions.ts +3 -0
  263. package/src/models/operations/patchv2humanevalsetsid.ts +2 -2
  264. package/src/models/operations/postv2feedbackevaluation.ts +3 -3
  265. package/src/models/operations/postv2humanevalsets.ts +2 -2
  266. package/src/models/operations/retrievedatapoint.ts +4 -4
  267. package/src/models/operations/retrievedataset.ts +1 -1
  268. package/src/models/operations/retrievedatasource.ts +1 -1
  269. package/src/models/operations/retrievetool.ts +6 -6
  270. package/src/models/operations/runagent.ts +1 -1
  271. package/src/models/operations/streamrunagent.ts +1 -1
  272. package/src/models/operations/updatedatapoint.ts +4 -4
  273. package/src/models/operations/updatedataset.ts +1 -1
  274. package/src/models/operations/updatedatasource.ts +1 -1
  275. package/src/models/operations/updateprompt.ts +3 -0
  276. package/src/models/operations/updatetool.ts +7 -7
  277. package/src/sdk/feedback.ts +2 -2
  278. package/src/sdk/models.ts +35 -0
@@ -0,0 +1,144 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { OrqCore } from "../core.js";
7
+ import { matchStatusCode } from "../lib/http.js";
8
+ import * as M from "../lib/matchers.js";
9
+ import { compactMap } from "../lib/primitives.js";
10
+ import { RequestOptions } from "../lib/sdks.js";
11
+ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
12
+ import { pathToFunc } from "../lib/url.js";
13
+ import {
14
+ ConnectionError,
15
+ InvalidRequestError,
16
+ RequestAbortedError,
17
+ RequestTimeoutError,
18
+ UnexpectedClientError,
19
+ } from "../models/errors/httpclienterrors.js";
20
+ import { OrqError } from "../models/errors/orqerror.js";
21
+ import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
22
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
23
+ import { APICall, APIPromise } from "../types/async.js";
24
+ import { Result } from "../types/fp.js";
25
+
26
+ /**
27
+ * List models from configured LiteLLM instance
28
+ *
29
+ * @remarks
30
+ * Fetches the list of models from the LiteLLM instance configured for the workspace. Requires a stored LiteLLM integration.
31
+ */
32
+ export function modelsListLitellm(
33
+ client: OrqCore,
34
+ options?: RequestOptions,
35
+ ): APIPromise<
36
+ Result<
37
+ Array<{ [k: string]: any }>,
38
+ | OrqError
39
+ | ResponseValidationError
40
+ | ConnectionError
41
+ | RequestAbortedError
42
+ | RequestTimeoutError
43
+ | InvalidRequestError
44
+ | UnexpectedClientError
45
+ | SDKValidationError
46
+ >
47
+ > {
48
+ return new APIPromise($do(
49
+ client,
50
+ options,
51
+ ));
52
+ }
53
+
54
+ async function $do(
55
+ client: OrqCore,
56
+ options?: RequestOptions,
57
+ ): Promise<
58
+ [
59
+ Result<
60
+ Array<{ [k: string]: any }>,
61
+ | OrqError
62
+ | ResponseValidationError
63
+ | ConnectionError
64
+ | RequestAbortedError
65
+ | RequestTimeoutError
66
+ | InvalidRequestError
67
+ | UnexpectedClientError
68
+ | SDKValidationError
69
+ >,
70
+ APICall,
71
+ ]
72
+ > {
73
+ const path = pathToFunc("/v2/models/litellm/models")();
74
+
75
+ const headers = new Headers(compactMap({
76
+ Accept: "application/json",
77
+ }));
78
+
79
+ const secConfig = await extractSecurity(client._options.apiKey);
80
+ const securityInput = secConfig == null ? {} : { apiKey: secConfig };
81
+ const requestSecurity = resolveGlobalSecurity(securityInput);
82
+
83
+ const context = {
84
+ options: client._options,
85
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
86
+ operationID: "ModelListLitellm",
87
+ oAuth2Scopes: null,
88
+
89
+ resolvedSecurity: requestSecurity,
90
+
91
+ securitySource: client._options.apiKey,
92
+ retryConfig: options?.retries
93
+ || client._options.retryConfig
94
+ || { strategy: "none" },
95
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
96
+ };
97
+
98
+ const requestRes = client._createRequest(context, {
99
+ security: requestSecurity,
100
+ method: "GET",
101
+ baseURL: options?.serverURL,
102
+ path: path,
103
+ headers: headers,
104
+ userAgent: client._options.userAgent,
105
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
106
+ }, options);
107
+ if (!requestRes.ok) {
108
+ return [requestRes, { status: "invalid" }];
109
+ }
110
+ const req = requestRes.value;
111
+
112
+ const doResult = await client._do(req, {
113
+ context,
114
+ isErrorStatusCode: (statusCode: number) =>
115
+ matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
116
+ retryConfig: context.retryConfig,
117
+ retryCodes: context.retryCodes,
118
+ });
119
+ if (!doResult.ok) {
120
+ return [doResult, { status: "request-error", request: req }];
121
+ }
122
+ const response = doResult.value;
123
+
124
+ const [result] = await M.match<
125
+ Array<{ [k: string]: any }>,
126
+ | OrqError
127
+ | ResponseValidationError
128
+ | ConnectionError
129
+ | RequestAbortedError
130
+ | RequestTimeoutError
131
+ | InvalidRequestError
132
+ | UnexpectedClientError
133
+ | SDKValidationError
134
+ >(
135
+ M.json(200, z.array(z.record(z.any()))),
136
+ M.fail([404, "4XX"]),
137
+ M.fail([500, "5XX"]),
138
+ )(response, req);
139
+ if (!result.ok) {
140
+ return [result, { status: "complete", request: req, response }];
141
+ }
142
+
143
+ return [result, { status: "complete", request: req, response }];
144
+ }
@@ -94,7 +94,9 @@ async function $do(
94
94
  "ending_before": payload?.ending_before,
95
95
  "limit": payload?.limit,
96
96
  "project_id": payload?.project_id,
97
+ "search": payload?.search,
97
98
  "starting_after": payload?.starting_after,
99
+ "type": payload?.type,
98
100
  });
99
101
 
100
102
  const headers = new Headers(compactMap({
@@ -29,7 +29,9 @@ import { Result } from "../types/fp.js";
29
29
  * Query reporting metrics
30
30
  *
31
31
  * @remarks
32
- * Returns time-series analytics for AI usage, cost, latency, evaluator results, and guardrail outcomes. Select a metric and time range, break results down by supported dimensions, apply filters, and optionally include totals for the full range.
32
+ * Deprecated: use TelemetryService.Query (POST /v2/telemetry/query) instead. Returns time-series analytics for AI usage, cost, latency, evaluator results, and guardrail outcomes. Select a metric and time range, break results down by supported dimensions, apply filters, and optionally include totals for the full range.
33
+ *
34
+ * @deprecated method: This will be removed in a future release, please migrate away from it as soon as possible.
33
35
  */
34
36
  export function reportingQuery(
35
37
  client: OrqCore,
@@ -0,0 +1,162 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { OrqCore } from "../core.js";
6
+ import { encodeJSON } from "../lib/encodings.js";
7
+ import { matchStatusCode } from "../lib/http.js";
8
+ import * as M from "../lib/matchers.js";
9
+ import { compactMap } from "../lib/primitives.js";
10
+ import { safeParse } from "../lib/schemas.js";
11
+ import { RequestOptions } from "../lib/sdks.js";
12
+ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
13
+ import { pathToFunc } from "../lib/url.js";
14
+ import * as components from "../models/components/index.js";
15
+ import {
16
+ ConnectionError,
17
+ InvalidRequestError,
18
+ RequestAbortedError,
19
+ RequestTimeoutError,
20
+ UnexpectedClientError,
21
+ } from "../models/errors/httpclienterrors.js";
22
+ import { OrqError } from "../models/errors/orqerror.js";
23
+ import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
24
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
25
+ import { APICall, APIPromise } from "../types/async.js";
26
+ import { Result } from "../types/fp.js";
27
+
28
+ /**
29
+ * Query telemetry
30
+ *
31
+ * @remarks
32
+ * Unified query envelope for traces, metrics, and logs. Selects a source, a compute list, and a time range, with optional grain, group-by, and filters; returns a time series or a single aggregate row per group.
33
+ */
34
+ export function telemetryQuery(
35
+ client: OrqCore,
36
+ request: components.QueryTelemetryRequest,
37
+ options?: RequestOptions,
38
+ ): APIPromise<
39
+ Result<
40
+ components.QueryTelemetryResponse,
41
+ | OrqError
42
+ | ResponseValidationError
43
+ | ConnectionError
44
+ | RequestAbortedError
45
+ | RequestTimeoutError
46
+ | InvalidRequestError
47
+ | UnexpectedClientError
48
+ | SDKValidationError
49
+ >
50
+ > {
51
+ return new APIPromise($do(
52
+ client,
53
+ request,
54
+ options,
55
+ ));
56
+ }
57
+
58
+ async function $do(
59
+ client: OrqCore,
60
+ request: components.QueryTelemetryRequest,
61
+ options?: RequestOptions,
62
+ ): Promise<
63
+ [
64
+ Result<
65
+ components.QueryTelemetryResponse,
66
+ | OrqError
67
+ | ResponseValidationError
68
+ | ConnectionError
69
+ | RequestAbortedError
70
+ | RequestTimeoutError
71
+ | InvalidRequestError
72
+ | UnexpectedClientError
73
+ | SDKValidationError
74
+ >,
75
+ APICall,
76
+ ]
77
+ > {
78
+ const parsed = safeParse(
79
+ request,
80
+ (value) => components.QueryTelemetryRequest$outboundSchema.parse(value),
81
+ "Input validation failed",
82
+ );
83
+ if (!parsed.ok) {
84
+ return [parsed, { status: "invalid" }];
85
+ }
86
+ const payload = parsed.value;
87
+ const body = encodeJSON("body", payload, { explode: true });
88
+
89
+ const path = pathToFunc("/v2/telemetry/query")();
90
+
91
+ const headers = new Headers(compactMap({
92
+ "Content-Type": "application/json",
93
+ Accept: "application/json",
94
+ }));
95
+
96
+ const secConfig = await extractSecurity(client._options.apiKey);
97
+ const securityInput = secConfig == null ? {} : { apiKey: secConfig };
98
+ const requestSecurity = resolveGlobalSecurity(securityInput);
99
+
100
+ const context = {
101
+ options: client._options,
102
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
103
+ operationID: "TelemetryQuery",
104
+ oAuth2Scopes: null,
105
+
106
+ resolvedSecurity: requestSecurity,
107
+
108
+ securitySource: client._options.apiKey,
109
+ retryConfig: options?.retries
110
+ || client._options.retryConfig
111
+ || { strategy: "none" },
112
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
113
+ };
114
+
115
+ const requestRes = client._createRequest(context, {
116
+ security: requestSecurity,
117
+ method: "POST",
118
+ baseURL: options?.serverURL,
119
+ path: path,
120
+ headers: headers,
121
+ body: body,
122
+ userAgent: client._options.userAgent,
123
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
124
+ }, options);
125
+ if (!requestRes.ok) {
126
+ return [requestRes, { status: "invalid" }];
127
+ }
128
+ const req = requestRes.value;
129
+
130
+ const doResult = await client._do(req, {
131
+ context,
132
+ isErrorStatusCode: (statusCode: number) =>
133
+ matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
134
+ retryConfig: context.retryConfig,
135
+ retryCodes: context.retryCodes,
136
+ });
137
+ if (!doResult.ok) {
138
+ return [doResult, { status: "request-error", request: req }];
139
+ }
140
+ const response = doResult.value;
141
+
142
+ const [result] = await M.match<
143
+ components.QueryTelemetryResponse,
144
+ | OrqError
145
+ | ResponseValidationError
146
+ | ConnectionError
147
+ | RequestAbortedError
148
+ | RequestTimeoutError
149
+ | InvalidRequestError
150
+ | UnexpectedClientError
151
+ | SDKValidationError
152
+ >(
153
+ M.json(200, components.QueryTelemetryResponse$inboundSchema),
154
+ M.fail("4XX"),
155
+ M.fail("5XX"),
156
+ )(response, req);
157
+ if (!result.ok) {
158
+ return [result, { status: "complete", request: req, response }];
159
+ }
160
+
161
+ return [result, { status: "complete", request: req, response }];
162
+ }
@@ -29,7 +29,9 @@ import { Result } from "../types/fp.js";
29
29
  * Aggregate traces
30
30
  *
31
31
  * @remarks
32
- * Aggregate trace metrics using the structured trace filter contract.
32
+ * Deprecated: use TelemetryService.Query (POST /v2/telemetry/query, source=TRACES, grain=none) instead. Aggregate trace metrics using the structured trace filter contract.
33
+ *
34
+ * @deprecated method: This will be removed in a future release, please migrate away from it as soon as possible.
33
35
  */
34
36
  export function tracesAggregate(
35
37
  client: OrqCore,
@@ -58,7 +58,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
58
58
  export const SDK_METADATA = {
59
59
  language: "typescript",
60
60
  openapiDocVersion: "2.0",
61
- sdkVersion: "4.12.0-rc.3",
62
- genVersion: "2.915.1",
63
- userAgent: "speakeasy-sdk/typescript 4.12.0-rc.3 2.915.1 2.0 @orq-ai/node",
61
+ sdkVersion: "4.12.0-rc.34",
62
+ genVersion: "2.918.3",
63
+ userAgent: "speakeasy-sdk/typescript 4.12.0-rc.34 2.918.3 2.0 @orq-ai/node",
64
64
  } as const;
@@ -45,8 +45,10 @@ export class HTTPClient {
45
45
  private requestHooks: BeforeRequestHook[] = [];
46
46
  private requestErrorHooks: RequestErrorHook[] = [];
47
47
  private responseHooks: ResponseHook[] = [];
48
+ private options: HTTPClientOptions;
48
49
 
49
- constructor(private options: HTTPClientOptions = {}) {
50
+ constructor(options: HTTPClientOptions = {}) {
51
+ this.options = options;
50
52
  this.fetcher = options.fetcher || DEFAULT_FETCHER;
51
53
  }
52
54
 
@@ -13,17 +13,22 @@ type OAuth2PasswordFlow = {
13
13
  tokenURL: string;
14
14
  };
15
15
 
16
- export enum SecurityErrorCode {
17
- Incomplete = "incomplete",
18
- UnrecognisedSecurityType = "unrecognized_security_type",
19
- }
16
+ export const SecurityErrorCode = {
17
+ Incomplete: "incomplete",
18
+ UnrecognisedSecurityType: "unrecognized_security_type",
19
+ } as const;
20
+ export type SecurityErrorCode =
21
+ (typeof SecurityErrorCode)[keyof typeof SecurityErrorCode];
20
22
 
21
23
  export class SecurityError extends Error {
24
+ public code: SecurityErrorCode;
25
+
22
26
  constructor(
23
- public code: SecurityErrorCode,
27
+ code: SecurityErrorCode,
24
28
  message: string,
25
29
  ) {
26
30
  super(message);
31
+ this.code = code;
27
32
  this.name = "SecurityError";
28
33
  }
29
34
 
@@ -188,6 +188,10 @@ export type Settings = {
188
188
  * If all, the agent will require approval for all tools. If respect_tool, the agent will require approval for tools that have the requires_approval flag set to true. If none, the agent will not require approval for any tools.
189
189
  */
190
190
  toolApprovalRequired: ToolApprovalRequired;
191
+ /**
192
+ * When enabled, this agent is exposed as a selectable target in AI Chat for users to consume.
193
+ */
194
+ chatExposed?: boolean | undefined;
191
195
  tools?: Array<Tools> | undefined;
192
196
  /**
193
197
  * Configuration for an evaluator applied to the agent
@@ -432,6 +436,7 @@ export const Settings$inboundSchema: z.ZodType<
432
436
  tool_approval_required: ToolApprovalRequired$inboundSchema.default(
433
437
  "respect_tool",
434
438
  ),
439
+ chat_exposed: z.boolean().optional(),
435
440
  tools: z.array(z.lazy(() => Tools$inboundSchema)).optional(),
436
441
  evaluators: z.array(z.lazy(() => Evaluators$inboundSchema)).optional(),
437
442
  guardrails: z.array(z.lazy(() => Guardrails$inboundSchema)).optional(),
@@ -441,6 +446,7 @@ export const Settings$inboundSchema: z.ZodType<
441
446
  "max_execution_time": "maxExecutionTime",
442
447
  "max_cost": "maxCost",
443
448
  "tool_approval_required": "toolApprovalRequired",
449
+ "chat_exposed": "chatExposed",
444
450
  });
445
451
  });
446
452
 
@@ -9,6 +9,7 @@ import { Result as SafeParseResult } from "../../types/fp.js";
9
9
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
10
  import { ApiKeyOwner, ApiKeyOwner$inboundSchema } from "./apikeyowner.js";
11
11
  import { ApiKeyStatus, ApiKeyStatus$inboundSchema } from "./apikeystatus.js";
12
+ import { BudgetAlert, BudgetAlert$inboundSchema } from "./budgetalert.js";
12
13
  import { BudgetLimits, BudgetLimits$inboundSchema } from "./budgetlimits.js";
13
14
  import { BudgetMatch, BudgetMatch$inboundSchema } from "./budgetmatch.js";
14
15
  import { BudgetScope, BudgetScope$inboundSchema } from "./budgetscope.js";
@@ -84,6 +85,10 @@ export type ApiKeyBudget = {
84
85
  * has not been spent against in the current period.
85
86
  */
86
87
  usage?: BudgetUsage | undefined;
88
+ /**
89
+ * Threshold notifications. Absent when the budget has none.
90
+ */
91
+ alerts?: Array<BudgetAlert> | undefined;
87
92
  };
88
93
 
89
94
  /**
@@ -210,6 +215,7 @@ export const ApiKeyBudget$inboundSchema: z.ZodType<
210
215
  updated_at: z.string().datetime({ offset: true }).transform(v => new Date(v))
211
216
  .optional(),
212
217
  usage: BudgetUsage$inboundSchema.optional(),
218
+ alerts: z.array(BudgetAlert$inboundSchema).optional(),
213
219
  }).transform((v) => {
214
220
  return remap$(v, {
215
221
  "budget_id": "budgetId",
@@ -7,6 +7,7 @@ import { remap as remap$ } from "../../lib/primitives.js";
7
7
  import { safeParse } from "../../lib/schemas.js";
8
8
  import { Result as SafeParseResult } from "../../types/fp.js";
9
9
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
+ import { BudgetAlert, BudgetAlert$inboundSchema } from "./budgetalert.js";
10
11
  import { BudgetLimits, BudgetLimits$inboundSchema } from "./budgetlimits.js";
11
12
  import { BudgetMatch, BudgetMatch$inboundSchema } from "./budgetmatch.js";
12
13
  import { BudgetScope, BudgetScope$inboundSchema } from "./budgetscope.js";
@@ -71,6 +72,10 @@ export type Budget = {
71
72
  * has not been spent against in the current period.
72
73
  */
73
74
  usage?: BudgetUsage | undefined;
75
+ /**
76
+ * Threshold notifications. Absent when the budget has none.
77
+ */
78
+ alerts?: Array<BudgetAlert> | undefined;
74
79
  };
75
80
 
76
81
  /** @internal */
@@ -92,6 +97,7 @@ export const Budget$inboundSchema: z.ZodType<Budget, z.ZodTypeDef, unknown> = z
92
97
  new Date(v)
93
98
  ).optional(),
94
99
  usage: BudgetUsage$inboundSchema.optional(),
100
+ alerts: z.array(BudgetAlert$inboundSchema).optional(),
95
101
  }).transform((v) => {
96
102
  return remap$(v, {
97
103
  "budget_id": "budgetId",
@@ -0,0 +1,92 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { safeParse } from "../../lib/schemas.js";
8
+ import { Result as SafeParseResult } from "../../types/fp.js";
9
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
+ import {
11
+ BudgetAlertDimension,
12
+ BudgetAlertDimension$inboundSchema,
13
+ BudgetAlertDimension$outboundSchema,
14
+ } from "./budgetalertdimension.js";
15
+
16
+ /**
17
+ * Notifies every listed notifier once current-period consumption on
18
+ *
19
+ * @remarks
20
+ * `dimension` reaches `threshold_percent` of the matching limit. Each alert
21
+ * fires at most once per period, re-arming on rollover or a limit change.
22
+ * The dimension must have a limit set, or the write is rejected.
23
+ */
24
+ export type BudgetAlert = {
25
+ /**
26
+ * Assigned by ORQ. Supply an existing id to edit that alert in place.
27
+ */
28
+ id?: string | undefined;
29
+ /**
30
+ * Percentage of the dimension's limit at which the alert fires, 1–100.
31
+ */
32
+ thresholdPercent: number;
33
+ /**
34
+ * Must be workspace-scoped; project-scoped notifiers are rejected.
35
+ */
36
+ notifierIds: Array<string>;
37
+ dimension?: BudgetAlertDimension | undefined;
38
+ };
39
+
40
+ /** @internal */
41
+ export const BudgetAlert$inboundSchema: z.ZodType<
42
+ BudgetAlert,
43
+ z.ZodTypeDef,
44
+ unknown
45
+ > = z.object({
46
+ id: z.string().optional(),
47
+ threshold_percent: z.number().int(),
48
+ notifier_ids: z.array(z.string()),
49
+ dimension: BudgetAlertDimension$inboundSchema.optional(),
50
+ }).transform((v) => {
51
+ return remap$(v, {
52
+ "threshold_percent": "thresholdPercent",
53
+ "notifier_ids": "notifierIds",
54
+ });
55
+ });
56
+ /** @internal */
57
+ export type BudgetAlert$Outbound = {
58
+ id?: string | undefined;
59
+ threshold_percent: number;
60
+ notifier_ids: Array<string>;
61
+ dimension?: string | undefined;
62
+ };
63
+
64
+ /** @internal */
65
+ export const BudgetAlert$outboundSchema: z.ZodType<
66
+ BudgetAlert$Outbound,
67
+ z.ZodTypeDef,
68
+ BudgetAlert
69
+ > = z.object({
70
+ id: z.string().optional(),
71
+ thresholdPercent: z.number().int(),
72
+ notifierIds: z.array(z.string()),
73
+ dimension: BudgetAlertDimension$outboundSchema.optional(),
74
+ }).transform((v) => {
75
+ return remap$(v, {
76
+ thresholdPercent: "threshold_percent",
77
+ notifierIds: "notifier_ids",
78
+ });
79
+ });
80
+
81
+ export function budgetAlertToJSON(budgetAlert: BudgetAlert): string {
82
+ return JSON.stringify(BudgetAlert$outboundSchema.parse(budgetAlert));
83
+ }
84
+ export function budgetAlertFromJSON(
85
+ jsonString: string,
86
+ ): SafeParseResult<BudgetAlert, SDKValidationError> {
87
+ return safeParse(
88
+ jsonString,
89
+ (x) => BudgetAlert$inboundSchema.parse(JSON.parse(x)),
90
+ `Failed to parse 'BudgetAlert' from JSON`,
91
+ );
92
+ }
@@ -0,0 +1,22 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { ClosedEnum } from "../../types/enums.js";
7
+
8
+ export const BudgetAlertDimension = {
9
+ BudgetAlertDimensionUnspecified: "BUDGET_ALERT_DIMENSION_UNSPECIFIED",
10
+ BudgetAlertDimensionCost: "BUDGET_ALERT_DIMENSION_COST",
11
+ BudgetAlertDimensionTokens: "BUDGET_ALERT_DIMENSION_TOKENS",
12
+ } as const;
13
+ export type BudgetAlertDimension = ClosedEnum<typeof BudgetAlertDimension>;
14
+
15
+ /** @internal */
16
+ export const BudgetAlertDimension$inboundSchema: z.ZodNativeEnum<
17
+ typeof BudgetAlertDimension
18
+ > = z.nativeEnum(BudgetAlertDimension);
19
+ /** @internal */
20
+ export const BudgetAlertDimension$outboundSchema: z.ZodNativeEnum<
21
+ typeof BudgetAlertDimension
22
+ > = BudgetAlertDimension$inboundSchema;
@@ -0,0 +1,44 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { safeParse } from "../../lib/schemas.js";
8
+ import { Result as SafeParseResult } from "../../types/fp.js";
9
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
+
11
+ export type Config = {
12
+ allowFork: boolean;
13
+ allowVersionPin: boolean;
14
+ autoGrantNewProjects: boolean;
15
+ mode: string;
16
+ projectIds?: Array<string> | null | undefined;
17
+ };
18
+
19
+ /** @internal */
20
+ export const Config$inboundSchema: z.ZodType<Config, z.ZodTypeDef, unknown> = z
21
+ .object({
22
+ allow_fork: z.boolean(),
23
+ allow_version_pin: z.boolean(),
24
+ auto_grant_new_projects: z.boolean(),
25
+ mode: z.string(),
26
+ project_ids: z.nullable(z.array(z.string())).optional(),
27
+ }).transform((v) => {
28
+ return remap$(v, {
29
+ "allow_fork": "allowFork",
30
+ "allow_version_pin": "allowVersionPin",
31
+ "auto_grant_new_projects": "autoGrantNewProjects",
32
+ "project_ids": "projectIds",
33
+ });
34
+ });
35
+
36
+ export function configFromJSON(
37
+ jsonString: string,
38
+ ): SafeParseResult<Config, SDKValidationError> {
39
+ return safeParse(
40
+ jsonString,
41
+ (x) => Config$inboundSchema.parse(JSON.parse(x)),
42
+ `Failed to parse 'Config' from JSON`,
43
+ );
44
+ }
@@ -4,6 +4,11 @@
4
4
 
5
5
  import * as z from "zod/v3";
6
6
  import { remap as remap$ } from "../../lib/primitives.js";
7
+ import {
8
+ BudgetAlert,
9
+ BudgetAlert$Outbound,
10
+ BudgetAlert$outboundSchema,
11
+ } from "./budgetalert.js";
7
12
  import {
8
13
  BudgetLimits,
9
14
  BudgetLimits$Outbound,
@@ -68,6 +73,13 @@ export type CreateBudgetRequest = {
68
73
  * the value MUST be in the future; the handler rejects past values.
69
74
  */
70
75
  expiresAt?: Date | undefined;
76
+ /**
77
+ * Optional threshold notifications. Ids are assigned by the server, so
78
+ *
79
+ * @remarks
80
+ * `alerts[].id` must be omitted here; supplying one is rejected.
81
+ */
82
+ alerts?: Array<BudgetAlert> | undefined;
71
83
  };
72
84
 
73
85
  /** @internal */
@@ -78,6 +90,7 @@ export type CreateBudgetRequest$Outbound = {
78
90
  rate_limit?: RateLimit$Outbound | undefined;
79
91
  is_active?: boolean | undefined;
80
92
  expires_at?: string | undefined;
93
+ alerts?: Array<BudgetAlert$Outbound> | undefined;
81
94
  };
82
95
 
83
96
  /** @internal */
@@ -92,6 +105,7 @@ export const CreateBudgetRequest$outboundSchema: z.ZodType<
92
105
  rateLimit: RateLimit$outboundSchema.optional(),
93
106
  isActive: z.boolean().optional(),
94
107
  expiresAt: z.date().transform(v => v.toISOString()).optional(),
108
+ alerts: z.array(BudgetAlert$outboundSchema).optional(),
95
109
  }).transform((v) => {
96
110
  return remap$(v, {
97
111
  rateLimit: "rate_limit",