@orq-ai/node 4.9.24 → 4.9.29

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 (244) hide show
  1. package/jsr.json +1 -1
  2. package/lib/config.d.ts +3 -3
  3. package/lib/config.js +3 -3
  4. package/models/components/reasoningpart.js +1 -1
  5. package/models/operations/createagentresponserequest.d.ts.map +1 -1
  6. package/models/operations/createagentresponserequest.js +3 -1
  7. package/models/operations/createagentresponserequest.js.map +1 -1
  8. package/models/operations/createchatcompletion.d.ts.map +1 -1
  9. package/models/operations/createchatcompletion.js +3 -1
  10. package/models/operations/createchatcompletion.js.map +1 -1
  11. package/models/operations/createcompletion.d.ts.map +1 -1
  12. package/models/operations/createcompletion.js +3 -1
  13. package/models/operations/createcompletion.js.map +1 -1
  14. package/models/operations/createcontact.js +1 -1
  15. package/models/operations/createdataset.js +1 -1
  16. package/models/operations/createdatasetitem.js +4 -4
  17. package/models/operations/createdatasource.js +1 -1
  18. package/models/operations/createeval.js +16 -16
  19. package/models/operations/createidentity.js +1 -1
  20. package/models/operations/createrouterresponse.d.ts.map +1 -1
  21. package/models/operations/createrouterresponse.js +3 -1
  22. package/models/operations/createrouterresponse.js.map +1 -1
  23. package/models/operations/createtool.js +6 -6
  24. package/models/operations/deploymentstream.d.ts.map +1 -1
  25. package/models/operations/deploymentstream.js +3 -1
  26. package/models/operations/deploymentstream.js.map +1 -1
  27. package/models/operations/getalltools.js +6 -6
  28. package/models/operations/getevals.js +16 -16
  29. package/models/operations/getv2humanevalsets.js +2 -2
  30. package/models/operations/getv2humanevalsetsid.js +2 -2
  31. package/models/operations/listdatasetdatapoints.js +4 -4
  32. package/models/operations/listdatasets.js +1 -1
  33. package/models/operations/listdatasources.js +1 -1
  34. package/models/operations/listidentities.js +1 -1
  35. package/models/operations/patchv2humanevalsetsid.js +2 -2
  36. package/models/operations/postv2feedbackevaluation.js +3 -3
  37. package/models/operations/postv2humanevalsets.js +2 -2
  38. package/models/operations/retrievedatapoint.js +4 -4
  39. package/models/operations/retrievedataset.js +1 -1
  40. package/models/operations/retrievedatasource.js +1 -1
  41. package/models/operations/retrieveidentity.js +1 -1
  42. package/models/operations/retrievetool.js +6 -6
  43. package/models/operations/runagent.js +1 -1
  44. package/models/operations/streamagent.d.ts.map +1 -1
  45. package/models/operations/streamagent.js +3 -1
  46. package/models/operations/streamagent.js.map +1 -1
  47. package/models/operations/streamrunagent.d.ts.map +1 -1
  48. package/models/operations/streamrunagent.js +4 -2
  49. package/models/operations/streamrunagent.js.map +1 -1
  50. package/models/operations/updatedatapoint.js +4 -4
  51. package/models/operations/updatedataset.js +1 -1
  52. package/models/operations/updatedatasource.js +1 -1
  53. package/models/operations/updateeval.js +16 -16
  54. package/models/operations/updateidentity.js +1 -1
  55. package/models/operations/updatetool.js +7 -7
  56. package/package.json +3 -3
  57. package/packages/orq-rc/src/funcs/annotationsCreate.ts +3 -0
  58. package/packages/orq-rc/src/funcs/annotationsDelete.ts +3 -0
  59. package/packages/orq-rc/src/funcs/deploymentsInvoke.ts +5 -13
  60. package/packages/orq-rc/src/funcs/deploymentsStream.ts +1 -9
  61. package/packages/orq-rc/src/funcs/identitiesCreate.ts +1 -1
  62. package/packages/orq-rc/src/funcs/knowledgeGetChunksCount.ts +3 -0
  63. package/packages/orq-rc/src/funcs/modelsAzureFoundryDeployments.ts +168 -0
  64. package/packages/orq-rc/src/funcs/modelsCreate.ts +162 -0
  65. package/packages/orq-rc/src/funcs/modelsCreateAutorouter.ts +163 -0
  66. package/packages/orq-rc/src/funcs/modelsCreateAwsBedrock.ts +163 -0
  67. package/packages/orq-rc/src/funcs/modelsCreateOpenaiLike.ts +163 -0
  68. package/packages/orq-rc/src/funcs/modelsCreateVertex.ts +163 -0
  69. package/packages/orq-rc/src/funcs/modelsDelete.ts +168 -0
  70. package/packages/orq-rc/src/funcs/modelsDisable.ts +168 -0
  71. package/packages/orq-rc/src/funcs/modelsEnable.ts +163 -0
  72. package/packages/orq-rc/src/funcs/{agentsPostV2AgentsA2a.ts → modelsImportLitellm.ts} +16 -30
  73. package/packages/orq-rc/src/funcs/modelsListLitellm.ts +144 -0
  74. package/packages/orq-rc/src/funcs/{deploymentsMetricsCreate.ts → modelsUpdate.ts} +14 -17
  75. package/packages/orq-rc/src/funcs/modelsUpdateAutorouter.ts +169 -0
  76. package/packages/orq-rc/src/funcs/modelsUpdateAwsBedrock.ts +169 -0
  77. package/packages/orq-rc/src/funcs/modelsUpdateOpenaiLike.ts +169 -0
  78. package/packages/orq-rc/src/funcs/modelsValidate.ts +163 -0
  79. package/packages/orq-rc/src/funcs/modelsValidateAwsBedrock.ts +164 -0
  80. package/packages/orq-rc/src/funcs/piiDetect.ts +162 -0
  81. package/packages/orq-rc/src/funcs/piiRedact.ts +162 -0
  82. package/packages/orq-rc/src/funcs/piiRestore.ts +162 -0
  83. package/packages/orq-rc/src/lib/config.ts +3 -13
  84. package/packages/orq-rc/src/lib/env.ts +0 -32
  85. package/packages/orq-rc/src/lib/sdks.ts +2 -2
  86. package/packages/orq-rc/src/models/components/agentthoughtstreamingevent.ts +43 -55
  87. package/packages/orq-rc/src/models/components/apikey.ts +3 -12
  88. package/packages/orq-rc/src/models/components/autorouterconfig.ts +78 -0
  89. package/packages/orq-rc/src/models/components/azurefoundrydeployment.ts +44 -0
  90. package/packages/orq-rc/src/models/components/azurefoundrydeploymentmasterdata.ts +60 -0
  91. package/packages/orq-rc/src/models/components/createmodelparameter.ts +54 -0
  92. package/packages/orq-rc/src/models/components/createprojectrequest.ts +6 -0
  93. package/packages/orq-rc/src/models/components/detectrequest.ts +56 -0
  94. package/packages/orq-rc/src/models/components/detectresponse.ts +41 -0
  95. package/packages/orq-rc/src/models/components/domain.ts +14 -21
  96. package/packages/orq-rc/src/models/components/embeddingcacheconfig.ts +59 -0
  97. package/packages/orq-rc/src/models/components/embeddingcontactparams.ts +48 -0
  98. package/packages/orq-rc/src/models/components/embeddingloadbalancerconfig.ts +66 -0
  99. package/packages/orq-rc/src/models/components/embeddingloadbalancermodelconfig.ts +42 -0
  100. package/packages/orq-rc/src/models/components/embeddingorqparams.ts +101 -0
  101. package/packages/orq-rc/src/models/components/embeddingretryconfig.ts +45 -0
  102. package/packages/orq-rc/src/models/components/embeddingtimeoutconfig.ts +39 -0
  103. package/packages/orq-rc/src/models/components/evaluatorref.ts +4 -0
  104. package/packages/orq-rc/src/models/components/guardrailref.ts +4 -0
  105. package/packages/orq-rc/src/models/components/index.ts +36 -3
  106. package/packages/orq-rc/src/models/components/listcapabilitiesresponse.ts +1 -2
  107. package/packages/orq-rc/src/models/components/litellmmodel.ts +50 -0
  108. package/packages/orq-rc/src/models/components/litellmmodelinfo.ts +97 -0
  109. package/packages/orq-rc/src/models/components/litellmparams.ts +43 -0
  110. package/packages/orq-rc/src/models/components/modelconfigurationresponse.ts +82 -0
  111. package/packages/orq-rc/src/models/components/modeldocument.ts +112 -0
  112. package/packages/orq-rc/src/models/components/modelmetadata.ts +720 -0
  113. package/packages/orq-rc/src/models/components/modelparameterdocument.ts +53 -0
  114. package/packages/orq-rc/src/models/components/price.ts +56 -0
  115. package/packages/orq-rc/src/models/components/pricing.ts +93 -0
  116. package/packages/orq-rc/src/models/components/pricingvariant.ts +90 -0
  117. package/packages/orq-rc/src/models/components/project.ts +5 -0
  118. package/packages/orq-rc/src/models/components/publicembeddingdata.ts +60 -0
  119. package/packages/orq-rc/src/models/components/publicembeddingusage.ts +45 -0
  120. package/packages/orq-rc/src/models/components/publicmodelentry.ts +7 -6
  121. package/packages/orq-rc/src/models/components/reasoningpart.ts +1 -1
  122. package/packages/orq-rc/src/models/components/redactrequest.ts +33 -0
  123. package/packages/orq-rc/src/models/components/redactresponse.ts +41 -0
  124. package/packages/orq-rc/src/models/components/restorerequest.ts +38 -0
  125. package/packages/orq-rc/src/models/components/restoreresponse.ts +36 -0
  126. package/packages/orq-rc/src/models/components/updatemodelparameter.ts +61 -0
  127. package/packages/orq-rc/src/models/components/updateprojectrequest.ts +6 -0
  128. package/packages/orq-rc/src/models/components/vertexcapabilities.ts +37 -0
  129. package/packages/orq-rc/src/models/components/vertexconfiguration.ts +45 -0
  130. package/packages/orq-rc/src/models/components/vertexmodelconfiguration.ts +53 -0
  131. package/packages/orq-rc/src/models/components/vertexparameters.ts +47 -0
  132. package/packages/orq-rc/src/models/components/vertexparamrange.ts +34 -0
  133. package/packages/orq-rc/src/models/components/vertexparamrangeint.ts +34 -0
  134. package/packages/orq-rc/src/models/errors/index.ts +0 -1
  135. package/packages/orq-rc/src/models/operations/createagentrequest.ts +14 -101
  136. package/packages/orq-rc/src/models/operations/createagentresponserequest.ts +2 -1
  137. package/packages/orq-rc/src/models/operations/createchatcompletion.ts +2 -1
  138. package/packages/orq-rc/src/models/operations/createcompletion.ts +2 -1
  139. package/packages/orq-rc/src/models/operations/createdataset.ts +1 -1
  140. package/packages/orq-rc/src/models/operations/createdatasetitem.ts +4 -4
  141. package/packages/orq-rc/src/models/operations/createdatasource.ts +7 -1
  142. package/packages/orq-rc/src/models/operations/createembedding.ts +82 -810
  143. package/packages/orq-rc/src/models/operations/createeval.ts +630 -1333
  144. package/packages/orq-rc/src/models/operations/createrouterresponse.ts +33 -15
  145. package/packages/orq-rc/src/models/operations/createtool.ts +24 -28
  146. package/packages/orq-rc/src/models/operations/deploymentgetconfig.ts +1606 -1156
  147. package/packages/orq-rc/src/models/operations/deploymentinvoke.ts +3761 -320
  148. package/packages/orq-rc/src/models/operations/deploymentstream.ts +287 -250
  149. package/packages/orq-rc/src/models/operations/getalltools.ts +6 -6
  150. package/packages/orq-rc/src/models/operations/getevals.ts +16 -64
  151. package/packages/orq-rc/src/models/operations/getv2humanevalsets.ts +2 -2
  152. package/packages/orq-rc/src/models/operations/getv2humanevalsetsid.ts +2 -2
  153. package/packages/orq-rc/src/models/operations/index.ts +15 -2
  154. package/packages/orq-rc/src/models/operations/listagents.ts +3 -87
  155. package/packages/orq-rc/src/models/operations/listchunks.ts +35 -6
  156. package/packages/orq-rc/src/models/operations/listdatasetdatapoints.ts +4 -4
  157. package/packages/orq-rc/src/models/operations/listdatasets.ts +1 -1
  158. package/packages/orq-rc/src/models/operations/listdatasources.ts +1 -1
  159. package/packages/orq-rc/src/models/operations/modelazurefoundrydeployments.ts +90 -0
  160. package/packages/orq-rc/src/models/operations/modelcreate.ts +184 -0
  161. package/packages/orq-rc/src/models/operations/modelcreateautorouter.ts +151 -0
  162. package/packages/orq-rc/src/models/operations/modelcreateawsbedrock.ts +218 -0
  163. package/packages/orq-rc/src/models/operations/modelcreateopenailike.ts +202 -0
  164. package/packages/orq-rc/src/models/operations/modelcreatevertex.ts +144 -0
  165. package/packages/orq-rc/src/models/operations/modeldelete.ts +34 -0
  166. package/packages/orq-rc/src/models/operations/modeldisable.ts +39 -0
  167. package/packages/orq-rc/src/models/operations/modelenable.ts +36 -0
  168. package/packages/orq-rc/src/models/operations/modelupdate.ts +198 -0
  169. package/packages/orq-rc/src/models/operations/modelupdateautorouter.ts +189 -0
  170. package/packages/orq-rc/src/models/operations/modelupdateawsbedrock.ts +248 -0
  171. package/packages/orq-rc/src/models/operations/modelupdateopenailike.ts +236 -0
  172. package/packages/orq-rc/src/models/operations/modelvalidate.ts +57 -0
  173. package/packages/orq-rc/src/models/operations/modelvalidateawsbedrock.ts +57 -0
  174. package/packages/orq-rc/src/models/operations/patchv2humanevalsetsid.ts +2 -2
  175. package/packages/orq-rc/src/models/operations/postv2feedbackevaluation.ts +3 -3
  176. package/packages/orq-rc/src/models/operations/postv2humanevalsets.ts +2 -2
  177. package/packages/orq-rc/src/models/operations/retrieveagentrequest.ts +0 -91
  178. package/packages/orq-rc/src/models/operations/retrievedatapoint.ts +4 -4
  179. package/packages/orq-rc/src/models/operations/retrievedataset.ts +1 -1
  180. package/packages/orq-rc/src/models/operations/retrievedatasource.ts +1 -1
  181. package/packages/orq-rc/src/models/operations/retrievetool.ts +6 -6
  182. package/packages/orq-rc/src/models/operations/runagent.ts +20 -29
  183. package/packages/orq-rc/src/models/operations/streamagent.ts +2 -1
  184. package/packages/orq-rc/src/models/operations/streamrunagent.ts +3 -2
  185. package/packages/orq-rc/src/models/operations/updateagent.ts +0 -171
  186. package/packages/orq-rc/src/models/operations/updatedatapoint.ts +4 -4
  187. package/packages/orq-rc/src/models/operations/updatedataset.ts +1 -1
  188. package/packages/orq-rc/src/models/operations/updatedatasource.ts +1 -1
  189. package/packages/orq-rc/src/models/operations/updateeval.ts +41 -100
  190. package/packages/orq-rc/src/models/operations/updatetool.ts +7 -7
  191. package/packages/orq-rc/src/sdk/agents.ts +17 -35
  192. package/packages/orq-rc/src/sdk/annotations.ts +6 -0
  193. package/packages/orq-rc/src/sdk/deployments.ts +1 -8
  194. package/packages/orq-rc/src/sdk/knowledge.ts +3 -0
  195. package/packages/orq-rc/src/sdk/models.ts +305 -0
  196. package/packages/orq-rc/src/sdk/pii.ts +63 -0
  197. package/packages/orq-rc/src/sdk/router.ts +5 -5
  198. package/packages/orq-rc/src/sdk/sdk.ts +11 -5
  199. package/src/lib/config.ts +3 -3
  200. package/src/models/components/reasoningpart.ts +1 -1
  201. package/src/models/operations/createagentresponserequest.ts +2 -1
  202. package/src/models/operations/createchatcompletion.ts +2 -1
  203. package/src/models/operations/createcompletion.ts +2 -1
  204. package/src/models/operations/createcontact.ts +1 -1
  205. package/src/models/operations/createdataset.ts +1 -1
  206. package/src/models/operations/createdatasetitem.ts +4 -4
  207. package/src/models/operations/createdatasource.ts +1 -1
  208. package/src/models/operations/createeval.ts +16 -16
  209. package/src/models/operations/createidentity.ts +1 -1
  210. package/src/models/operations/createrouterresponse.ts +2 -1
  211. package/src/models/operations/createtool.ts +6 -6
  212. package/src/models/operations/deploymentstream.ts +2 -1
  213. package/src/models/operations/getalltools.ts +6 -6
  214. package/src/models/operations/getevals.ts +16 -16
  215. package/src/models/operations/getv2humanevalsets.ts +2 -2
  216. package/src/models/operations/getv2humanevalsetsid.ts +2 -2
  217. package/src/models/operations/listdatasetdatapoints.ts +4 -4
  218. package/src/models/operations/listdatasets.ts +1 -1
  219. package/src/models/operations/listdatasources.ts +1 -1
  220. package/src/models/operations/listidentities.ts +1 -1
  221. package/src/models/operations/patchv2humanevalsetsid.ts +2 -2
  222. package/src/models/operations/postv2feedbackevaluation.ts +3 -3
  223. package/src/models/operations/postv2humanevalsets.ts +2 -2
  224. package/src/models/operations/retrievedatapoint.ts +4 -4
  225. package/src/models/operations/retrievedataset.ts +1 -1
  226. package/src/models/operations/retrievedatasource.ts +1 -1
  227. package/src/models/operations/retrieveidentity.ts +1 -1
  228. package/src/models/operations/retrievetool.ts +6 -6
  229. package/src/models/operations/runagent.ts +1 -1
  230. package/src/models/operations/streamagent.ts +2 -1
  231. package/src/models/operations/streamrunagent.ts +3 -2
  232. package/src/models/operations/updatedatapoint.ts +4 -4
  233. package/src/models/operations/updatedataset.ts +1 -1
  234. package/src/models/operations/updatedatasource.ts +1 -1
  235. package/src/models/operations/updateeval.ts +16 -16
  236. package/src/models/operations/updateidentity.ts +1 -1
  237. package/src/models/operations/updatetool.ts +7 -7
  238. package/packages/orq-rc/src/models/components/domaingroup.ts +0 -18
  239. package/packages/orq-rc/src/models/components/invokedeploymentrequest.ts +0 -3457
  240. package/packages/orq-rc/src/models/components/scopemode.ts +0 -17
  241. package/packages/orq-rc/src/models/errors/postv2agentsa2a.ts +0 -96
  242. package/packages/orq-rc/src/models/operations/deploymentcreatemetric.ts +0 -2370
  243. package/packages/orq-rc/src/models/operations/postv2agentsa2a.ts +0 -249
  244. package/packages/orq-rc/src/sdk/metrics.ts +0 -29
