@orq-ai/node 4.16.3 → 4.16.5

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 (88) hide show
  1. package/jsr.json +1 -1
  2. package/lib/config.d.ts +2 -2
  3. package/lib/config.js +2 -2
  4. package/models/components/reasoningpart.js +1 -1
  5. package/models/operations/createtool.js +4 -4
  6. package/models/operations/getalltools.js +4 -4
  7. package/models/operations/getv2humanevalsets.js +2 -2
  8. package/models/operations/getv2humanevalsetsid.js +2 -2
  9. package/models/operations/patchv2humanevalsetsid.js +2 -2
  10. package/models/operations/postv2feedbackevaluation.js +4 -4
  11. package/models/operations/postv2humanevalsets.js +2 -2
  12. package/models/operations/retrievetool.js +4 -4
  13. package/models/operations/runagent.js +1 -1
  14. package/models/operations/streamrunagent.js +1 -1
  15. package/models/operations/updatetool.js +4 -4
  16. package/package.json +7 -7
  17. package/packages/orq-rc/src/funcs/routerAudioTranscriptionsCreate.ts +3 -0
  18. package/packages/orq-rc/src/funcs/routerAudioTranslationsCreate.ts +3 -0
  19. package/packages/orq-rc/src/funcs/routerImagesEditsCreate.ts +3 -0
  20. package/packages/orq-rc/src/funcs/routerImagesVariationsCreate.ts +3 -0
  21. package/packages/orq-rc/src/funcs/smartRoutersUpdate.ts +1 -1
  22. package/packages/orq-rc/src/lib/config.ts +2 -2
  23. package/packages/orq-rc/src/models/components/autorouterconfig.ts +18 -0
  24. package/packages/orq-rc/src/models/components/createsmartrouterrequest.ts +13 -0
  25. package/packages/orq-rc/src/models/components/index.ts +2 -0
  26. package/packages/orq-rc/src/models/components/modelfusion.ts +1 -1
  27. package/packages/orq-rc/src/models/components/modelsconfig.ts +13 -0
  28. package/packages/orq-rc/src/models/components/reasoningpart.ts +1 -1
  29. package/packages/orq-rc/src/models/components/routingrulemodelsconfig.ts +16 -0
  30. package/packages/orq-rc/src/models/components/sessionaffinityconfig.ts +70 -0
  31. package/packages/orq-rc/src/models/components/smartrouter.ts +7 -0
  32. package/packages/orq-rc/src/models/components/smartroutersessionaffinity.ts +70 -0
  33. package/packages/orq-rc/src/models/components/updatesmartrouterrequest.ts +13 -0
  34. package/packages/orq-rc/src/models/operations/createagentrequest.ts +26 -0
  35. package/packages/orq-rc/src/models/operations/createchatcompletion.ts +14 -0
  36. package/packages/orq-rc/src/models/operations/createclassify.ts +11 -0
  37. package/packages/orq-rc/src/models/operations/createcompletion.ts +14 -0
  38. package/packages/orq-rc/src/models/operations/createdecisions.ts +11 -0
  39. package/packages/orq-rc/src/models/operations/createembedding.ts +7 -0
  40. package/packages/orq-rc/src/models/operations/createimage.ts +14 -0
  41. package/packages/orq-rc/src/models/operations/createimageedit.ts +14 -0
  42. package/packages/orq-rc/src/models/operations/createimagevariation.ts +14 -0
  43. package/packages/orq-rc/src/models/operations/createprompt.ts +13 -0
  44. package/packages/orq-rc/src/models/operations/creatererank.ts +14 -0
  45. package/packages/orq-rc/src/models/operations/createrouterresponse.ts +7 -0
  46. package/packages/orq-rc/src/models/operations/createspeech.ts +14 -0
  47. package/packages/orq-rc/src/models/operations/createtool.ts +4 -4
  48. package/packages/orq-rc/src/models/operations/createtranscription.ts +14 -0
  49. package/packages/orq-rc/src/models/operations/createtranslation.ts +14 -0
  50. package/packages/orq-rc/src/models/operations/getallprompts.ts +6 -0
  51. package/packages/orq-rc/src/models/operations/getalltools.ts +4 -4
  52. package/packages/orq-rc/src/models/operations/getoneprompt.ts +6 -0
  53. package/packages/orq-rc/src/models/operations/getpromptversion.ts +6 -0
  54. package/packages/orq-rc/src/models/operations/getv2humanevalsets.ts +2 -2
  55. package/packages/orq-rc/src/models/operations/getv2humanevalsetsid.ts +2 -2
  56. package/packages/orq-rc/src/models/operations/listagents.ts +12 -0
  57. package/packages/orq-rc/src/models/operations/listpromptversions.ts +6 -0
  58. package/packages/orq-rc/src/models/operations/modelcreate.ts +4 -0
  59. package/packages/orq-rc/src/models/operations/modelcreateawsbedrock.ts +4 -0
  60. package/packages/orq-rc/src/models/operations/modelcreateopenailike.ts +4 -0
  61. package/packages/orq-rc/src/models/operations/modelcreatevertex.ts +4 -0
  62. package/packages/orq-rc/src/models/operations/modelupdate.ts +4 -0
  63. package/packages/orq-rc/src/models/operations/modelupdateawsbedrock.ts +4 -0
  64. package/packages/orq-rc/src/models/operations/modelupdateopenailike.ts +4 -0
  65. package/packages/orq-rc/src/models/operations/patchv2humanevalsetsid.ts +2 -2
  66. package/packages/orq-rc/src/models/operations/postv2feedbackevaluation.ts +4 -4
  67. package/packages/orq-rc/src/models/operations/postv2humanevalsets.ts +2 -2
  68. package/packages/orq-rc/src/models/operations/retrieveagentrequest.ts +12 -0
  69. package/packages/orq-rc/src/models/operations/retrievetool.ts +4 -4
  70. package/packages/orq-rc/src/models/operations/runagent.ts +15 -1
  71. package/packages/orq-rc/src/models/operations/streamrunagent.ts +15 -1
  72. package/packages/orq-rc/src/models/operations/updateagent.ts +26 -0
  73. package/packages/orq-rc/src/models/operations/updateprompt.ts +13 -0
  74. package/packages/orq-rc/src/models/operations/updatetool.ts +4 -4
  75. package/packages/orq-rc/src/sdk/smartrouters.ts +1 -1
  76. package/src/lib/config.ts +2 -2
  77. package/src/models/components/reasoningpart.ts +1 -1
  78. package/src/models/operations/createtool.ts +4 -4
  79. package/src/models/operations/getalltools.ts +4 -4
  80. package/src/models/operations/getv2humanevalsets.ts +2 -2
  81. package/src/models/operations/getv2humanevalsetsid.ts +2 -2
  82. package/src/models/operations/patchv2humanevalsetsid.ts +2 -2
  83. package/src/models/operations/postv2feedbackevaluation.ts +4 -4
  84. package/src/models/operations/postv2humanevalsets.ts +2 -2
  85. package/src/models/operations/retrievetool.ts +4 -4
  86. package/src/models/operations/runagent.ts +1 -1
  87. package/src/models/operations/streamrunagent.ts +1 -1
  88. package/src/models/operations/updatetool.ts +4 -4
