@orq-ai/node 4.16.0-rc.57 → 4.16.0-rc.58

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 (138) hide show
  1. package/README.md +68 -52
  2. package/funcs/routerClassifyCreate.d.ts +2 -2
  3. package/funcs/routerClassifyCreate.d.ts.map +1 -1
  4. package/funcs/routerClassifyCreate.js +2 -2
  5. package/funcs/routerClassifyCreate.js.map +1 -1
  6. package/funcs/routerDecisionsCreate.d.ts +18 -0
  7. package/funcs/routerDecisionsCreate.d.ts.map +1 -0
  8. package/funcs/routerDecisionsCreate.js +123 -0
  9. package/funcs/routerDecisionsCreate.js.map +1 -0
  10. package/jsr.json +1 -1
  11. package/lib/config.d.ts +2 -2
  12. package/lib/config.js +2 -2
  13. package/models/components/classifyanswer.d.ts +6 -47
  14. package/models/components/classifyanswer.d.ts.map +1 -1
  15. package/models/components/classifyanswer.js +11 -20
  16. package/models/components/classifyanswer.js.map +1 -1
  17. package/models/components/classifychoiceanswer.d.ts +24 -0
  18. package/models/components/classifychoiceanswer.d.ts.map +1 -0
  19. package/models/components/classifychoiceanswer.js +53 -0
  20. package/models/components/classifychoiceanswer.js.map +1 -0
  21. package/models/components/classifyinputtokensdetails.d.ts +17 -0
  22. package/models/components/classifyinputtokensdetails.d.ts.map +1 -0
  23. package/models/components/classifyinputtokensdetails.js +57 -0
  24. package/models/components/classifyinputtokensdetails.js.map +1 -0
  25. package/models/components/classifynoulanswer.d.ts +14 -0
  26. package/models/components/classifynoulanswer.d.ts.map +1 -0
  27. package/models/components/classifynoulanswer.js +51 -0
  28. package/models/components/classifynoulanswer.js.map +1 -0
  29. package/models/components/classifyrefusalanswer.d.ts +10 -0
  30. package/models/components/classifyrefusalanswer.d.ts.map +1 -0
  31. package/models/components/classifyrefusalanswer.js +50 -0
  32. package/models/components/classifyrefusalanswer.js.map +1 -0
  33. package/models/components/classifyretryconfig.d.ts +4 -4
  34. package/models/components/classifyretryconfig.d.ts.map +1 -1
  35. package/models/components/classifyretryconfig.js +1 -1
  36. package/models/components/classifyretryconfig.js.map +1 -1
  37. package/models/components/classifyscoreanswer.d.ts +30 -0
  38. package/models/components/classifyscoreanswer.d.ts.map +1 -0
  39. package/models/components/classifyscoreanswer.js +54 -0
  40. package/models/components/classifyscoreanswer.js.map +1 -0
  41. package/models/components/classifyusage.d.ts +4 -2
  42. package/models/components/classifyusage.d.ts.map +1 -1
  43. package/models/components/classifyusage.js +3 -0
  44. package/models/components/classifyusage.js.map +1 -1
  45. package/models/components/index.d.ts +5 -0
  46. package/models/components/index.d.ts.map +1 -1
  47. package/models/components/index.js +5 -0
  48. package/models/components/index.js.map +1 -1
  49. package/models/components/model.d.ts +4 -0
  50. package/models/components/model.d.ts.map +1 -1
  51. package/models/components/model.js +1 -0
  52. package/models/components/model.js.map +1 -1
  53. package/models/components/modelmetadata.d.ts +2 -0
  54. package/models/components/modelmetadata.d.ts.map +1 -1
  55. package/models/components/modelmetadata.js +4 -0
  56. package/models/components/modelmetadata.js.map +1 -1
  57. package/models/components/reasoningpart.js +1 -1
  58. package/models/errors/createclassify.d.ts +90 -6
  59. package/models/errors/createclassify.d.ts.map +1 -1
  60. package/models/errors/createclassify.js +116 -4
  61. package/models/errors/createclassify.js.map +1 -1
  62. package/models/errors/createdecisions.d.ts +151 -0
  63. package/models/errors/createdecisions.d.ts.map +1 -0
  64. package/models/errors/createdecisions.js +239 -0
  65. package/models/errors/createdecisions.js.map +1 -0
  66. package/models/errors/index.d.ts +1 -0
  67. package/models/errors/index.d.ts.map +1 -1
  68. package/models/errors/index.js +1 -0
  69. package/models/errors/index.js.map +1 -1
  70. package/models/operations/createclassify.d.ts +9 -4
  71. package/models/operations/createclassify.d.ts.map +1 -1
  72. package/models/operations/createclassify.js +2 -0
  73. package/models/operations/createclassify.js.map +1 -1
  74. package/models/operations/createdecisions.d.ts +237 -0
  75. package/models/operations/createdecisions.d.ts.map +1 -0
  76. package/models/operations/createdecisions.js +148 -0
  77. package/models/operations/createdecisions.js.map +1 -0
  78. package/models/operations/createtool.js +4 -4
  79. package/models/operations/getalltools.js +4 -4
  80. package/models/operations/getv2humanevalsets.js +2 -2
  81. package/models/operations/getv2humanevalsetsid.js +2 -2
  82. package/models/operations/index.d.ts +1 -0
  83. package/models/operations/index.d.ts.map +1 -1
  84. package/models/operations/index.js +1 -0
  85. package/models/operations/index.js.map +1 -1
  86. package/models/operations/patchv2humanevalsetsid.js +2 -2
  87. package/models/operations/postv2feedbackevaluation.js +4 -4
  88. package/models/operations/postv2humanevalsets.js +2 -2
  89. package/models/operations/retrievetool.js +4 -4
  90. package/models/operations/runagent.js +1 -1
  91. package/models/operations/streamrunagent.js +1 -1
  92. package/models/operations/updatetool.js +4 -4
  93. package/package.json +3 -3
  94. package/sdk/classify.d.ts +1 -1
  95. package/sdk/classify.js +1 -1
  96. package/sdk/decisions.d.ts +12 -0
  97. package/sdk/decisions.d.ts.map +1 -0
  98. package/sdk/decisions.js +22 -0
  99. package/sdk/decisions.js.map +1 -0
  100. package/sdk/router.d.ts +3 -0
  101. package/sdk/router.d.ts.map +1 -1
  102. package/sdk/router.js +4 -0
  103. package/sdk/router.js.map +1 -1
  104. package/src/funcs/routerClassifyCreate.ts +31 -3
  105. package/src/funcs/routerDecisionsCreate.ts +218 -0
  106. package/src/lib/config.ts +2 -2
  107. package/src/models/components/classifyanswer.ts +28 -56
  108. package/src/models/components/classifychoiceanswer.ts +46 -0
  109. package/src/models/components/classifyinputtokensdetails.ts +45 -0
  110. package/src/models/components/classifynoulanswer.ts +36 -0
  111. package/src/models/components/classifyrefusalanswer.ts +31 -0
  112. package/src/models/components/classifyretryconfig.ts +5 -5
  113. package/src/models/components/classifyscoreanswer.ts +51 -0
  114. package/src/models/components/classifyusage.ts +9 -2
  115. package/src/models/components/index.ts +5 -0
  116. package/src/models/components/model.ts +5 -0
  117. package/src/models/components/modelmetadata.ts +6 -0
  118. package/src/models/components/reasoningpart.ts +1 -1
  119. package/src/models/errors/createclassify.ts +214 -6
  120. package/src/models/errors/createdecisions.ts +363 -0
  121. package/src/models/errors/index.ts +1 -0
  122. package/src/models/operations/createclassify.ts +11 -4
  123. package/src/models/operations/createdecisions.ts +434 -0
  124. package/src/models/operations/createtool.ts +4 -4
  125. package/src/models/operations/getalltools.ts +4 -4
  126. package/src/models/operations/getv2humanevalsets.ts +2 -2
  127. package/src/models/operations/getv2humanevalsetsid.ts +2 -2
  128. package/src/models/operations/index.ts +1 -0
  129. package/src/models/operations/patchv2humanevalsetsid.ts +2 -2
  130. package/src/models/operations/postv2feedbackevaluation.ts +4 -4
  131. package/src/models/operations/postv2humanevalsets.ts +2 -2
  132. package/src/models/operations/retrievetool.ts +4 -4
  133. package/src/models/operations/runagent.ts +1 -1
  134. package/src/models/operations/streamrunagent.ts +1 -1
  135. package/src/models/operations/updatetool.ts +4 -4
  136. package/src/sdk/classify.ts +1 -1
  137. package/src/sdk/decisions.ts +27 -0
  138. package/src/sdk/router.ts +6 -0
