@orq-ai/node 4.7.3 → 4.7.6

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 (204) hide show
  1. package/README.md +1 -1
  2. package/funcs/filesCreate.js +3 -2
  3. package/funcs/filesCreate.js.map +1 -1
  4. package/funcs/filesGetContent.d.ts +1 -1
  5. package/funcs/filesGetContent.js +3 -3
  6. package/funcs/filesGetContent.js.map +1 -1
  7. package/funcs/routerAudioTranscriptionsCreate.js +3 -2
  8. package/funcs/routerAudioTranscriptionsCreate.js.map +1 -1
  9. package/funcs/routerAudioTranslationsCreate.js +3 -2
  10. package/funcs/routerAudioTranslationsCreate.js.map +1 -1
  11. package/jsr.json +1 -1
  12. package/lib/config.d.ts +3 -3
  13. package/lib/config.js +3 -3
  14. package/lib/config.js.map +1 -1
  15. package/lib/encodings.d.ts +1 -0
  16. package/lib/encodings.d.ts.map +1 -1
  17. package/lib/encodings.js +7 -0
  18. package/lib/encodings.js.map +1 -1
  19. package/models/components/reasoningpart.js +1 -1
  20. package/models/operations/createcontact.js +1 -1
  21. package/models/operations/createdataset.js +1 -1
  22. package/models/operations/createdatasetitem.js +4 -4
  23. package/models/operations/createdatasource.js +1 -1
  24. package/models/operations/createeval.js +16 -16
  25. package/models/operations/createidentity.js +1 -1
  26. package/models/operations/createtool.js +6 -6
  27. package/models/operations/filecontent.d.ts +3 -3
  28. package/models/operations/filecontent.d.ts.map +1 -1
  29. package/models/operations/filecontent.js +2 -2
  30. package/models/operations/filecontent.js.map +1 -1
  31. package/models/operations/getalltools.js +6 -6
  32. package/models/operations/getevals.js +16 -16
  33. package/models/operations/getv2humanevals.js +6 -6
  34. package/models/operations/getv2humanevalsets.js +2 -2
  35. package/models/operations/getv2humanevalsetsid.js +2 -2
  36. package/models/operations/getv2humanevalsid.js +6 -6
  37. package/models/operations/listdatasetdatapoints.js +4 -4
  38. package/models/operations/listdatasets.js +1 -1
  39. package/models/operations/listdatasources.js +1 -1
  40. package/models/operations/listidentities.js +1 -1
  41. package/models/operations/patchv2humanevalsetsid.js +2 -2
  42. package/models/operations/patchv2humanevalsid.js +12 -12
  43. package/models/operations/postv2feedbackevaluation.js +3 -3
  44. package/models/operations/postv2humanevals.js +12 -12
  45. package/models/operations/postv2humanevalsets.js +2 -2
  46. package/models/operations/retrievedatapoint.js +4 -4
  47. package/models/operations/retrievedataset.js +1 -1
  48. package/models/operations/retrievedatasource.js +1 -1
  49. package/models/operations/retrieveidentity.js +1 -1
  50. package/models/operations/retrievetool.js +6 -6
  51. package/models/operations/runagent.js +1 -1
  52. package/models/operations/streamrunagent.js +1 -1
  53. package/models/operations/updatedatapoint.js +4 -4
  54. package/models/operations/updatedataset.js +1 -1
  55. package/models/operations/updatedatasource.js +1 -1
  56. package/models/operations/updateeval.js +16 -16
  57. package/models/operations/updateidentity.js +1 -1
  58. package/models/operations/updatetool.js +7 -7
  59. package/package.json +1 -1
  60. package/packages/orq-rc/src/funcs/agentsCreate.ts +2 -2
  61. package/packages/orq-rc/src/funcs/filesCreate.ts +4 -3
  62. package/packages/orq-rc/src/funcs/guardrailRulesCreate.ts +161 -0
  63. package/packages/orq-rc/src/funcs/guardrailRulesDelete.ts +170 -0
  64. package/packages/orq-rc/src/funcs/guardrailRulesGet.ts +168 -0
  65. package/packages/orq-rc/src/funcs/guardrailRulesList.ts +170 -0
  66. package/packages/orq-rc/src/funcs/guardrailRulesUpdate.ts +170 -0
  67. package/packages/orq-rc/src/funcs/policiesCreate.ts +160 -0
  68. package/packages/orq-rc/src/funcs/policiesDelete.ts +166 -0
  69. package/packages/orq-rc/src/funcs/policiesGet.ts +165 -0
  70. package/packages/orq-rc/src/funcs/policiesList.ts +168 -0
  71. package/packages/orq-rc/src/funcs/policiesUpdate.ts +166 -0
  72. package/packages/orq-rc/src/funcs/routerAudioTranscriptionsCreate.ts +4 -3
  73. package/packages/orq-rc/src/funcs/routerAudioTranslationsCreate.ts +4 -3
  74. package/packages/orq-rc/src/funcs/routingRulesCreate.ts +161 -0
  75. package/packages/orq-rc/src/funcs/routingRulesDelete.ts +166 -0
  76. package/packages/orq-rc/src/funcs/routingRulesGet.ts +165 -0
  77. package/packages/orq-rc/src/funcs/routingRulesList.ts +168 -0
  78. package/packages/orq-rc/src/funcs/routingRulesUpdate.ts +166 -0
  79. package/packages/orq-rc/src/lib/config.ts +3 -3
  80. package/packages/orq-rc/src/lib/encodings.ts +9 -0
  81. package/packages/orq-rc/src/models/components/agentstartedstreamingevent.ts +9 -6
  82. package/packages/orq-rc/src/models/components/budgetlimit.ts +83 -0
  83. package/packages/orq-rc/src/models/components/evaluatorref.ts +89 -0
  84. package/packages/orq-rc/src/models/components/expression.ts +51 -0
  85. package/packages/orq-rc/src/models/components/guardrailref.ts +75 -0
  86. package/packages/orq-rc/src/models/components/guardrailruledocument.ts +66 -0
  87. package/packages/orq-rc/src/models/components/index.ts +13 -0
  88. package/packages/orq-rc/src/models/components/limits.ts +70 -0
  89. package/packages/orq-rc/src/models/components/modelref.ts +64 -0
  90. package/packages/orq-rc/src/models/components/modelsconfig.ts +73 -0
  91. package/packages/orq-rc/src/models/components/policydocument.ts +76 -0
  92. package/packages/orq-rc/src/models/components/reasoningpart.ts +1 -1
  93. package/packages/orq-rc/src/models/components/requestlimit.ts +69 -0
  94. package/packages/orq-rc/src/models/components/retryconfig.ts +60 -0
  95. package/packages/orq-rc/src/models/components/routingruledocument.ts +67 -0
  96. package/packages/orq-rc/src/models/components/tokenlimit.ts +69 -0
  97. package/packages/orq-rc/src/models/operations/createagentrequest.ts +0 -3
  98. package/packages/orq-rc/src/models/operations/createcontact.ts +1 -1
  99. package/packages/orq-rc/src/models/operations/createdataset.ts +1 -1
  100. package/packages/orq-rc/src/models/operations/createdatasetitem.ts +4 -4
  101. package/packages/orq-rc/src/models/operations/createdatasource.ts +1 -1
  102. package/packages/orq-rc/src/models/operations/createeval.ts +958 -132
  103. package/packages/orq-rc/src/models/operations/createidentity.ts +1 -1
  104. package/packages/orq-rc/src/models/operations/createtool.ts +6 -21
  105. package/packages/orq-rc/src/models/operations/getalltools.ts +6 -21
  106. package/packages/orq-rc/src/models/operations/getevals.ts +447 -16
  107. package/packages/orq-rc/src/models/operations/getv2humanevals.ts +6 -6
  108. package/packages/orq-rc/src/models/operations/getv2humanevalsets.ts +2 -2
  109. package/packages/orq-rc/src/models/operations/getv2humanevalsetsid.ts +2 -2
  110. package/packages/orq-rc/src/models/operations/getv2humanevalsid.ts +6 -6
  111. package/packages/orq-rc/src/models/operations/guardrailrulecreate.ts +124 -0
  112. package/packages/orq-rc/src/models/operations/guardrailruledelete.ts +39 -0
  113. package/packages/orq-rc/src/models/operations/guardrailruleget.ts +102 -0
  114. package/packages/orq-rc/src/models/operations/guardrailrulelist.ts +94 -0
  115. package/packages/orq-rc/src/models/operations/guardrailruleupdate.ts +153 -0
  116. package/packages/orq-rc/src/models/operations/index.ts +15 -0
  117. package/packages/orq-rc/src/models/operations/listagents.ts +0 -3
  118. package/packages/orq-rc/src/models/operations/listdatasetdatapoints.ts +4 -4
  119. package/packages/orq-rc/src/models/operations/listdatasets.ts +1 -1
  120. package/packages/orq-rc/src/models/operations/listdatasources.ts +1 -1
  121. package/packages/orq-rc/src/models/operations/listidentities.ts +1 -1
  122. package/packages/orq-rc/src/models/operations/patchv2humanevalsetsid.ts +2 -2
  123. package/packages/orq-rc/src/models/operations/patchv2humanevalsid.ts +12 -12
  124. package/packages/orq-rc/src/models/operations/policycreate.ts +138 -0
  125. package/packages/orq-rc/src/models/operations/policydelete.ts +39 -0
  126. package/packages/orq-rc/src/models/operations/policyget.ts +110 -0
  127. package/packages/orq-rc/src/models/operations/policylist.ts +94 -0
  128. package/packages/orq-rc/src/models/operations/policyupdate.ts +167 -0
  129. package/packages/orq-rc/src/models/operations/postv2agentsa2a.ts +0 -3
  130. package/packages/orq-rc/src/models/operations/postv2feedbackevaluation.ts +3 -3
  131. package/packages/orq-rc/src/models/operations/postv2humanevals.ts +12 -12
  132. package/packages/orq-rc/src/models/operations/postv2humanevalsets.ts +2 -2
  133. package/packages/orq-rc/src/models/operations/retrieveagentrequest.ts +0 -3
  134. package/packages/orq-rc/src/models/operations/retrievedatapoint.ts +4 -4
  135. package/packages/orq-rc/src/models/operations/retrievedataset.ts +1 -1
  136. package/packages/orq-rc/src/models/operations/retrievedatasource.ts +1 -1
  137. package/packages/orq-rc/src/models/operations/retrieveidentity.ts +1 -1
  138. package/packages/orq-rc/src/models/operations/retrievetool.ts +6 -21
  139. package/packages/orq-rc/src/models/operations/routingrulecreate.ts +124 -0
  140. package/packages/orq-rc/src/models/operations/routingruledelete.ts +39 -0
  141. package/packages/orq-rc/src/models/operations/routingruleget.ts +102 -0
  142. package/packages/orq-rc/src/models/operations/routingrulelist.ts +94 -0
  143. package/packages/orq-rc/src/models/operations/routingruleupdate.ts +154 -0
  144. package/packages/orq-rc/src/models/operations/runagent.ts +1 -1
  145. package/packages/orq-rc/src/models/operations/streamrunagent.ts +1 -1
  146. package/packages/orq-rc/src/models/operations/updateagent.ts +0 -3
  147. package/packages/orq-rc/src/models/operations/updatedatapoint.ts +4 -4
  148. package/packages/orq-rc/src/models/operations/updatedataset.ts +1 -1
  149. package/packages/orq-rc/src/models/operations/updatedatasource.ts +1 -1
  150. package/packages/orq-rc/src/models/operations/updateeval.ts +646 -16
  151. package/packages/orq-rc/src/models/operations/updateidentity.ts +1 -1
  152. package/packages/orq-rc/src/models/operations/updatetool.ts +7 -22
  153. package/packages/orq-rc/src/sdk/guardrailrules.ts +99 -0
  154. package/packages/orq-rc/src/sdk/policies.ts +99 -0
  155. package/packages/orq-rc/src/sdk/routingrules.ts +99 -0
  156. package/packages/orq-rc/src/sdk/sdk.ts +18 -0
  157. package/sdk/files.d.ts +7 -7
  158. package/sdk/files.d.ts.map +1 -1
  159. package/sdk/files.js +9 -9
  160. package/sdk/files.js.map +1 -1
  161. package/src/funcs/filesCreate.ts +4 -3
  162. package/src/funcs/filesGetContent.ts +3 -3
  163. package/src/funcs/routerAudioTranscriptionsCreate.ts +4 -3
  164. package/src/funcs/routerAudioTranslationsCreate.ts +4 -3
  165. package/src/lib/config.ts +3 -3
  166. package/src/lib/encodings.ts +9 -0
  167. package/src/models/components/reasoningpart.ts +1 -1
  168. package/src/models/operations/createcontact.ts +1 -1
  169. package/src/models/operations/createdataset.ts +1 -1
  170. package/src/models/operations/createdatasetitem.ts +4 -4
  171. package/src/models/operations/createdatasource.ts +1 -1
  172. package/src/models/operations/createeval.ts +16 -16
  173. package/src/models/operations/createidentity.ts +1 -1
  174. package/src/models/operations/createtool.ts +6 -6
  175. package/src/models/operations/filecontent.ts +5 -5
  176. package/src/models/operations/getalltools.ts +6 -6
  177. package/src/models/operations/getevals.ts +16 -16
  178. package/src/models/operations/getv2humanevals.ts +6 -6
  179. package/src/models/operations/getv2humanevalsets.ts +2 -2
  180. package/src/models/operations/getv2humanevalsetsid.ts +2 -2
  181. package/src/models/operations/getv2humanevalsid.ts +6 -6
  182. package/src/models/operations/listdatasetdatapoints.ts +4 -4
  183. package/src/models/operations/listdatasets.ts +1 -1
  184. package/src/models/operations/listdatasources.ts +1 -1
  185. package/src/models/operations/listidentities.ts +1 -1
  186. package/src/models/operations/patchv2humanevalsetsid.ts +2 -2
  187. package/src/models/operations/patchv2humanevalsid.ts +12 -12
  188. package/src/models/operations/postv2feedbackevaluation.ts +3 -3
  189. package/src/models/operations/postv2humanevals.ts +12 -12
  190. package/src/models/operations/postv2humanevalsets.ts +2 -2
  191. package/src/models/operations/retrievedatapoint.ts +4 -4
  192. package/src/models/operations/retrievedataset.ts +1 -1
  193. package/src/models/operations/retrievedatasource.ts +1 -1
  194. package/src/models/operations/retrieveidentity.ts +1 -1
  195. package/src/models/operations/retrievetool.ts +6 -6
  196. package/src/models/operations/runagent.ts +1 -1
  197. package/src/models/operations/streamrunagent.ts +1 -1
  198. package/src/models/operations/updatedatapoint.ts +4 -4
  199. package/src/models/operations/updatedataset.ts +1 -1
  200. package/src/models/operations/updatedatasource.ts +1 -1
  201. package/src/models/operations/updateeval.ts +16 -16
  202. package/src/models/operations/updateidentity.ts +1 -1
  203. package/src/models/operations/updatetool.ts +7 -7
  204. package/src/sdk/files.ts +17 -17