@@ -3,6 +3,7 @@
3
3
  */
4
4
 
5
5
  import * as z from "zod/v3";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
6
7
  import { safeParse } from "../../lib/schemas.js";
7
8
  import { Result as SafeParseResult } from "../../types/fp.js";
8
9
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
@@ -19,6 +20,10 @@ export type RoutingRuleModelsConfig = {
19
20
  */
20
21
  mode?: string | undefined;
21
22
  models?: Array<RoutingRuleModel> | undefined;
23
+ /**
24
+ * HTTP error status codes that trigger fallback. Only allowed in fallback mode. Empty uses the default: 408, 429, 500, 502, 503, 504, 529.
25
+ */
26
+ fallbackOnCodes?: Array<number> | undefined;
22
27
  };
23
28
 
24
29
  /** @internal */
@@ -29,11 +34,17 @@ export const RoutingRuleModelsConfig$inboundSchema: z.ZodType<
29
34
  > = z.object({
30
35
  mode: z.string().optional(),
31
36
  models: z.array(RoutingRuleModel$inboundSchema).optional(),
37
+ fallback_on_codes: z.array(z.number().int()).optional(),
38
+ }).transform((v) => {
39
+ return remap$(v, {
40
+ "fallback_on_codes": "fallbackOnCodes",
41
+ });
32
42
  });
33
43
  /** @internal */
34
44
  export type RoutingRuleModelsConfig$Outbound = {
35
45
  mode?: string | undefined;
36
46
  models?: Array<RoutingRuleModel$Outbound> | undefined;
47
+ fallback_on_codes?: Array<number> | undefined;
37
48
  };
38
49
 
39
50
  /** @internal */
@@ -44,6 +55,11 @@ export const RoutingRuleModelsConfig$outboundSchema: z.ZodType<
44
55
  > = z.object({
45
56
  mode: z.string().optional(),
46
57
  models: z.array(RoutingRuleModel$outboundSchema).optional(),
58
+ fallbackOnCodes: z.array(z.number().int()).optional(),
59
+ }).transform((v) => {
60
+ return remap$(v, {
61
+ fallbackOnCodes: "fallback_on_codes",
62
+ });
47
63
  });
48
64
 