@@ -7,14 +7,142 @@ import * as components from "../components/index.js";
7
7
  import { OrqError } from "./orqerror.js";
8
8
 
9
9
  /**
10
- * Rate limited by the provider.
10
+ * The upstream provider failed or returned an invalid classification response.
11
+ */
12
+ export type CreateClassifyRouterClassifyResponse502ResponseBodyData = {
13
+ error: components.APIError;
14
+ };
15
+
16
+ /**
17
+ * The upstream provider failed or returned an invalid classification response.
18
+ */
19
+ export class CreateClassifyRouterClassifyResponse502ResponseBody
20
+ extends OrqError
21
+ {
22
+ error: components.APIError;
23
+
24
+ /** The original data that was passed to this error instance. */
25
+ data$: CreateClassifyRouterClassifyResponse502ResponseBodyData;
26
+
27
+ constructor(
28
+ err: CreateClassifyRouterClassifyResponse502ResponseBodyData,
29
+ httpMeta: { response: Response; request: Request; body: string },
30
+ ) {
31
+ const message = err.error?.message
32
+ || `API error occurred: ${JSON.stringify(err)}`;
33
+ super(message, httpMeta);
34
+ this.data$ = err;
35
+ this.error = err.error;
36
+
37
+ this.name = "CreateClassifyRouterClassifyResponse502ResponseBody";
38
+ }
39
+ }
40
+
41
+ /**
42
+ * An internal model-resolution error occurred.
43
+ */
44
+ export type CreateClassifyRouterClassifyResponse500ResponseBodyData = {
45
+ error: components.APIError;
46
+ };
47
+
48
+ /**
49
+ * An internal model-resolution error occurred.
50
+ */
51
+ export class CreateClassifyRouterClassifyResponse500ResponseBody
52
+ extends OrqError
53
+ {
54
+ error: components.APIError;
55
+
56
+ /** The original data that was passed to this error instance. */
57
+ data$: CreateClassifyRouterClassifyResponse500ResponseBodyData;
58
+
59
+ constructor(
60
+ err: CreateClassifyRouterClassifyResponse500ResponseBodyData,
61
+ httpMeta: { response: Response; request: Request; body: string },
62
+ ) {
63
+ const message = err.error?.message
64
+ || `API error occurred: ${JSON.stringify(err)}`;
65
+ super(message, httpMeta);
66
+ this.data$ = err;
67
+ this.error = err.error;
68
+
69
+ this.name = "CreateClassifyRouterClassifyResponse500ResponseBody";
70
+ }
71
+ }
72
+
73
+ /**
74
+ * A plan rate limit, budget or provider rate limit was exceeded.
75
+ */
76
+ export type CreateClassifyRouterClassifyResponse429ResponseBodyData = {
77
+ error: components.APIError;
78
+ };
79
+
80
+ /**
81
+ * A plan rate limit, budget or provider rate limit was exceeded.
82
+ */
83
+ export class CreateClassifyRouterClassifyResponse429ResponseBody
84
+ extends OrqError
85
+ {
86
+ error: components.APIError;
87
+
88
+ /** The original data that was passed to this error instance. */
89
+ data$: CreateClassifyRouterClassifyResponse429ResponseBodyData;
90
+
91
+ constructor(
92
+ err: CreateClassifyRouterClassifyResponse429ResponseBodyData,
93
+ httpMeta: { response: Response; request: Request; body: string },
94
+ ) {
95
+ const message = err.error?.message
96
+ || `API error occurred: ${JSON.stringify(err)}`;
97
+ super(message, httpMeta);
98
+ this.data$ = err;
99
+ this.error = err.error;
100
+
101
+ this.name = "CreateClassifyRouterClassifyResponse429ResponseBody";
102
+ }
103
+ }
104
+
105
+ /**
106
+ * The state or a question violates the classification contract.
107
+ */
108
+ export type CreateClassifyRouterClassifyResponse422ResponseBodyData = {
109
+ error: components.APIError;
110
+ };
111
+
112
+ /**
113
+ * The state or a question violates the classification contract.
114
+ */
115
+ export class CreateClassifyRouterClassifyResponse422ResponseBody
116
+ extends OrqError
117
+ {
118
+ error: components.APIError;
119
+
120
+ /** The original data that was passed to this error instance. */
121
+ data$: CreateClassifyRouterClassifyResponse422ResponseBodyData;
122
+
123
+ constructor(
124
+ err: CreateClassifyRouterClassifyResponse422ResponseBodyData,
125
+ httpMeta: { response: Response; request: Request; body: string },
126
+ ) {
127
+ const message = err.error?.message
128
+ || `API error occurred: ${JSON.stringify(err)}`;
129
+ super(message, httpMeta);
130
+ this.data$ = err;
131
+ this.error = err.error;
132
+
133
+ this.name = "CreateClassifyRouterClassifyResponse422ResponseBody";
134
+ }
135
+ }
136
+
137
+ /**
138
+ * The API key lacks classify permission, or the workspace or project cannot access the model.
11
139
  */