@@ -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
+ * Redact PII
30
+ *
31
+ * @remarks
32
+ * Replaces detected PII with placeholders and returns the reverse mapping needed to restore the original text.
33
+ */
34
+ export function piiRedact(
35
+ client: OrqCore,
36
+ request: components.RedactRequest,
37
+ options?: RequestOptions,
38
+ ): APIPromise<
39
+ Result<
40
+ components.RedactResponse,
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.RedactRequest,
61
+ options?: RequestOptions,
62
+ ): Promise<
63
+ [
64
+ Result<
65
+ components.RedactResponse,
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.RedactRequest$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/pii/redact")();
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: "PIIRedact",
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.RedactResponse,
144
+ | OrqError
145
+ | ResponseValidationError
146
+ | ConnectionError
147
+ | RequestAbortedError
148
+ | RequestTimeoutError
149
+ | InvalidRequestError
150
+ | UnexpectedClientError
151
+ | SDKValidationError
152
+ >(
153
+ M.json(200, components.RedactResponse$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
+ }
@@ -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
+ * Restore redacted text
30
+ *
31
+ * @remarks
32
+ * Reverses a redaction, substituting placeholders back to their original values using the mapping returned by Redact.
33
+ */
34
+ export function piiRestore(
35
+ client: OrqCore,
36
+ request: components.RestoreRequest,
37
+ options?: RequestOptions,
38
+ ): APIPromise<
39
+ Result<
40
+ components.RestoreResponse,
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.RestoreRequest,
61
+ options?: RequestOptions,
62
+ ): Promise<
63
+ [
64
+ Result<
65
+ components.RestoreResponse,
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.RestoreRequest$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/pii/restore")();
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: "PIIRestore",
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.RestoreResponse,
144
+ | OrqError
145
+ | ResponseValidationError
146
+ | ConnectionError
147
+ | RequestAbortedError
148
+ | RequestTimeoutError
149
+ | InvalidRequestError
150
+ | UnexpectedClientError
151
+ | SDKValidationError
152
+ >(
153
+ M.json(200, components.RestoreResponse$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
+ }
@@ -17,16 +17,6 @@ export const ServerList = [
17
17
  export type SDKOptions = {
18
18
  apiKey?: string | (() => Promise<string>) | undefined;
19
19
 
20
- /**
21
- * Allows setting the contactId parameter for all supported operations
22
- */
23
- contactId?: string | undefined;
24
-
25
- /**
26
- * Allows setting the environment parameter for all supported operations
27
- */
28
- environment?: string | undefined;
29
-
30
20
  httpClient?: HTTPClient;
31
21
  /**
32
22
  * Allows overriding the default server used by the SDK
@@ -68,7 +58,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
68
58
  export const SDK_METADATA = {
69
59
  language: "typescript",
70
60
  openapiDocVersion: "2.0",
71
- sdkVersion: "4.10.0-rc.33",
72
- genVersion: "2.886.0",
73
- userAgent: "speakeasy-sdk/typescript 4.10.0-rc.33 2.886.0 2.0 @orq-ai/node",
61
+ sdkVersion: "4.10.0-rc.67",
62
+ genVersion: "2.892.5",
63
+ userAgent: "speakeasy-sdk/typescript 4.10.0-rc.67 2.892.5 2.0 @orq-ai/node",
74
64
  } as const;
@@ -3,31 +3,17 @@
3
3
  */
4
4
 
5
5
  import * as z from "zod/v3";
6
- import { SDKOptions } from "./config.js";
7
6
  import { dlv } from "./dlv.js";
8
7
 
9
8
  export interface Env {
10
9
  ORQ_API_KEY?: string | undefined;
11
10
 
12
- /**
13
- * Sets the contactId parameter for all supported operations
14
- */
15
- ORQ_CONTACT_ID?: string | undefined;
16
-
17
- /**
18
- * Sets the environment parameter for all supported operations
19
- */
20
- ORQ_ENVIRONMENT?: string | undefined;
21
-
22
11
  ORQ_DEBUG?: boolean | undefined;
23
12
  }
24
13
 
25
14
  export const envSchema: z.ZodType<Env, z.ZodTypeDef, unknown> = z.object({
26
15
  ORQ_API_KEY: z.string().optional(),
27
16
 
28
- ORQ_CONTACT_ID: z.string().optional(),
29
- ORQ_ENVIRONMENT: z.string().optional(),
30
-
31
17
  ORQ_DEBUG: z.coerce.boolean().optional(),
32
18
  });
33
19
 
@@ -69,21 +55,3 @@ export function env(): Env {
69
55
  export function resetEnv() {
70
56
  envMemo = undefined;
71
57
  }
72
-
73
- /**
74
- * Populates global parameters with environment variables.
75
- */
76
- export function fillGlobals(options: SDKOptions): SDKOptions {
77
- const clone = { ...options };
78
-
79
- const envVars = env();
80
-
81
- if (typeof envVars.ORQ_CONTACT_ID !== "undefined") {
82
- clone.contactId ??= envVars.ORQ_CONTACT_ID;
83
- }
84
- if (typeof envVars.ORQ_ENVIRONMENT !== "undefined") {
85
- clone.environment ??= envVars.ORQ_ENVIRONMENT;
86
- }
87
-
88
- return clone;
89
- }
@@ -15,7 +15,7 @@ import { ERR, OK, Result } from "../types/fp.js";
15
15
  import { stringToBase64 } from "./base64.js";
16
16
  import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "./config.js";
17
17
  import { encodeForm } from "./encodings.js";
18
- import { env, fillGlobals } from "./env.js";
18
+ import { env } from "./env.js";
19
19
  import {
20
20
  HTTPClient,
21
21
  isAbortError,
@@ -108,7 +108,7 @@ export class ClientSDK {
108
108
  this._baseURL = baseURL;
109
109
  this.#httpClient = client;
110
110
 
111
- this._options = { ...fillGlobals(options), hooks: this.#hooks };
111
+ this._options = { ...options, hooks: this.#hooks };
112
112
 
113
113
  this.#logger = this._options.debugLogger;
114
114
  if (!this.#logger && env().ORQ_DEBUG) {
@@ -83,7 +83,7 @@ export type AgentThoughtStreamingEventFunction = {
83
83
  arguments?: string | undefined;
84
84
  };
85
85
 
86
- export type AgentThoughtStreamingEventToolCalls = {
86
+ export type ToolCalls = {
87
87
  index?: number | undefined;
88
88
  id?: string | undefined;
89
89
  type?: AgentThoughtStreamingEventDataType | undefined;
@@ -104,7 +104,7 @@ export type AgentThoughtStreamingEventDataRole = ClosedEnum<
104
104
  /**
105
105
  * If the audio output modality is requested, this object contains data about the audio response from the model.
106
106
  */
107
- export type AgentThoughtStreamingEventAudio = {
107
+ export type Audio = {
108
108
  id: string;
109
109
  expiresAt: number;
110
110
  data: string;
@@ -117,7 +117,7 @@ export type AgentThoughtStreamingEventAudio = {
117
117
  export type AgentThoughtStreamingEventMessage = {
118
118
  content?: string | null | undefined;
119
119
  refusal?: string | null | undefined;
120
- toolCalls?: Array<AgentThoughtStreamingEventToolCalls> | undefined;
120
+ toolCalls?: Array<ToolCalls> | undefined;
121
121
  role?: AgentThoughtStreamingEventDataRole | undefined;
122
122
  /**
123
123
  * Internal thought process of the model
@@ -134,7 +134,7 @@ export type AgentThoughtStreamingEventMessage = {
134
134
  /**
135
135
  * If the audio output modality is requested, this object contains data about the audio response from the model.
136
136
  */
137
- audio?: AgentThoughtStreamingEventAudio | null | undefined;
137
+ audio?: Audio | null | undefined;
138
138
  };
139
139
 
140
140
  export type TopLogprobs = {
@@ -152,7 +152,7 @@ export type TopLogprobs = {
152
152
  bytes: Array<number> | null;
153
153
  };
154
154
 
155
- export type AgentThoughtStreamingEventContent = {
155
+ export type Content = {
156
156
  /**
157
157
  * The token.
158
158
  */
@@ -212,7 +212,7 @@ export type Logprobs = {
212
212
  /**
213
213
  * A list of message content tokens with log probability information.
214
214
  */
215
- content: Array<AgentThoughtStreamingEventContent> | null;
215
+ content: Array<Content> | null;
216
216
  /**
217
217
  * A list of message refusal tokens with log probability information.
218
218
  */
@@ -411,8 +411,8 @@ export function agentThoughtStreamingEventFunctionFromJSON(
411
411
  }
412
412
 
413
413
  /** @internal */
414
- export const AgentThoughtStreamingEventToolCalls$inboundSchema: z.ZodType<
415
- AgentThoughtStreamingEventToolCalls,
414
+ export const ToolCalls$inboundSchema: z.ZodType<
415
+ ToolCalls,
416
416
  z.ZodTypeDef,
417
417
  unknown
418
418
  > = z.object({
@@ -428,14 +428,13 @@ export const AgentThoughtStreamingEventToolCalls$inboundSchema: z.ZodType<
428
428
  });
429
429
  });
430
430
 
431
- export function agentThoughtStreamingEventToolCallsFromJSON(
431
+ export function toolCallsFromJSON(
432
432
  jsonString: string,
433
- ): SafeParseResult<AgentThoughtStreamingEventToolCalls, SDKValidationError> {
433
+ ): SafeParseResult<ToolCalls, SDKValidationError> {
434
434
  return safeParse(
435
435
  jsonString,
436
- (x) =>
437
- AgentThoughtStreamingEventToolCalls$inboundSchema.parse(JSON.parse(x)),
438
- `Failed to parse 'AgentThoughtStreamingEventToolCalls' from JSON`,
436
+ (x) => ToolCalls$inboundSchema.parse(JSON.parse(x)),
437
+ `Failed to parse 'ToolCalls' from JSON`,
439
438
  );
440
439
  }
441
440
 
@@ -445,28 +444,25 @@ export const AgentThoughtStreamingEventDataRole$inboundSchema: z.ZodNativeEnum<
445
444
  > = z.nativeEnum(AgentThoughtStreamingEventDataRole);
446
445
 
447
446
  /** @internal */
448
- export const AgentThoughtStreamingEventAudio$inboundSchema: z.ZodType<
449
- AgentThoughtStreamingEventAudio,
450
- z.ZodTypeDef,
451
- unknown
452
- > = z.object({
453
- id: z.string(),
454
- expires_at: z.number().int(),
455
- data: z.string(),
456
- transcript: z.string(),
457
- }).transform((v) => {
458
- return remap$(v, {
459
- "expires_at": "expiresAt",
447
+ export const Audio$inboundSchema: z.ZodType<Audio, z.ZodTypeDef, unknown> = z
448
+ .object({
449
+ id: z.string(),
450
+ expires_at: z.number().int(),
451
+ data: z.string(),
452
+ transcript: z.string(),
453
+ }).transform((v) => {
454
+ return remap$(v, {
455
+ "expires_at": "expiresAt",
456
+ });
460
457
  });
461
- });
462
458
 
463
- export function agentThoughtStreamingEventAudioFromJSON(
459
+ export function audioFromJSON(
464
460
  jsonString: string,
465
- ): SafeParseResult<AgentThoughtStreamingEventAudio, SDKValidationError> {
461
+ ): SafeParseResult<Audio, SDKValidationError> {
466
462
  return safeParse(
467
463
  jsonString,
468
- (x) => AgentThoughtStreamingEventAudio$inboundSchema.parse(JSON.parse(x)),
469
- `Failed to parse 'AgentThoughtStreamingEventAudio' from JSON`,
464
+ (x) => Audio$inboundSchema.parse(JSON.parse(x)),
465
+ `Failed to parse 'Audio' from JSON`,
470
466
  );
471
467
  }
472
468
 
@@ -478,15 +474,12 @@ export const AgentThoughtStreamingEventMessage$inboundSchema: z.ZodType<
478
474
  > = z.object({
479
475
  content: z.nullable(z.string()).optional(),
480
476
  refusal: z.nullable(z.string()).optional(),
481
- tool_calls: z.array(
482
- z.lazy(() => AgentThoughtStreamingEventToolCalls$inboundSchema),
483
- ).optional(),
477
+ tool_calls: z.array(z.lazy(() => ToolCalls$inboundSchema)).optional(),
484
478
  role: AgentThoughtStreamingEventDataRole$inboundSchema.optional(),
485
479
  reasoning: z.nullable(z.string()).optional(),
486
480
  reasoning_signature: z.nullable(z.string()).optional(),
487
481
  redacted_reasoning: z.string().optional(),
488
- audio: z.nullable(z.lazy(() => AgentThoughtStreamingEventAudio$inboundSchema))
489
- .optional(),
482
+ audio: z.nullable(z.lazy(() => Audio$inboundSchema)).optional(),
490
483
  }).transform((v) => {
491
484
  return remap$(v, {
492
485
  "tool_calls": "toolCalls",
@@ -527,28 +520,25 @@ export function topLogprobsFromJSON(
527
520
  }
528
521
 
529
522
  /** @internal */
530
- export const AgentThoughtStreamingEventContent$inboundSchema: z.ZodType<
531
- AgentThoughtStreamingEventContent,
532
- z.ZodTypeDef,
533
- unknown
534
- > = z.object({
535
- token: z.string(),
536
- logprob: z.number(),
537
- bytes: z.nullable(z.array(z.number())),
538
- top_logprobs: z.array(z.lazy(() => TopLogprobs$inboundSchema)),
539
- }).transform((v) => {
540
- return remap$(v, {
541
- "top_logprobs": "topLogprobs",
523
+ export const Content$inboundSchema: z.ZodType<Content, z.ZodTypeDef, unknown> =
524
+ z.object({
525
+ token: z.string(),
526
+ logprob: z.number(),
527
+ bytes: z.nullable(z.array(z.number())),
528
+ top_logprobs: z.array(z.lazy(() => TopLogprobs$inboundSchema)),
529
+ }).transform((v) => {
530
+ return remap$(v, {
531
+ "top_logprobs": "topLogprobs",
532
+ });
542
533
  });
543
- });
544
534
 
545
- export function agentThoughtStreamingEventContentFromJSON(
535
+ export function contentFromJSON(
546
536
  jsonString: string,
547
- ): SafeParseResult<AgentThoughtStreamingEventContent, SDKValidationError> {
537
+ ): SafeParseResult<Content, SDKValidationError> {
548
538
  return safeParse(
549
539
  jsonString,
550
- (x) => AgentThoughtStreamingEventContent$inboundSchema.parse(JSON.parse(x)),
551
- `Failed to parse 'AgentThoughtStreamingEventContent' from JSON`,
540
+ (x) => Content$inboundSchema.parse(JSON.parse(x)),
541
+ `Failed to parse 'Content' from JSON`,
552
542
  );
553
543
  }
554
544
 
@@ -605,9 +595,7 @@ export const Logprobs$inboundSchema: z.ZodType<
605
595
  z.ZodTypeDef,
606
596
  unknown
607
597
  > = z.object({
608
- content: z.nullable(
609
- z.array(z.lazy(() => AgentThoughtStreamingEventContent$inboundSchema)),
610
- ),
598
+ content: z.nullable(z.array(z.lazy(() => Content$inboundSchema))),
611
599
  refusal: z.nullable(z.array(z.lazy(() => Refusal$inboundSchema))),
612
600
  });
613
601
 
@@ -55,18 +55,9 @@ export type ApiKey = {
55
55
  * keys and the per-domain read / write semantics are exposed at
56
56
  * runtime via the `ListCapabilities` RPC.
57
57
  *
58
- * Valid keys (Domain.id) currently in the catalog:
59
- * Workspace-admin: "api-key", "member", "billing", "sso", "group",
60
- * "audit-log", "workspace"
61
- * Platform: "agent", "agent-schedule", "annotation",
62
- * "chunking", "dataset", "deployment", "eval",
63
- * "file", "guardrail-rule", "identity",
64
- * "knowledge", "memory-store", "policy",
65
- * "project", "prompt", "routing-rule", "skill",
66
- * "tool"
67
- * Gateway: "chat_completions", "embeddings", "responses",
68
- * "moderations", "images", "audio_speech",
69
- * "audio_transcription", "realtime", "model"
58
+ * Valid keys are the Domain.id values in the capability catalog
59
+ * see libs/catalog/orq/apikeys/v1/catalog.textpb for the canonical
60
+ * list. The ids are intentionally not duplicated here to avoid drift.
70
61
  *
71
62
  * Values are AccessLevel enum names on the JSON wire:
72
63
  * "ACCESS_LEVEL_NONE" — capability not granted