49
65
  export function routingRuleModelsConfigToJSON(
@@ -0,0 +1,70 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { safeParse } from "../../lib/schemas.js";
8
+ import { Result as SafeParseResult } from "../../types/fp.js";
9
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
+
11
+ export type SessionAffinityConfig = {
12
+ /**
13
+ * Whether later turns of a thread stay on the model chosen for its first turn. Only requests that carry a thread id take part. Off by default.
14
+ */
15
+ enabled: boolean;
16
+ /**
17
+ * Sliding idle window in seconds. A thread that stays quiet longer than this is routed afresh on its next turn. Between 60 and 3600. Defaults to 600 when omitted.
18
+ */
19
+ ttlSeconds?: number | undefined;
20
+ };
21
+
22
+ /** @internal */
23
+ export const SessionAffinityConfig$inboundSchema: z.ZodType<
24
+ SessionAffinityConfig,
25
+ z.ZodTypeDef,
26
+ unknown
27
+ > = z.object({
28
+ enabled: z.boolean(),
29
+ ttl_seconds: z.number().int().optional(),
30
+ }).transform((v) => {
31
+ return remap$(v, {
32
+ "ttl_seconds": "ttlSeconds",
33
+ });
34
+ });
35
+ /** @internal */
36
+ export type SessionAffinityConfig$Outbound = {
37
+ enabled: boolean;
38
+ ttl_seconds?: number | undefined;
39
+ };
40
+
41
+ /** @internal */
42
+ export const SessionAffinityConfig$outboundSchema: z.ZodType<
43
+ SessionAffinityConfig$Outbound,
44
+ z.ZodTypeDef,
45
+ SessionAffinityConfig
46
+ > = z.object({
47
+ enabled: z.boolean(),
48
+ ttlSeconds: z.number().int().optional(),
49
+ }).transform((v) => {
50
+ return remap$(v, {
51
+ ttlSeconds: "ttl_seconds",
52
+ });
53
+ });
54
+
55
+ export function sessionAffinityConfigToJSON(
56
+ sessionAffinityConfig: SessionAffinityConfig,
57
+ ): string {
58
+ return JSON.stringify(
59
+ SessionAffinityConfig$outboundSchema.parse(sessionAffinityConfig),
60
+ );
61
+ }
62
+ export function sessionAffinityConfigFromJSON(
63
+ jsonString: string,
64
+ ): SafeParseResult<SessionAffinityConfig, SDKValidationError> {
65
+ return safeParse(
66
+ jsonString,
67
+ (x) => SessionAffinityConfig$inboundSchema.parse(JSON.parse(x)),
68
+ `Failed to parse 'SessionAffinityConfig' from JSON`,
69
+ );
70
+ }
@@ -11,6 +11,10 @@ import {
11
11
  SmartRouterProfile,
12
12
  SmartRouterProfile$inboundSchema,
13
13
  } from "./smartrouterprofile.js";
14
+ import {
15
+ SmartRouterSessionAffinity,
16
+ SmartRouterSessionAffinity$inboundSchema,
17
+ } from "./smartroutersessionaffinity.js";
14
18
 
15
19
  export type SmartRouter = {
16
20
  /**
@@ -42,6 +46,7 @@ export type SmartRouter = {
42
46
  * Date and time when the Smart Router was last updated.
43
47
  */
44
48
  updatedAt: Date;
49
+ sessionAffinity?: SmartRouterSessionAffinity | undefined;
45
50
  };
46
51
 
47
52
  /** @internal */
@@ -58,12 +63,14 @@ export const SmartRouter$inboundSchema: z.ZodType<
58
63
  enabled: z.boolean(),
59
64
  created_at: z.string().datetime({ offset: true }).transform(v => new Date(v)),
60
65
  updated_at: z.string().datetime({ offset: true }).transform(v => new Date(v)),
66
+ session_affinity: SmartRouterSessionAffinity$inboundSchema.optional(),
61
67
  }).transform((v) => {
62
68
  return remap$(v, {
63
69
  "smart_router_id": "smartRouterId",
64
70
  "model_ref": "modelRef",
65
71
  "created_at": "createdAt",
66
72
  "updated_at": "updatedAt",
73
+ "session_affinity": "sessionAffinity",
67
74
  });
68
75
  });
69
76
 
@@ -0,0 +1,70 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { safeParse } from "../../lib/schemas.js";
8
+ import { Result as SafeParseResult } from "../../types/fp.js";
9
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
+
11
+ export type SmartRouterSessionAffinity = {
12
+ /**
13
+ * Whether later turns of a thread stay on the model chosen for its first turn. Only requests that carry a thread id take part. Off by default.
14
+ */
15
+ enabled: boolean;
16
+ /**
17
+ * Sliding idle window in seconds. A thread that stays quiet longer than this is routed afresh on its next turn. Between 60 and 3600. Defaults to 600 when omitted.
18
+ */
19
+ ttlSeconds?: number | undefined;
20
+ };
21
+
22
+ /** @internal */
23
+ export const SmartRouterSessionAffinity$inboundSchema: z.ZodType<
24
+ SmartRouterSessionAffinity,
25
+ z.ZodTypeDef,
26
+ unknown
27
+ > = z.object({
28
+ enabled: z.boolean(),
29
+ ttl_seconds: z.number().int().optional(),
30
+ }).transform((v) => {
31
+ return remap$(v, {
32
+ "ttl_seconds": "ttlSeconds",
33
+ });
34
+ });
35
+ /** @internal */
36
+ export type SmartRouterSessionAffinity$Outbound = {
37
+ enabled: boolean;
38
+ ttl_seconds?: number | undefined;
39
+ };
40
+
41
+ /** @internal */
42
+ export const SmartRouterSessionAffinity$outboundSchema: z.ZodType<
43
+ SmartRouterSessionAffinity$Outbound,
44
+ z.ZodTypeDef,
45
+ SmartRouterSessionAffinity
46
+ > = z.object({
47
+ enabled: z.boolean(),
48
+ ttlSeconds: z.number().int().optional(),
49
+ }).transform((v) => {
50
+ return remap$(v, {
51
+ ttlSeconds: "ttl_seconds",
52
+ });
53
+ });
54
+
55
+ export function smartRouterSessionAffinityToJSON(
56
+ smartRouterSessionAffinity: SmartRouterSessionAffinity,
57
+ ): string {
58
+ return JSON.stringify(
59
+ SmartRouterSessionAffinity$outboundSchema.parse(smartRouterSessionAffinity),
60
+ );
61
+ }
62
+ export function smartRouterSessionAffinityFromJSON(
63
+ jsonString: string,
64
+ ): SafeParseResult<SmartRouterSessionAffinity, SDKValidationError> {
65
+ return safeParse(
66
+ jsonString,
67
+ (x) => SmartRouterSessionAffinity$inboundSchema.parse(JSON.parse(x)),
68
+ `Failed to parse 'SmartRouterSessionAffinity' from JSON`,
69
+ );
70
+ }
@@ -3,10 +3,16 @@
3
3
  */