12
140
  export type CreateClassifyRouterClassifyResponseResponseBodyData = {
13
141
  error: components.APIError;
14
142
  };
15
143
 
16
144
  /**
17
- * Rate limited by the provider.
145
+ * The API key lacks classify permission, or the workspace or project cannot access the model.
18
146
  */
19
147
  export class CreateClassifyRouterClassifyResponseResponseBody extends OrqError {
20
148
  error: components.APIError;
@@ -37,14 +165,14 @@ export class CreateClassifyRouterClassifyResponseResponseBody extends OrqError {
37
165
  }
38
166
 
39
167
  /**
40
- * The state or a question violates the classification contract.
168
+ * Missing, invalid, expired or revoked API key.
41
169
  */
42
170
  export type CreateClassifyRouterClassifyResponseBodyData = {
43
171
  error: components.APIError;
44
172
  };
45
173
 
46
174
  /**
47
- * The state or a question violates the classification contract.
175
+ * Missing, invalid, expired or revoked API key.
48
176
  */
49
177
  export class CreateClassifyRouterClassifyResponseBody extends OrqError {
50
178
  error: components.APIError;
@@ -67,14 +195,14 @@ export class CreateClassifyRouterClassifyResponseBody extends OrqError {
67
195
  }
68
196
 
69
197
  /**
70
- * Malformed JSON or missing model.
198
+ * Malformed JSON, missing or unsupported model, or invalid retry/fallback fields.
71
199
  */
72
200
  export type CreateClassifyResponseBodyData = {
73
201
  error: components.APIError;
74
202
  };
75
203
 
76
204
  /**
77
- * Malformed JSON or missing model.
205
+ * Malformed JSON, missing or unsupported model, or invalid retry/fallback fields.
78
206
  */
79
207
  export class CreateClassifyResponseBody extends OrqError {
80
208
  error: components.APIError;
@@ -96,6 +224,86 @@ export class CreateClassifyResponseBody extends OrqError {
96
224
  }
97
225
  }
98
226
 
227
+ /** @internal */
228
+ export const CreateClassifyRouterClassifyResponse502ResponseBody$inboundSchema:
229
+ z.ZodType<
230
+ CreateClassifyRouterClassifyResponse502ResponseBody,
231
+ z.ZodTypeDef,
232
+ unknown
233
+ > = z.object({
234
+ error: components.APIError$inboundSchema,
235
+ request$: z.instanceof(Request),
236
+ response$: z.instanceof(Response),
237
+ body$: z.string(),
238
+ })
239
+ .transform((v) => {
240
+ return new CreateClassifyRouterClassifyResponse502ResponseBody(v, {
241
+ request: v.request$,
242
+ response: v.response$,
243
+ body: v.body$,
244
+ });
245
+ });
246
+
247
+ /** @internal */
248
+ export const CreateClassifyRouterClassifyResponse500ResponseBody$inboundSchema:
249
+ z.ZodType<
250
+ CreateClassifyRouterClassifyResponse500ResponseBody,
251
+ z.ZodTypeDef,
252
+ unknown
253
+ > = z.object({
254
+ error: components.APIError$inboundSchema,
255
+ request$: z.instanceof(Request),
256
+ response$: z.instanceof(Response),
257
+ body$: z.string(),
258
+ })
259
+ .transform((v) => {
260
+ return new CreateClassifyRouterClassifyResponse500ResponseBody(v, {
261
+ request: v.request$,
262
+ response: v.response$,
263
+ body: v.body$,
264
+ });
265
+ });
266
+
267
+ /** @internal */
268
+ export const CreateClassifyRouterClassifyResponse429ResponseBody$inboundSchema:
269
+ z.ZodType<
270
+ CreateClassifyRouterClassifyResponse429ResponseBody,
271
+ z.ZodTypeDef,
272
+ unknown
273
+ > = z.object({
274
+ error: components.APIError$inboundSchema,
275
+ request$: z.instanceof(Request),
276
+ response$: z.instanceof(Response),
277
+ body$: z.string(),
278
+ })
279
+ .transform((v) => {
280
+ return new CreateClassifyRouterClassifyResponse429ResponseBody(v, {
281
+ request: v.request$,
282
+ response: v.response$,
283
+ body: v.body$,
284
+ });
285
+ });
286
+
287
+ /** @internal */
288
+ export const CreateClassifyRouterClassifyResponse422ResponseBody$inboundSchema:
289
+ z.ZodType<
290
+ CreateClassifyRouterClassifyResponse422ResponseBody,
291
+ z.ZodTypeDef,
292
+ unknown
293
+ > = z.object({
294
+ error: components.APIError$inboundSchema,
295
+ request$: z.instanceof(Request),
296
+ response$: z.instanceof(Response),
297
+ body$: z.string(),
298
+ })
299
+ .transform((v) => {
300
+ return new CreateClassifyRouterClassifyResponse422ResponseBody(v, {
301
+ request: v.request$,
302
+ response: v.response$,
303
+ body: v.body$,
304
+ });
305
+ });
306
+
99
307
  /** @internal */
100
308
  export const CreateClassifyRouterClassifyResponseResponseBody$inboundSchema:
101
309
  z.ZodType<
@@ -0,0 +1,363 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import * as components from "../components/index.js";
7
+ import { OrqError } from "./orqerror.js";
8
+
9
+ /**
10
+ * The upstream provider failed or returned an invalid classification response.
11
+ */
12
+ export type CreateDecisionsRouterDecisionsResponse502ResponseBodyData = {
13
+ error: components.APIError;
14
+ };
15
+
16
+ /**
17
+ * The upstream provider failed or returned an invalid classification response.
18
+ */
19
+ export class CreateDecisionsRouterDecisionsResponse502ResponseBody
20
+ extends OrqError
21
+ {
22
+ error: components.APIError;
23
+
24
+ /** The original data that was passed to this error instance. */
25
+ data$: CreateDecisionsRouterDecisionsResponse502ResponseBodyData;
26
+
27
+ constructor(
28
+ err: CreateDecisionsRouterDecisionsResponse502ResponseBodyData,
29
+ httpMeta: { response: Response; request: Request; body: string },
30
+ ) {
31
+ const message = err.error?.message
32
+ || `API error occurred: ${JSON.stringify(err)}`;
33
+ super(message, httpMeta);
34
+ this.data$ = err;
35
+ this.error = err.error;
36
+
37
+ this.name = "CreateDecisionsRouterDecisionsResponse502ResponseBody";
38
+ }
39
+ }
40
+
41
+ /**
42
+ * An internal model-resolution error occurred.
43
+ */
44
+ export type CreateDecisionsRouterDecisionsResponse500ResponseBodyData = {
45
+ error: components.APIError;
46
+ };
47
+
48
+ /**
49
+ * An internal model-resolution error occurred.
50
+ */
51
+ export class CreateDecisionsRouterDecisionsResponse500ResponseBody
52
+ extends OrqError
53
+ {
54
+ error: components.APIError;
55
+
56
+ /** The original data that was passed to this error instance. */
57
+ data$: CreateDecisionsRouterDecisionsResponse500ResponseBodyData;
58
+
59
+ constructor(
60
+ err: CreateDecisionsRouterDecisionsResponse500ResponseBodyData,
61
+ httpMeta: { response: Response; request: Request; body: string },
62
+ ) {
63
+ const message = err.error?.message
64
+ || `API error occurred: ${JSON.stringify(err)}`;
65
+ super(message, httpMeta);
66
+ this.data$ = err;
67
+ this.error = err.error;
68
+
69
+ this.name = "CreateDecisionsRouterDecisionsResponse500ResponseBody";
70
+ }
71
+ }
72
+
73
+ /**
74
+ * A plan rate limit, budget or provider rate limit was exceeded.
75
+ */
76
+ export type CreateDecisionsRouterDecisionsResponse429ResponseBodyData = {
77
+ error: components.APIError;
78
+ };
79
+
80
+ /**
81
+ * A plan rate limit, budget or provider rate limit was exceeded.
82
+ */
83
+ export class CreateDecisionsRouterDecisionsResponse429ResponseBody
84
+ extends OrqError
85
+ {
86
+ error: components.APIError;
87
+
88
+ /** The original data that was passed to this error instance. */
89
+ data$: CreateDecisionsRouterDecisionsResponse429ResponseBodyData;
90
+
91
+ constructor(
92
+ err: CreateDecisionsRouterDecisionsResponse429ResponseBodyData,
93
+ httpMeta: { response: Response; request: Request; body: string },
94
+ ) {
95
+ const message = err.error?.message
96
+ || `API error occurred: ${JSON.stringify(err)}`;
97
+ super(message, httpMeta);
98
+ this.data$ = err;
99
+ this.error = err.error;
100
+
101
+ this.name = "CreateDecisionsRouterDecisionsResponse429ResponseBody";
102
+ }
103
+ }
104
+
105
+ /**
106
+ * The state or a question violates the classification contract.
107
+ */
108
+ export type CreateDecisionsRouterDecisionsResponse422ResponseBodyData = {
109
+ error: components.APIError;
110
+ };
111
+
112
+ /**
113
+ * The state or a question violates the classification contract.
114
+ */
115
+ export class CreateDecisionsRouterDecisionsResponse422ResponseBody
116
+ extends OrqError
117
+ {
118
+ error: components.APIError;
119
+
120
+ /** The original data that was passed to this error instance. */
121
+ data$: CreateDecisionsRouterDecisionsResponse422ResponseBodyData;
122
+
123
+ constructor(
124
+ err: CreateDecisionsRouterDecisionsResponse422ResponseBodyData,
125
+ httpMeta: { response: Response; request: Request; body: string },
126
+ ) {
127
+ const message = err.error?.message
128
+ || `API error occurred: ${JSON.stringify(err)}`;
129
+ super(message, httpMeta);
130
+ this.data$ = err;
131
+ this.error = err.error;
132
+
133
+ this.name = "CreateDecisionsRouterDecisionsResponse422ResponseBody";
134
+ }
135
+ }
136
+
137
+ /**
138
+ * The API key lacks classify permission, or the workspace or project cannot access the model.
139
+ */
140
+ export type CreateDecisionsRouterDecisionsResponseResponseBodyData = {
141
+ error: components.APIError;
142
+ };
143
+
144
+ /**
145
+ * The API key lacks classify permission, or the workspace or project cannot access the model.
146
+ */
147
+ export class CreateDecisionsRouterDecisionsResponseResponseBody
148
+ extends OrqError
149
+ {
150
+ error: components.APIError;
151
+
152
+ /** The original data that was passed to this error instance. */
153
+ data$: CreateDecisionsRouterDecisionsResponseResponseBodyData;
154
+
155
+ constructor(
156
+ err: CreateDecisionsRouterDecisionsResponseResponseBodyData,
157
+ httpMeta: { response: Response; request: Request; body: string },
158
+ ) {
159
+ const message = err.error?.message
160
+ || `API error occurred: ${JSON.stringify(err)}`;
161
+ super(message, httpMeta);
162
+ this.data$ = err;
163
+ this.error = err.error;
164
+
165
+ this.name = "CreateDecisionsRouterDecisionsResponseResponseBody";
166
+ }
167
+ }
168
+
169
+ /**
170
+ * Missing, invalid, expired or revoked API key.
171
+ */
172
+ export type CreateDecisionsRouterDecisionsResponseBodyData = {
173
+ error: components.APIError;
174
+ };
175
+
176
+ /**
177
+ * Missing, invalid, expired or revoked API key.
178
+ */
179
+ export class CreateDecisionsRouterDecisionsResponseBody extends OrqError {
180
+ error: components.APIError;
181
+
182
+ /** The original data that was passed to this error instance. */
183
+ data$: CreateDecisionsRouterDecisionsResponseBodyData;
184
+
185
+ constructor(
186
+ err: CreateDecisionsRouterDecisionsResponseBodyData,
187
+ httpMeta: { response: Response; request: Request; body: string },
188
+ ) {
189
+ const message = err.error?.message
190
+ || `API error occurred: ${JSON.stringify(err)}`;
191
+ super(message, httpMeta);
192
+ this.data$ = err;
193
+ this.error = err.error;
194
+
195
+ this.name = "CreateDecisionsRouterDecisionsResponseBody";
196
+ }
197
+ }
198
+
199
+ /**
200
+ * Malformed JSON, missing or unsupported model, or invalid retry/fallback fields.
201
+ */
202
+ export type CreateDecisionsResponseBodyData = {
203
+ error: components.APIError;
204
+ };
205
+
206
+ /**
207
+ * Malformed JSON, missing or unsupported model, or invalid retry/fallback fields.
208
+ */
209
+ export class CreateDecisionsResponseBody extends OrqError {
210
+ error: components.APIError;
211
+
212
+ /** The original data that was passed to this error instance. */
213
+ data$: CreateDecisionsResponseBodyData;
214
+
215
+ constructor(
216
+ err: CreateDecisionsResponseBodyData,
217
+ httpMeta: { response: Response; request: Request; body: string },
218
+ ) {
219
+ const message = err.error?.message
220
+ || `API error occurred: ${JSON.stringify(err)}`;
221
+ super(message, httpMeta);
222
+ this.data$ = err;
223
+ this.error = err.error;
224
+
225
+ this.name = "CreateDecisionsResponseBody";
226
+ }
227
+ }
228
+
229
+ /** @internal */
230
+ export const CreateDecisionsRouterDecisionsResponse502ResponseBody$inboundSchema:
231
+ z.ZodType<
232
+ CreateDecisionsRouterDecisionsResponse502ResponseBody,
233
+ z.ZodTypeDef,
234
+ unknown
235
+ > = z.object({
236
+ error: components.APIError$inboundSchema,
237
+ request$: z.instanceof(Request),
238
+ response$: z.instanceof(Response),
239
+ body$: z.string(),
240
+ })
241
+ .transform((v) => {
242
+ return new CreateDecisionsRouterDecisionsResponse502ResponseBody(v, {
243
+ request: v.request$,
244
+ response: v.response$,
245
+ body: v.body$,
246
+ });
247
+ });
248
+
249
+ /** @internal */
250
+ export const CreateDecisionsRouterDecisionsResponse500ResponseBody$inboundSchema:
251
+ z.ZodType<
252
+ CreateDecisionsRouterDecisionsResponse500ResponseBody,
253
+ z.ZodTypeDef,
254
+ unknown
255
+ > = z.object({
256
+ error: components.APIError$inboundSchema,
257
+ request$: z.instanceof(Request),
258
+ response$: z.instanceof(Response),
259
+ body$: z.string(),
260
+ })
261
+ .transform((v) => {
262
+ return new CreateDecisionsRouterDecisionsResponse500ResponseBody(v, {
263
+ request: v.request$,
264
+ response: v.response$,
265
+ body: v.body$,
266
+ });
267
+ });
268
+
269
+ /** @internal */
270
+ export const CreateDecisionsRouterDecisionsResponse429ResponseBody$inboundSchema:
271
+ z.ZodType<
272
+ CreateDecisionsRouterDecisionsResponse429ResponseBody,
273
+ z.ZodTypeDef,
274
+ unknown
275
+ > = z.object({
276
+ error: components.APIError$inboundSchema,
277
+ request$: z.instanceof(Request),
278
+ response$: z.instanceof(Response),
279
+ body$: z.string(),
280
+ })
281
+ .transform((v) => {
282
+ return new CreateDecisionsRouterDecisionsResponse429ResponseBody(v, {
283
+ request: v.request$,
284
+ response: v.response$,
285
+ body: v.body$,
286
+ });
287
+ });
288
+
289
+ /** @internal */
290
+ export const CreateDecisionsRouterDecisionsResponse422ResponseBody$inboundSchema:
291
+ z.ZodType<
292
+ CreateDecisionsRouterDecisionsResponse422ResponseBody,
293
+ z.ZodTypeDef,
294
+ unknown
295
+ > = z.object({
296
+ error: components.APIError$inboundSchema,
297
+ request$: z.instanceof(Request),
298
+ response$: z.instanceof(Response),
299
+ body$: z.string(),
300
+ })
301
+ .transform((v) => {
302
+ return new CreateDecisionsRouterDecisionsResponse422ResponseBody(v, {
303
+ request: v.request$,
304
+ response: v.response$,
305
+ body: v.body$,
306
+ });
307
+ });
308
+
309
+ /** @internal */
310
+ export const CreateDecisionsRouterDecisionsResponseResponseBody$inboundSchema:
311
+ z.ZodType<
312
+ CreateDecisionsRouterDecisionsResponseResponseBody,
313
+ z.ZodTypeDef,
314
+ unknown
315
+ > = z.object({
316
+ error: components.APIError$inboundSchema,
317
+ request$: z.instanceof(Request),
318
+ response$: z.instanceof(Response),
319
+ body$: z.string(),
320
+ })
321
+ .transform((v) => {
322
+ return new CreateDecisionsRouterDecisionsResponseResponseBody(v, {
323
+ request: v.request$,
324
+ response: v.response$,
325
+ body: v.body$,
326
+ });
327
+ });
328
+
329
+ /** @internal */
330
+ export const CreateDecisionsRouterDecisionsResponseBody$inboundSchema:
331
+ z.ZodType<CreateDecisionsRouterDecisionsResponseBody, z.ZodTypeDef, unknown> =
332
+ z.object({
333
+ error: components.APIError$inboundSchema,
334
+ request$: z.instanceof(Request),
335
+ response$: z.instanceof(Response),
336
+ body$: z.string(),
337
+ })
338
+ .transform((v) => {
339
+ return new CreateDecisionsRouterDecisionsResponseBody(v, {
340
+ request: v.request$,
341
+ response: v.response$,
342
+ body: v.body$,
343
+ });
344
+ });
345
+
346
+ /** @internal */
347
+ export const CreateDecisionsResponseBody$inboundSchema: z.ZodType<
348
+ CreateDecisionsResponseBody,
349
+ z.ZodTypeDef,
350
+ unknown
351
+ > = z.object({
352
+ error: components.APIError$inboundSchema,
353
+ request$: z.instanceof(Request),
354
+ response$: z.instanceof(Response),
355
+ body$: z.string(),
356
+ })
357
+ .transform((v) => {
358
+ return new CreateDecisionsResponseBody(v, {
359
+ request: v.request$,
360
+ response: v.response$,
361
+ body: v.body$,
362
+ });
363
+ });
@@ -6,6 +6,7 @@ export * from "./apierror.js";
6
6
  export * from "./compactresponse.js";
7
7
  export * from "./createagentschedule.js";
8
8
  export * from "./createclassify.js";
9
+ export * from "./createdecisions.js";
9
10
  export * from "./createeval.js";
10
11
  export * from "./createmoderation.js";
11
12
  export * from "./createtranscription.js";
@@ -82,18 +82,22 @@ export type NoulQuestion = {
82
82
  export type Questions = NoulQuestion | ChoiceQuestion | ScoreQuestion;
83
83
 
84
84
  /**
85
- * The content to evaluate. A string, an object or an array.
85
+ * The content to evaluate. A string, an object or an array. For OpenAI GPT-6 Luna, strings are passed as text and objects or ordinary JSON arrays are serialized as text. User-message arrays accept string content or input_text/input_image parts. Images must be inline base64 data URLs, with at most 128 images across the request. Remote image URLs, file IDs, audio, non-user roles, bare content parts and tool items are rejected.
86
86
  */
87
87
  export type State = string | { [k: string]: any } | Array<any>;
88
88
 
89
89
  export type CreateClassifyRequestBody = {
90
+ /**
91
+ * Up to 10 fallback models in order. The gateway retries a model for matching error codes before trying the next model. Every model must support classification and satisfy access checks. Image requests require native OpenAI image-capable fallbacks.
92
+ */
93
+ fallbacks?: Array<components.FallbackConfig> | null | undefined;
90
94
  identity?: components.ResponseIdentity | undefined;
91
95
  /**
92
96
  * Key-value metadata attached to the trace.
93
97
  */
94
98
  metadata?: { [k: string]: string } | undefined;
95
99
  /**
96
- * ID of the model to use: the native classify model typesafe/jev-latest, or a chat model that supports classify.
100
+ * ID of a model that supports native or emulated classify, including openai/gpt-6-luna.
97
101
  */
98
102
  model: string;
99
103
  /**
@@ -106,7 +110,7 @@ export type CreateClassifyRequestBody = {
106
110
  questions: { [k: string]: NoulQuestion | ChoiceQuestion | ScoreQuestion };
107
111
  retry?: components.ClassifyRetryConfig | undefined;
108
112
  /**
109
- * The content to evaluate. A string, an object or an array.
113
+ * The content to evaluate. A string, an object or an array. For OpenAI GPT-6 Luna, strings are passed as text and objects or ordinary JSON arrays are serialized as text. User-message arrays accept string content or input_text/input_image parts. Images must be inline base64 data URLs, with at most 128 images across the request. Remote image URLs, file IDs, audio, non-user roles, bare content parts and tool items are rejected.
110
114
  */
111
115
  state: string | { [k: string]: any } | Array<any>;
112
116
  };
@@ -120,7 +124,7 @@ export type CreateClassifyResponseBody = {
120
124
  */
121
125
  answers: { [k: string]: components.ClassifyAnswer };
122
126
  /**
123
- * The model ID from the request.
127
+ * The requested ID of the model that answered. This can be a fallback model.
124
128
  */
125
129
  model: string;
126
130
  telemetry?: components.ResponseTelemetry | undefined;
@@ -307,6 +311,7 @@ export function stateToJSON(state: State): string {
307
311
 
308
312
  /** @internal */
309
313
  export type CreateClassifyRequestBody$Outbound = {
314
+ fallbacks?: Array<components.FallbackConfig$Outbound> | null | undefined;
310
315
  identity?: components.ResponseIdentity$Outbound | undefined;
311
316
  metadata?: { [k: string]: string } | undefined;
312
317
  model: string;
@@ -327,6 +332,8 @@ export const CreateClassifyRequestBody$outboundSchema: z.ZodType<
327
332
  z.ZodTypeDef,
328
333
  CreateClassifyRequestBody
329
334
  > = z.object({
335
+ fallbacks: z.nullable(z.array(components.FallbackConfig$outboundSchema))
336
+ .optional(),
330
337
  identity: components.ResponseIdentity$outboundSchema.optional(),
331
338
  metadata: z.record(z.string()).optional(),
332
339
  model: z.string(),