@@ -0,0 +1,168 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { OrqCore } from "../core.js";
6
+ import { encodeFormQuery } from "../lib/encodings.js";
7
+ import * as M from "../lib/matchers.js";
8
+ import { compactMap } from "../lib/primitives.js";
9
+ import { safeParse } from "../lib/schemas.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 * as operations from "../models/operations/index.js";
24
+ import { APICall, APIPromise } from "../types/async.js";
25
+ import { Result } from "../types/fp.js";
26
+
27
+ /**
28
+ * List routing rules
29
+ *
30
+ * @remarks
31
+ * Returns a paginated list of routing rules for the current project, ordered by priority ascending.
32
+ */
33
+ export function routingRulesList(
34
+ client: OrqCore,
35
+ request?: operations.RoutingRuleListRequest | undefined,
36
+ options?: RequestOptions,
37
+ ): APIPromise<
38
+ Result<
39
+ operations.RoutingRuleListResponseBody,
40
+ | OrqError
41
+ | ResponseValidationError
42
+ | ConnectionError
43
+ | RequestAbortedError
44
+ | RequestTimeoutError
45
+ | InvalidRequestError
46
+ | UnexpectedClientError
47
+ | SDKValidationError
48
+ >
49
+ > {
50
+ return new APIPromise($do(
51
+ client,
52
+ request,
53
+ options,
54
+ ));
55
+ }
56
+
57
+ async function $do(
58
+ client: OrqCore,
59
+ request?: operations.RoutingRuleListRequest | undefined,
60
+ options?: RequestOptions,
61
+ ): Promise<
62
+ [
63
+ Result<
64
+ operations.RoutingRuleListResponseBody,
65
+ | OrqError
66
+ | ResponseValidationError
67
+ | ConnectionError
68
+ | RequestAbortedError
69
+ | RequestTimeoutError
70
+ | InvalidRequestError
71
+ | UnexpectedClientError
72
+ | SDKValidationError
73
+ >,
74
+ APICall,
75
+ ]
76
+ > {
77
+ const parsed = safeParse(
78
+ request,
79
+ (value) =>
80
+ operations.RoutingRuleListRequest$outboundSchema.optional().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 = null;
88
+
89
+ const path = pathToFunc("/v2/routing-rules")();
90
+
91
+ const query = encodeFormQuery({
92
+ "ending_before": payload?.ending_before,
93
+ "limit": payload?.limit,
94
+ "project_id": payload?.project_id,
95
+ "starting_after": payload?.starting_after,
96
+ }, { explode: false });
97
+
98
+ const headers = new Headers(compactMap({
99
+ Accept: "application/json",
100
+ }));
101
+
102
+ const secConfig = await extractSecurity(client._options.apiKey);
103
+ const securityInput = secConfig == null ? {} : { apiKey: secConfig };
104
+ const requestSecurity = resolveGlobalSecurity(securityInput);
105
+
106
+ const context = {
107
+ options: client._options,
108
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
109
+ operationID: "RoutingRuleList",
110
+ oAuth2Scopes: null,
111
+
112
+ resolvedSecurity: requestSecurity,
113
+
114
+ securitySource: client._options.apiKey,
115
+ retryConfig: options?.retries
116
+ || client._options.retryConfig
117
+ || { strategy: "none" },
118
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
119
+ };
120
+
121
+ const requestRes = client._createRequest(context, {
122
+ security: requestSecurity,
123
+ method: "GET",
124
+ baseURL: options?.serverURL,
125
+ path: path,
126
+ headers: headers,
127
+ query: query,
128
+ body: body,
129
+ userAgent: client._options.userAgent,
130
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
131
+ }, options);
132
+ if (!requestRes.ok) {
133
+ return [requestRes, { status: "invalid" }];
134
+ }
135
+ const req = requestRes.value;
136
+
137
+ const doResult = await client._do(req, {
138
+ context,
139
+ errorCodes: ["4XX", "5XX"],
140
+ retryConfig: context.retryConfig,
141
+ retryCodes: context.retryCodes,
142
+ });
143
+ if (!doResult.ok) {
144
+ return [doResult, { status: "request-error", request: req }];
145
+ }
146
+ const response = doResult.value;
147
+
148
+ const [result] = await M.match<
149
+ operations.RoutingRuleListResponseBody,
150
+ | OrqError
151
+ | ResponseValidationError
152
+ | ConnectionError
153
+ | RequestAbortedError
154
+ | RequestTimeoutError
155
+ | InvalidRequestError
156
+ | UnexpectedClientError
157
+ | SDKValidationError
158
+ >(
159
+ M.json(200, operations.RoutingRuleListResponseBody$inboundSchema),
160
+ M.fail("4XX"),
161
+ M.fail("5XX"),
162
+ )(response, req);
163
+ if (!result.ok) {
164
+ return [result, { status: "complete", request: req, response }];
165
+ }
166
+
167
+ return [result, { status: "complete", request: req, response }];
168
+ }
@@ -0,0 +1,166 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { OrqCore } from "../core.js";
6
+ import { encodeJSON, encodeSimple } from "../lib/encodings.js";
7
+ import * as M from "../lib/matchers.js";
8
+ import { compactMap } from "../lib/primitives.js";
9
+ import { safeParse } from "../lib/schemas.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 * as operations from "../models/operations/index.js";
24
+ import { APICall, APIPromise } from "../types/async.js";
25
+ import { Result } from "../types/fp.js";
26
+
27
+ /**
28
+ * Update routing rule
29
+ *
30
+ * @remarks
31
+ * Partially updates an existing routing rule. Only provided fields are updated.
32
+ */
33
+ export function routingRulesUpdate(
34
+ client: OrqCore,
35
+ request: operations.RoutingRuleUpdateRequest,
36
+ options?: RequestOptions,
37
+ ): APIPromise<
38
+ Result<
39
+ operations.RoutingRuleUpdateResponseBody,
40
+ | OrqError
41
+ | ResponseValidationError
42
+ | ConnectionError
43
+ | RequestAbortedError
44
+ | RequestTimeoutError
45
+ | InvalidRequestError
46
+ | UnexpectedClientError
47
+ | SDKValidationError
48
+ >
49
+ > {
50
+ return new APIPromise($do(
51
+ client,
52
+ request,
53
+ options,
54
+ ));
55
+ }
56
+
57
+ async function $do(
58
+ client: OrqCore,
59
+ request: operations.RoutingRuleUpdateRequest,
60
+ options?: RequestOptions,
61
+ ): Promise<
62
+ [
63
+ Result<
64
+ operations.RoutingRuleUpdateResponseBody,
65
+ | OrqError
66
+ | ResponseValidationError
67
+ | ConnectionError
68
+ | RequestAbortedError
69
+ | RequestTimeoutError
70
+ | InvalidRequestError
71
+ | UnexpectedClientError
72
+ | SDKValidationError
73
+ >,
74
+ APICall,
75
+ ]
76
+ > {
77
+ const parsed = safeParse(
78
+ request,
79
+ (value) => operations.RoutingRuleUpdateRequest$outboundSchema.parse(value),
80
+ "Input validation failed",
81
+ );
82
+ if (!parsed.ok) {
83
+ return [parsed, { status: "invalid" }];
84
+ }
85
+ const payload = parsed.value;
86
+ const body = encodeJSON("body", payload.RequestBody, { explode: true });
87
+
88
+ const pathParams = {
89
+ routing_rule_id: encodeSimple("routing_rule_id", payload.routing_rule_id, {
90
+ explode: false,
91
+ charEncoding: "percent",
92
+ }),
93
+ };
94
+ const path = pathToFunc("/v2/routing-rules/{routing_rule_id}")(pathParams);
95
+
96
+ const headers = new Headers(compactMap({
97
+ "Content-Type": "application/json",
98
+ Accept: "application/json",
99
+ }));
100
+
101
+ const secConfig = await extractSecurity(client._options.apiKey);
102
+ const securityInput = secConfig == null ? {} : { apiKey: secConfig };
103
+ const requestSecurity = resolveGlobalSecurity(securityInput);
104
+
105
+ const context = {
106
+ options: client._options,
107
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
108
+ operationID: "RoutingRuleUpdate",
109
+ oAuth2Scopes: null,
110
+
111
+ resolvedSecurity: requestSecurity,
112
+
113
+ securitySource: client._options.apiKey,
114
+ retryConfig: options?.retries
115
+ || client._options.retryConfig
116
+ || { strategy: "none" },
117
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
118
+ };
119
+
120
+ const requestRes = client._createRequest(context, {
121
+ security: requestSecurity,
122
+ method: "PATCH",
123
+ baseURL: options?.serverURL,
124
+ path: path,
125
+ headers: headers,
126
+ body: body,
127
+ userAgent: client._options.userAgent,
128
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
129
+ }, options);
130
+ if (!requestRes.ok) {
131
+ return [requestRes, { status: "invalid" }];
132
+ }
133
+ const req = requestRes.value;
134
+
135
+ const doResult = await client._do(req, {
136
+ context,
137
+ errorCodes: ["400", "404", "4XX", "5XX"],
138
+ retryConfig: context.retryConfig,
139
+ retryCodes: context.retryCodes,
140
+ });
141
+ if (!doResult.ok) {
142
+ return [doResult, { status: "request-error", request: req }];
143
+ }
144
+ const response = doResult.value;
145
+
146
+ const [result] = await M.match<
147
+ operations.RoutingRuleUpdateResponseBody,
148
+ | OrqError
149
+ | ResponseValidationError
150
+ | ConnectionError
151
+ | RequestAbortedError
152
+ | RequestTimeoutError
153
+ | InvalidRequestError
154
+ | UnexpectedClientError
155
+ | SDKValidationError
156
+ >(
157
+ M.json(200, operations.RoutingRuleUpdateResponseBody$inboundSchema),
158
+ M.fail([400, 404, "4XX"]),
159
+ M.fail("5XX"),
160
+ )(response, req);
161
+ if (!result.ok) {
162
+ return [result, { status: "complete", request: req, response }];
163
+ }
164
+
165
+ return [result, { status: "complete", request: req, response }];
166
+ }
@@ -68,7 +68,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
68
68
  export const SDK_METADATA = {
69
69
  language: "typescript",
70
70
  openapiDocVersion: "2.0",
71
- sdkVersion: "4.8.0-rc.1",
72
- genVersion: "2.879.6",
73
- userAgent: "speakeasy-sdk/typescript 4.8.0-rc.1 2.879.6 2.0 @orq-ai/node",
71
+ sdkVersion: "4.8.0-rc.13",
72
+ genVersion: "2.879.13",
73
+ userAgent: "speakeasy-sdk/typescript 4.8.0-rc.13 2.879.13 2.0 @orq-ai/node",
74
74
  } as const;
@@ -514,3 +514,12 @@ export function appendForm(
514
514
  fd.append(key, String(value));
515
515
  }
516
516
  }