4
4
 
5
5
  import * as z from "zod/v3";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
6
7
  import {
7
8
  SmartRouterProfile,
8
9
  SmartRouterProfile$outboundSchema,
9
10
  } from "./smartrouterprofile.js";
11
+ import {
12
+ SmartRouterSessionAffinity,
13
+ SmartRouterSessionAffinity$Outbound,
14
+ SmartRouterSessionAffinity$outboundSchema,
15
+ } from "./smartroutersessionaffinity.js";
10
16
 
11
17
  export type UpdateSmartRouterRequest = {
12
18
  /**
@@ -14,12 +20,14 @@ export type UpdateSmartRouterRequest = {
14
20
  */
15
21
  models?: Array<string> | undefined;
16
22
  profile?: SmartRouterProfile | undefined;
23
+ sessionAffinity?: SmartRouterSessionAffinity | undefined;
17
24
  };
18
25
 
19
26
  /** @internal */
20
27
  export type UpdateSmartRouterRequest$Outbound = {
21
28
  models?: Array<string> | undefined;
22
29
  profile?: string | undefined;
30
+ session_affinity?: SmartRouterSessionAffinity$Outbound | undefined;
23
31
  };
24
32
 
25
33
  /** @internal */
@@ -30,6 +38,11 @@ export const UpdateSmartRouterRequest$outboundSchema: z.ZodType<
30
38
  > = z.object({
31
39
  models: z.array(z.string()).optional(),
32
40
  profile: SmartRouterProfile$outboundSchema.optional(),
41
+ sessionAffinity: SmartRouterSessionAffinity$outboundSchema.optional(),
42
+ }).transform((v) => {
43
+ return remap$(v, {
44
+ sessionAffinity: "session_affinity",
45
+ });
33
46
  });
34
47
 
35
48
  export function updateSmartRouterRequestToJSON(
@@ -411,6 +411,10 @@ export type ParametersT = {
411
411
  | components.TraceScrubbingPlugin
412
412
  >
413
413
  | undefined;
414
+ /**
415
+ * HTTP status codes that trigger fallback. Enter up to 20 unique integers from 400 to 599. When omitted or empty, defaults to [408, 429, 500, 502, 503, 504, 529].
416
+ */
417
+ fallbackOnCodes?: Array<number> | undefined;
414
418
  /**
415
419
  * Array of fallback models to use if primary model fails
416
420
  */
@@ -906,6 +910,10 @@ export type FallbackModelConfigurationParameters = {
906
910
  | components.TraceScrubbingPlugin
907
911
  >
908
912
  | undefined;
913
+ /**
914
+ * HTTP status codes that trigger fallback. Enter up to 20 unique integers from 400 to 599. When omitted or empty, defaults to [408, 429, 500, 502, 503, 504, 529].
915
+ */
916
+ fallbackOnCodes?: Array<number> | undefined;
909
917
  /**
910
918
  * Array of fallback models to use if primary model fails
911
919
  */
@@ -1847,6 +1855,10 @@ export type CreateAgentRequestParameters = {
1847
1855
  | components.TraceScrubbingPlugin
1848
1856
  >
1849
1857
  | undefined;
1858
+ /**
1859
+ * HTTP status codes that trigger fallback. Enter up to 20 unique integers from 400 to 599. When omitted or empty, defaults to [408, 429, 500, 502, 503, 504, 529].
1860
+ */
1861
+ fallbackOnCodes?: Array<number> | undefined;
1850
1862
  /**
1851
1863
  * Array of fallback models to use if primary model fails
1852
1864
  */
@@ -2335,6 +2347,10 @@ export type CreateAgentRequestFallbackModelConfigurationParameters = {
2335
2347
  | components.TraceScrubbingPlugin
2336
2348
  >
2337
2349
  | undefined;
2350
+ /**
2351
+ * HTTP status codes that trigger fallback. Enter up to 20 unique integers from 400 to 599. When omitted or empty, defaults to [408, 429, 500, 502, 503, 504, 529].
2352
+ */
2353
+ fallbackOnCodes?: Array<number> | undefined;
2338
2354
  /**
2339
2355
  * Array of fallback models to use if primary model fails
2340
2356
  */
@@ -2978,6 +2994,7 @@ export type ParametersT$Outbound = {
2978
2994
  | components.TraceScrubbingPlugin$Outbound
2979
2995
  >
2980
2996
  | undefined;
2997
+ fallback_on_codes?: Array<number> | undefined;
2981
2998
  fallbacks?: Array<Fallbacks$Outbound> | undefined;
2982
2999
  cache?: Cache$Outbound | undefined;
2983
3000
  load_balancer?: LoadBalancer1$Outbound | undefined;
@@ -3030,6 +3047,7 @@ export const ParametersT$outboundSchema: z.ZodType<
3030
3047
  components.TraceScrubbingPlugin$outboundSchema,
3031
3048
  ]),
3032
3049
  ).optional(),
3050
+ fallbackOnCodes: z.array(z.number().int()).optional(),
3033
3051
  fallbacks: z.array(z.lazy(() => Fallbacks$outboundSchema)).optional(),
3034
3052
  cache: z.lazy(() => Cache$outboundSchema).optional(),
3035
3053
  loadBalancer: z.lazy(() => LoadBalancer1$outboundSchema).optional(),
@@ -3049,6 +3067,7 @@ export const ParametersT$outboundSchema: z.ZodType<
3049
3067
  topK: "top_k",
3050
3068
  toolChoice: "tool_choice",
3051
3069
  parallelToolCalls: "parallel_tool_calls",
3070
+ fallbackOnCodes: "fallback_on_codes",
3052
3071
  loadBalancer: "load_balancer",
3053
3072
  cacheControl: "cache_control",
3054
3073
  promptCacheKey: "prompt_cache_key",
@@ -3730,6 +3749,7 @@ export type FallbackModelConfigurationParameters$Outbound = {
3730
3749
  | components.TraceScrubbingPlugin$Outbound
3731
3750
  >
3732
3751
  | undefined;
3752
+ fallback_on_codes?: Array<number> | undefined;
3733
3753
  fallbacks?: Array<FallbackModelConfigurationFallbacks$Outbound> | undefined;
3734
3754
  cache?: FallbackModelConfigurationCache$Outbound | undefined;
3735
3755
  load_balancer?: CreateAgentRequestLoadBalancer1$Outbound | undefined;
@@ -3787,6 +3807,7 @@ export const FallbackModelConfigurationParameters$outboundSchema: z.ZodType<
3787
3807
  components.TraceScrubbingPlugin$outboundSchema,
3788
3808
  ]),
3789
3809
  ).optional(),
3810
+ fallbackOnCodes: z.array(z.number().int()).optional(),
3790
3811
  fallbacks: z.array(
3791
3812
  z.lazy(() => FallbackModelConfigurationFallbacks$outboundSchema),
3792
3813
  ).optional(),
@@ -3812,6 +3833,7 @@ export const FallbackModelConfigurationParameters$outboundSchema: z.ZodType<
3812
3833
  topK: "top_k",
3813
3834
  toolChoice: "tool_choice",
3814
3835
  parallelToolCalls: "parallel_tool_calls",
3836
+ fallbackOnCodes: "fallback_on_codes",
3815
3837
  loadBalancer: "load_balancer",
3816
3838
  cacheControl: "cache_control",
3817
3839
  promptCacheKey: "prompt_cache_key",
@@ -4972,6 +4994,7 @@ export const CreateAgentRequestParameters$inboundSchema: z.ZodType<
4972
4994
  components.TraceScrubbingPlugin$inboundSchema,
4973
4995
  ]),
4974
4996
  ).optional(),
4997
+ fallback_on_codes: z.array(z.number().int()).optional(),
4975
4998
  fallbacks: z.array(z.lazy(() => CreateAgentRequestFallbacks$inboundSchema))
4976
4999
  .optional(),
4977
5000
  cache: z.lazy(() => CreateAgentRequestCache$inboundSchema).optional(),
@@ -4994,6 +5017,7 @@ export const CreateAgentRequestParameters$inboundSchema: z.ZodType<
4994
5017
  "top_k": "topK",
4995
5018
  "tool_choice": "toolChoice",
4996
5019
  "parallel_tool_calls": "parallelToolCalls",
5020
+ "fallback_on_codes": "fallbackOnCodes",
4997
5021
  "load_balancer": "loadBalancer",
4998
5022
  "cache_control": "cacheControl",
4999
5023
  "prompt_cache_key": "promptCacheKey",
@@ -5700,6 +5724,7 @@ export const CreateAgentRequestFallbackModelConfigurationParameters$inboundSchem
5700
5724
  components.TraceScrubbingPlugin$inboundSchema,
5701
5725
  ]),
5702
5726
  ).optional(),