517
+
518
+ export async function normalizeBlob(
519
+ value: Pick<Blob, "arrayBuffer" | "type">,
520
+ ): Promise<Blob> {
521
+ if (value instanceof Blob) {
522
+ return value;
523
+ }
524
+ return new Blob([await value.arrayBuffer()], { type: value.type });
525
+ }
@@ -112,14 +112,16 @@ export type Tools = {
112
112
  /**
113
113
  * Determines whether the evaluator runs on the agent input (user message) or output (agent response).
114
114
  */
115
- export const ExecuteOn = {
115
+ export const AgentStartedStreamingEventDataExecuteOn = {
116
116
  Input: "input",
117
117
  Output: "output",
118
118
  } as const;
119
119
  /**
120
120
  * Determines whether the evaluator runs on the agent input (user message) or output (agent response).
121
121
  */
122
- export type ExecuteOn = ClosedEnum<typeof ExecuteOn>;
122
+ export type AgentStartedStreamingEventDataExecuteOn = ClosedEnum<
123
+ typeof AgentStartedStreamingEventDataExecuteOn
124
+ >;
123
125
 
124
126
  export type Evaluators = {
125
127
  /**
@@ -133,7 +135,7 @@ export type Evaluators = {
133
135
  /**
134
136
  * Determines whether the evaluator runs on the agent input (user message) or output (agent response).
135
137
  */
136
- executeOn: ExecuteOn;
138
+ executeOn: AgentStartedStreamingEventDataExecuteOn;
137
139
  };
138
140
 
139
141
  /**
@@ -352,8 +354,9 @@ export function toolsFromJSON(
352
354
  }
353
355
 
354
356
  /** @internal */
355
- export const ExecuteOn$inboundSchema: z.ZodNativeEnum<typeof ExecuteOn> = z
356
- .nativeEnum(ExecuteOn);
357
+ export const AgentStartedStreamingEventDataExecuteOn$inboundSchema:
358
+ z.ZodNativeEnum<typeof AgentStartedStreamingEventDataExecuteOn> = z
359
+ .nativeEnum(AgentStartedStreamingEventDataExecuteOn);
357
360
 
358
361
  /** @internal */
359
362
  export const Evaluators$inboundSchema: z.ZodType<
@@ -363,7 +366,7 @@ export const Evaluators$inboundSchema: z.ZodType<
363
366
  > = z.object({
364
367
  id: z.string(),
365
368
  sample_rate: z.number().default(50),
366
- execute_on: ExecuteOn$inboundSchema,
369
+ execute_on: AgentStartedStreamingEventDataExecuteOn$inboundSchema,
367
370
  }).transform((v) => {
368
371
  return remap$(v, {
369
372
  "sample_rate": "sampleRate",
@@ -0,0 +1,83 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { safeParse } from "../../lib/schemas.js";
7
+ import { ClosedEnum } from "../../types/enums.js";
8
+ import { Result as SafeParseResult } from "../../types/fp.js";
9
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
+
11
+ export const Currency = {
12
+ Usd: "usd",
13
+ } as const;
14
+ export type Currency = ClosedEnum<typeof Currency>;
15
+
16
+ export const Period = {
17
+ Hour: "hour",
18
+ Day: "day",
19
+ Week: "week",
20
+ Month: "month",
21
+ } as const;
22
+ export type Period = ClosedEnum<typeof Period>;
23
+
24
+ export type BudgetLimit = {
25
+ amount: number;
26
+ currency: Currency;
27
+ period: Period;
28
+ };
29
+
30
+ /** @internal */
31
+ export const Currency$inboundSchema: z.ZodNativeEnum<typeof Currency> = z
32
+ .nativeEnum(Currency);
33
+ /** @internal */
34
+ export const Currency$outboundSchema: z.ZodNativeEnum<typeof Currency> =
35
+ Currency$inboundSchema;
36
+
37
+ /** @internal */
38
+ export const Period$inboundSchema: z.ZodNativeEnum<typeof Period> = z
39
+ .nativeEnum(Period);
40
+ /** @internal */
41
+ export const Period$outboundSchema: z.ZodNativeEnum<typeof Period> =
42
+ Period$inboundSchema;
43
+
44
+ /** @internal */
45
+ export const BudgetLimit$inboundSchema: z.ZodType<
46
+ BudgetLimit,
47
+ z.ZodTypeDef,
48
+ unknown
49
+ > = z.object({
50
+ amount: z.number(),
51
+ currency: Currency$inboundSchema,
52
+ period: Period$inboundSchema,
53
+ });
54
+ /** @internal */
55
+ export type BudgetLimit$Outbound = {
56
+ amount: number;
57
+ currency: string;
58
+ period: string;
59
+ };
60
+
61
+ /** @internal */
62
+ export const BudgetLimit$outboundSchema: z.ZodType<
63
+ BudgetLimit$Outbound,
64
+ z.ZodTypeDef,
65
+ BudgetLimit
66
+ > = z.object({
67
+ amount: z.number(),
68
+ currency: Currency$outboundSchema,
69
+ period: Period$outboundSchema,
70
+ });
71
+
72
+ export function budgetLimitToJSON(budgetLimit: BudgetLimit): string {
73
+ return JSON.stringify(BudgetLimit$outboundSchema.parse(budgetLimit));
74
+ }
75
+ export function budgetLimitFromJSON(
76
+ jsonString: string,
77
+ ): SafeParseResult<BudgetLimit, SDKValidationError> {
78
+ return safeParse(
79
+ jsonString,
80
+ (x) => BudgetLimit$inboundSchema.parse(JSON.parse(x)),
81
+ `Failed to parse 'BudgetLimit' from JSON`,
82
+ );
83
+ }
@@ -0,0 +1,89 @@
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 { ClosedEnum } from "../../types/enums.js";
9
+ import { Result as SafeParseResult } from "../../types/fp.js";
10
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
+
12
+ export const EvaluatorRefExecuteOn = {
13
+ Input: "input",
14
+ Output: "output",
15
+ Both: "both",
16
+ } as const;
17
+ export type EvaluatorRefExecuteOn = ClosedEnum<typeof EvaluatorRefExecuteOn>;
18
+
19
+ export type EvaluatorRef = {
20
+ executeOn: EvaluatorRefExecuteOn;
21
+ id: string;
22
+ isGuardrail?: boolean | undefined;
23
+ sampleRate?: number | undefined;
24
+ };
25
+
26
+ /** @internal */
27
+ export const EvaluatorRefExecuteOn$inboundSchema: z.ZodNativeEnum<
28
+ typeof EvaluatorRefExecuteOn
29
+ > = z.nativeEnum(EvaluatorRefExecuteOn);
30
+ /** @internal */
31
+ export const EvaluatorRefExecuteOn$outboundSchema: z.ZodNativeEnum<
32
+ typeof EvaluatorRefExecuteOn
33
+ > = EvaluatorRefExecuteOn$inboundSchema;
34
+
35
+ /** @internal */
36
+ export const EvaluatorRef$inboundSchema: z.ZodType<
37
+ EvaluatorRef,
38
+ z.ZodTypeDef,
39
+ unknown
40
+ > = z.object({
41
+ execute_on: EvaluatorRefExecuteOn$inboundSchema,
42
+ id: z.string(),
43
+ is_guardrail: z.boolean().optional(),
44
+ sample_rate: z.number().optional(),
45
+ }).transform((v) => {
46
+ return remap$(v, {
47
+ "execute_on": "executeOn",
48
+ "is_guardrail": "isGuardrail",
49
+ "sample_rate": "sampleRate",
50
+ });
51
+ });
52
+ /** @internal */
53
+ export type EvaluatorRef$Outbound = {
54
+ execute_on: string;
55
+ id: string;
56
+ is_guardrail?: boolean | undefined;
57
+ sample_rate?: number | undefined;
58
+ };
59
+
60
+ /** @internal */
61
+ export const EvaluatorRef$outboundSchema: z.ZodType<
62
+ EvaluatorRef$Outbound,
63
+ z.ZodTypeDef,
64
+ EvaluatorRef
65
+ > = z.object({
66
+ executeOn: EvaluatorRefExecuteOn$outboundSchema,
67
+ id: z.string(),
68
+ isGuardrail: z.boolean().optional(),
69
+ sampleRate: z.number().optional(),
70
+ }).transform((v) => {
71
+ return remap$(v, {
72
+ executeOn: "execute_on",
73
+ isGuardrail: "is_guardrail",
74
+ sampleRate: "sample_rate",
75
+ });
76
+ });
77
+
78
+ export function evaluatorRefToJSON(evaluatorRef: EvaluatorRef): string {
79
+ return JSON.stringify(EvaluatorRef$outboundSchema.parse(evaluatorRef));
80
+ }
81
+ export function evaluatorRefFromJSON(
82
+ jsonString: string,
83
+ ): SafeParseResult<EvaluatorRef, SDKValidationError> {
84
+ return safeParse(
85
+ jsonString,
86
+ (x) => EvaluatorRef$inboundSchema.parse(JSON.parse(x)),
87
+ `Failed to parse 'EvaluatorRef' from JSON`,
88
+ );
89
+ }
@@ -0,0 +1,51 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { safeParse } from "../../lib/schemas.js";
7
+ import { Result as SafeParseResult } from "../../types/fp.js";
8
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
+
10
+ export type Expression = {
11
+ cel: string;
12
+ config?: { [k: string]: any } | undefined;
13
+ };
14
+
15
+ /** @internal */
16
+ export const Expression$inboundSchema: z.ZodType<
17
+ Expression,
18
+ z.ZodTypeDef,
19
+ unknown
20
+ > = z.object({
21
+ cel: z.string(),
22
+ config: z.record(z.any()).optional(),
23
+ });
24
+ /** @internal */
25
+ export type Expression$Outbound = {
26
+ cel: string;
27
+ config?: { [k: string]: any } | undefined;
28
+ };
29
+
30
+ /** @internal */
31
+ export const Expression$outboundSchema: z.ZodType<
32
+ Expression$Outbound,
33
+ z.ZodTypeDef,
34
+ Expression
35
+ > = z.object({
36
+ cel: z.string(),
37
+ config: z.record(z.any()).optional(),
38
+ });
39
+
40
+ export function expressionToJSON(expression: Expression): string {
41
+ return JSON.stringify(Expression$outboundSchema.parse(expression));
42
+ }
43
+ export function expressionFromJSON(
44
+ jsonString: string,
45
+ ): SafeParseResult<Expression, SDKValidationError> {
46
+ return safeParse(
47
+ jsonString,
48
+ (x) => Expression$inboundSchema.parse(JSON.parse(x)),
49
+ `Failed to parse 'Expression' from JSON`,
50
+ );
51
+ }