5727
+ fallback_on_codes: z.array(z.number().int()).optional(),
5703
5728
  fallbacks: z.array(
5704
5729
  z.lazy(() =>
5705
5730
  CreateAgentRequestFallbackModelConfigurationFallbacks$inboundSchema
@@ -5730,6 +5755,7 @@ export const CreateAgentRequestFallbackModelConfigurationParameters$inboundSchem
5730
5755
  "top_k": "topK",
5731
5756
  "tool_choice": "toolChoice",
5732
5757
  "parallel_tool_calls": "parallelToolCalls",
5758
+ "fallback_on_codes": "fallbackOnCodes",
5733
5759
  "load_balancer": "loadBalancer",
5734
5760
  "cache_control": "cacheControl",
5735
5761
  "prompt_cache_key": "promptCacheKey",
@@ -1408,6 +1408,10 @@ export type Orq = {
1408
1408
  * Retry configuration for the request
1409
1409
  */
1410
1410
  retry?: CreateChatCompletionRouterChatCompletionsRetry | undefined;
1411
+ /**
1412
+ * HTTP status codes that trigger fallback. Enter up to 20 unique integers from 400 to 599. When omitted or empty, defaults to [408, 429, 500, 502, 503, 504, 529].
1413
+ */
1414
+ fallbackOnCodes?: Array<number> | undefined;
1411
1415
  /**
1412
1416
  * Array of fallback models to use if primary model fails
1413
1417
  */
@@ -1601,6 +1605,10 @@ export type CreateChatCompletionRequestBody = {
1601
1605
  | components.TraceScrubbingPlugin
1602
1606
  >
1603
1607
  | undefined;
1608
+ /**
1609
+ * HTTP status codes that trigger fallback. Enter up to 20 unique integers from 400 to 599. When omitted or empty, defaults to [408, 429, 500, 502, 503, 504, 529].
1610
+ */
1611
+ fallbackOnCodes?: Array<number> | undefined;
1604
1612
  /**
1605
1613
  * Array of fallback models to use if primary model fails
1606
1614
  */
@@ -5304,6 +5312,7 @@ export function createChatCompletionRouterChatCompletionsTimeoutToJSON(
5304
5312
  export type Orq$Outbound = {
5305
5313
  name?: string | undefined;
5306
5314
  retry?: CreateChatCompletionRouterChatCompletionsRetry$Outbound | undefined;
5315
+ fallback_on_codes?: Array<number> | undefined;
5307
5316
  fallbacks?:
5308
5317
  | Array<CreateChatCompletionRouterChatCompletionsFallbacks$Outbound>
5309
5318
  | undefined;
@@ -5331,6 +5340,7 @@ export const Orq$outboundSchema: z.ZodType<Orq$Outbound, z.ZodTypeDef, Orq> = z
5331
5340
  retry: z.lazy(() =>
5332
5341
  CreateChatCompletionRouterChatCompletionsRetry$outboundSchema
5333
5342
  ).optional(),
5343
+ fallbackOnCodes: z.array(z.number().int()).optional(),
5334
5344
  fallbacks: z.array(
5335
5345
  z.lazy(() =>
5336
5346
  CreateChatCompletionRouterChatCompletionsFallbacks$outboundSchema
@@ -5358,6 +5368,7 @@ export const Orq$outboundSchema: z.ZodType<Orq$Outbound, z.ZodTypeDef, Orq> = z
5358
5368
  ).optional(),
5359
5369
  }).transform((v) => {
5360
5370
  return remap$(v, {
5371
+ fallbackOnCodes: "fallback_on_codes",
5361
5372
  knowledgeBases: "knowledge_bases",
5362
5373
  loadBalancer: "load_balancer",
5363
5374
  });
@@ -5420,6 +5431,7 @@ export type CreateChatCompletionRequestBody$Outbound = {
5420
5431
  | components.TraceScrubbingPlugin$Outbound
5421
5432
  >
5422
5433
  | undefined;
5434
+ fallback_on_codes?: Array<number> | undefined;
5423
5435
  fallbacks?: Array<CreateChatCompletionFallbacks$Outbound> | undefined;
5424
5436
  retry?: CreateChatCompletionRetry$Outbound | undefined;
5425
5437
  cache?: CreateChatCompletionCache$Outbound | undefined;
@@ -5503,6 +5515,7 @@ export const CreateChatCompletionRequestBody$outboundSchema: z.ZodType<
5503
5515
  components.TraceScrubbingPlugin$outboundSchema,
5504
5516
  ]),
5505
5517
  ).optional(),
5518
+ fallbackOnCodes: z.array(z.number().int()).optional(),
5506
5519
  fallbacks: z.array(z.lazy(() => CreateChatCompletionFallbacks$outboundSchema))
5507
5520
  .optional(),
5508
5521
  retry: z.lazy(() => CreateChatCompletionRetry$outboundSchema).optional(),
@@ -5530,6 +5543,7 @@ export const CreateChatCompletionRequestBody$outboundSchema: z.ZodType<
5530
5543
  topK: "top_k",
5531
5544
  toolChoice: "tool_choice",
5532
5545
  parallelToolCalls: "parallel_tool_calls",
5546
+ fallbackOnCodes: "fallback_on_codes",
5533
5547
  loadBalancer: "load_balancer",
5534
5548
  cacheControl: "cache_control",
5535
5549
  promptCacheKey: "prompt_cache_key",
@@ -3,6 +3,7 @@
3
3
  */
4
4
 
5
5
  import * as z from "zod/v3";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
6
7
  import { safeParse } from "../../lib/schemas.js";
7
8
  import { Result as SafeParseResult } from "../../types/fp.js";
8
9
  import * as components from "../components/index.js";
@@ -88,6 +89,10 @@ export type State = string | { [k: string]: any } | Array<any>;
88
89
 
89
90
  export type CreateClassifyRequestBody = {
90
91
  cache?: components.ClassifyCacheConfig | undefined;
92
+ /**
93
+ * HTTP status codes that trigger fallback. Defaults to [408,429,500,502,503,504,529]. Each code must be unique and between 400 and 599.
94
+ */
95
+ fallbackOnCodes?: Array<number> | null | undefined;
91
96
  /**
92
97
  * 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.
93
98
  */
@@ -314,6 +319,7 @@ export function stateToJSON(state: State): string {
314
319
  /** @internal */
315
320
  export type CreateClassifyRequestBody$Outbound = {
316
321
  cache?: components.ClassifyCacheConfig$Outbound | undefined;
322
+ fallback_on_codes?: Array<number> | null | undefined;
317
323
  fallbacks?: Array<components.FallbackConfig$Outbound> | null | undefined;
318
324
  identity?: components.ResponseIdentity$Outbound | undefined;
319
325
  metadata?: { [k: string]: string } | undefined;
@@ -337,6 +343,7 @@ export const CreateClassifyRequestBody$outboundSchema: z.ZodType<
337
343
  CreateClassifyRequestBody
338
344
  > = z.object({
339
345
  cache: components.ClassifyCacheConfig$outboundSchema.optional(),
346
+ fallbackOnCodes: z.nullable(z.array(z.number().int())).optional(),
340
347
  fallbacks: z.nullable(z.array(components.FallbackConfig$outboundSchema))
341
348
  .optional(),
342
349
  identity: components.ResponseIdentity$outboundSchema.optional(),
@@ -353,6 +360,10 @@ export const CreateClassifyRequestBody$outboundSchema: z.ZodType<
353
360
  retry: components.ClassifyRetryConfig$outboundSchema.optional(),
354
361
  state: z.union([z.string(), z.record(z.any()), z.array(z.any())]),
355
362
  timeout: components.ClassifyTimeoutConfig$outboundSchema.optional(),
363
+ }).transform((v) => {
364
+ return remap$(v, {
365
+ fallbackOnCodes: "fallback_on_codes",
366
+ });
356
367
  });
357
368
 
358
369
  export function createClassifyRequestBodyToJSON(
@@ -635,6 +635,10 @@ export type CreateCompletionOrq = {
635
635
  * Retry configuration for the request
636
636
  */
637
637
  retry?: CreateCompletionRouterCompletionsRetry | undefined;
638
+ /**
639
+ * HTTP status codes that trigger fallback. Enter up to 20 unique integers from 400 to 599. When omitted or empty, defaults to [408, 429, 500, 502, 503, 504, 529].
640
+ */
641
+ fallbackOnCodes?: Array<number> | undefined;
638
642
  /**
639
643
  * Array of fallback models to use if primary model fails
640
644
  */
@@ -731,6 +735,10 @@ export type CreateCompletionRequestBody = {
731
735
  * The name to display on the trace. If not specified, the default system name will be used.
732
736
  */
733
737
  name?: string | undefined;
738
+ /**
739
+ * HTTP status codes that trigger fallback. Enter up to 20 unique integers from 400 to 599. When omitted or empty, defaults to [408, 429, 500, 502, 503, 504, 529].
740
+ */
741
+ fallbackOnCodes?: Array<number> | undefined;
734
742
  /**
735
743
  * Array of fallback models to use if primary model fails
736
744
  */
@@ -2787,6 +2795,7 @@ export function createCompletionRouterCompletionsTimeoutToJSON(
2787
2795
  export type CreateCompletionOrq$Outbound = {
2788
2796
  name?: string | undefined;
2789
2797
  retry?: CreateCompletionRouterCompletionsRetry$Outbound | undefined;
2798
+ fallback_on_codes?: Array<number> | undefined;
2790
2799
  fallbacks?:
2791
2800
  | Array<CreateCompletionRouterCompletionsFallbacks$Outbound>
2792
2801
  | undefined;
@@ -2815,6 +2824,7 @@ export const CreateCompletionOrq$outboundSchema: z.ZodType<
2815
2824
  name: z.string().optional(),
2816
2825
  retry: z.lazy(() => CreateCompletionRouterCompletionsRetry$outboundSchema)
2817
2826
  .optional(),
2827
+ fallbackOnCodes: z.array(z.number().int()).optional(),
2818
2828
  fallbacks: z.array(
2819
2829
  z.lazy(() => CreateCompletionRouterCompletionsFallbacks$outboundSchema),
2820
2830
  ).optional(),
@@ -2838,6 +2848,7 @@ export const CreateCompletionOrq$outboundSchema: z.ZodType<
2838
2848
  .optional(),
2839
2849
  }).transform((v) => {
2840
2850
  return remap$(v, {
2851
+ fallbackOnCodes: "fallback_on_codes",
2841
2852
  knowledgeBases: "knowledge_bases",
2842
2853
  loadBalancer: "load_balancer",
2843
2854
  });
@@ -2866,6 +2877,7 @@ export type CreateCompletionRequestBody$Outbound = {
2866
2877
  n: number | null;
2867
2878
  user?: string | undefined;
2868
2879
  name?: string | undefined;
2880
+ fallback_on_codes?: Array<number> | undefined;
2869
2881
  fallbacks?: Array<CreateCompletionFallbacks$Outbound> | undefined;
2870
2882
  retry?: CreateCompletionRetry$Outbound | undefined;
2871
2883
  cache?: CreateCompletionCache$Outbound | undefined;
@@ -2901,6 +2913,7 @@ export const CreateCompletionRequestBody$outboundSchema: z.ZodType<
2901
2913
  n: z.nullable(z.number().int().default(1)),
2902
2914
  user: z.string().optional(),
2903
2915
  name: z.string().optional(),
2916
+ fallbackOnCodes: z.array(z.number().int()).optional(),
2904
2917
  fallbacks: z.array(z.lazy(() => CreateCompletionFallbacks$outboundSchema))
2905
2918
  .optional(),
2906
2919
  retry: z.lazy(() => CreateCompletionRetry$outboundSchema).optional(),
@@ -2924,6 +2937,7 @@ export const CreateCompletionRequestBody$outboundSchema: z.ZodType<
2924
2937
  maxTokens: "max_tokens",
2925
2938
  presencePenalty: "presence_penalty",
2926
2939
  topP: "top_p",
2940
+ fallbackOnCodes: "fallback_on_codes",
2927
2941
  loadBalancer: "load_balancer",
2928
2942
  });
2929
2943
  });
@@ -3,6 +3,7 @@
3
3
  */
4
4
 
5
5
  import * as z from "zod/v3";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
6
7
  import { safeParse } from "../../lib/schemas.js";
7
8
  import { Result as SafeParseResult } from "../../types/fp.js";
8
9
  import * as components from "../components/index.js";
@@ -96,6 +97,10 @@ export type CreateDecisionsState = string | { [k: string]: any } | Array<any>;
96
97
 
97
98
  export type CreateDecisionsRequestBody = {
98
99
  cache?: components.ClassifyCacheConfig | undefined;
100
+ /**
101
+ * HTTP status codes that trigger fallback. Defaults to [408,429,500,502,503,504,529]. Each code must be unique and between 400 and 599.
102
+ */
103
+ fallbackOnCodes?: Array<number> | null | undefined;
99
104
  /**
100
105
  * 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.
101
106
  */
@@ -368,6 +373,7 @@ export function createDecisionsStateToJSON(
368
373
  /** @internal */
369
374
  export type CreateDecisionsRequestBody$Outbound = {
370
375
  cache?: components.ClassifyCacheConfig$Outbound | undefined;
376
+ fallback_on_codes?: Array<number> | null | undefined;
371
377
  fallbacks?: Array<components.FallbackConfig$Outbound> | null | undefined;
372
378
  identity?: components.ResponseIdentity$Outbound | undefined;
373
379
  metadata?: { [k: string]: string } | undefined;
@@ -391,6 +397,7 @@ export const CreateDecisionsRequestBody$outboundSchema: z.ZodType<
391
397
  CreateDecisionsRequestBody
392
398
  > = z.object({
393
399
  cache: components.ClassifyCacheConfig$outboundSchema.optional(),
400
+ fallbackOnCodes: z.nullable(z.array(z.number().int())).optional(),
394
401
  fallbacks: z.nullable(z.array(components.FallbackConfig$outboundSchema))
395
402
  .optional(),
396
403
  identity: components.ResponseIdentity$outboundSchema.optional(),
@@ -407,6 +414,10 @@ export const CreateDecisionsRequestBody$outboundSchema: z.ZodType<
407
414
  retry: components.ClassifyRetryConfig$outboundSchema.optional(),
408
415
  state: z.union([z.string(), z.record(z.any()), z.array(z.any())]),
409
416
  timeout: components.ClassifyTimeoutConfig$outboundSchema.optional(),
417
+ }).transform((v) => {
418
+ return remap$(v, {
419
+ fallbackOnCodes: "fallback_on_codes",
420
+ });
410
421
  });
411
422
 
412
423
  export function createDecisionsRequestBodyToJSON(
@@ -39,6 +39,10 @@ export type CreateEmbeddingRequestBody = {
39
39
  * The format to return the embeddings in. Can be either float or base64.
40
40
  */
41
41
  encodingFormat?: EncodingFormat | undefined;
42
+ /**
43
+ * HTTP status codes that trigger fallback. Defaults to [408,429,500,502,503,504,529]. Each code must be unique and between 400 and 599.
44
+ */
45
+ fallbackOnCodes?: Array<number> | null | undefined;
42
46
  /**
43
47
  * Array of fallback models to use if primary model fails.
44
48
  */
@@ -146,6 +150,7 @@ export type CreateEmbeddingRequestBody$Outbound = {
146
150
  cache?: components.EmbeddingCacheConfig$Outbound | undefined;
147
151
  dimensions?: number | undefined;
148
152
  encoding_format?: string | undefined;
153
+ fallback_on_codes?: Array<number> | null | undefined;
149
154
  fallbacks?: Array<components.FallbackConfig$Outbound> | null | undefined;
150
155
  input: string | Array<string | Array<number>>;
151
156
  load_balancer?: components.EmbeddingLoadBalancerConfig$Outbound | undefined;
@@ -166,6 +171,7 @@ export const CreateEmbeddingRequestBody$outboundSchema: z.ZodType<
166
171
  cache: components.EmbeddingCacheConfig$outboundSchema.optional(),
167
172
  dimensions: z.number().int().optional(),
168
173
  encodingFormat: EncodingFormat$outboundSchema.optional(),
174
+ fallbackOnCodes: z.nullable(z.array(z.number().int())).optional(),
169
175
  fallbacks: z.nullable(z.array(components.FallbackConfig$outboundSchema))
170
176
  .optional(),
171
177
  input: z.union([
@@ -183,6 +189,7 @@ export const CreateEmbeddingRequestBody$outboundSchema: z.ZodType<
183
189
  }).transform((v) => {
184
190
  return remap$(v, {
185
191
  encodingFormat: "encoding_format",
192
+ fallbackOnCodes: "fallback_on_codes",
186
193
  loadBalancer: "load_balancer",
187
194
  });
188
195
  });