@orq-ai/node 4.17.0 → 4.17.1

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 (119) hide show
  1. package/jsr.json +1 -1
  2. package/lib/config.d.ts +3 -3
  3. package/lib/config.js +3 -3
  4. package/lib/config.js.map +1 -1
  5. package/models/components/autorouterconfig.d.ts +21 -0
  6. package/models/components/autorouterconfig.d.ts.map +1 -1
  7. package/models/components/autorouterconfig.js.map +1 -1
  8. package/models/components/autorouterv2config.d.ts +54 -0
  9. package/models/components/autorouterv2config.d.ts.map +1 -1
  10. package/models/components/autorouterv2config.js.map +1 -1
  11. package/models/components/autorouterv2creatorconfig.d.ts +9 -0
  12. package/models/components/autorouterv2creatorconfig.d.ts.map +1 -1
  13. package/models/components/autorouterv2creatorconfig.js.map +1 -1
  14. package/models/components/autorouterv2effortconfig.d.ts +18 -0
  15. package/models/components/autorouterv2effortconfig.d.ts.map +1 -1
  16. package/models/components/autorouterv2effortconfig.js.map +1 -1
  17. package/models/components/budgetmatch.d.ts +1 -1
  18. package/models/components/classifyretryconfig.d.ts +4 -4
  19. package/models/components/classifyretryconfig.d.ts.map +1 -1
  20. package/models/components/classifyretryconfig.js +1 -1
  21. package/models/components/classifyretryconfig.js.map +1 -1
  22. package/models/components/embeddingretryconfig.d.ts +4 -4
  23. package/models/components/embeddingretryconfig.d.ts.map +1 -1
  24. package/models/components/embeddingretryconfig.js +1 -1
  25. package/models/components/embeddingretryconfig.js.map +1 -1
  26. package/models/components/evaluatorcalltimeout.d.ts +18 -0
  27. package/models/components/evaluatorcalltimeout.d.ts.map +1 -0
  28. package/models/components/evaluatorcalltimeout.js +54 -0
  29. package/models/components/evaluatorcalltimeout.js.map +1 -0
  30. package/models/components/evaluatorretryconfig.d.ts +20 -0
  31. package/models/components/evaluatorretryconfig.d.ts.map +1 -0
  32. package/models/components/evaluatorretryconfig.js +55 -0
  33. package/models/components/evaluatorretryconfig.js.map +1 -0
  34. package/models/components/index.d.ts +2 -0
  35. package/models/components/index.d.ts.map +1 -1
  36. package/models/components/index.js +2 -0
  37. package/models/components/index.js.map +1 -1
  38. package/models/components/invokeevaluatorrequest.d.ts +9 -0
  39. package/models/components/invokeevaluatorrequest.d.ts.map +1 -1
  40. package/models/components/invokeevaluatorrequest.js +4 -0
  41. package/models/components/invokeevaluatorrequest.js.map +1 -1
  42. package/models/components/loadbalancerconfig.d.ts +19 -1
  43. package/models/components/loadbalancerconfig.d.ts.map +1 -1
  44. package/models/components/loadbalancerconfig.js +12 -2
  45. package/models/components/loadbalancerconfig.js.map +1 -1
  46. package/models/components/reasoning.d.ts +9 -0
  47. package/models/components/reasoning.d.ts.map +1 -1
  48. package/models/components/reasoning.js +9 -1
  49. package/models/components/reasoning.js.map +1 -1
  50. package/models/components/reasoningparam.d.ts +10 -0
  51. package/models/components/reasoningparam.d.ts.map +1 -1
  52. package/models/components/reasoningparam.js +10 -1
  53. package/models/components/reasoningparam.js.map +1 -1
  54. package/models/components/reasoningpart.js +1 -1
  55. package/models/components/responseretryconfig.d.ts +4 -4
  56. package/models/components/responseretryconfig.d.ts.map +1 -1
  57. package/models/components/responseretryconfig.js +1 -1
  58. package/models/components/responseretryconfig.js.map +1 -1
  59. package/models/operations/createtool.js +4 -4
  60. package/models/operations/getalltools.js +4 -4
  61. package/models/operations/getv2humanevalsets.js +2 -2
  62. package/models/operations/getv2humanevalsetsid.js +2 -2
  63. package/models/operations/listdeploymentversions.js +1 -1
  64. package/models/operations/modelcreateawsbedrock.d.ts +6 -0
  65. package/models/operations/modelcreateawsbedrock.d.ts.map +1 -1
  66. package/models/operations/modelcreateawsbedrock.js.map +1 -1
  67. package/models/operations/modelupdateawsbedrock.d.ts +6 -0
  68. package/models/operations/modelupdateawsbedrock.d.ts.map +1 -1
  69. package/models/operations/modelupdateawsbedrock.js.map +1 -1
  70. package/models/operations/patchv2humanevalsetsid.js +2 -2
  71. package/models/operations/postv2humanevalsets.js +2 -2
  72. package/models/operations/retrievetool.js +4 -4
  73. package/models/operations/runagent.js +1 -1
  74. package/models/operations/streamrunagent.js +1 -1
  75. package/models/operations/updatetool.js +4 -4
  76. package/package.json +3 -3
  77. package/packages/orq-rc/src/lib/config.ts +2 -2
  78. package/packages/orq-rc/src/models/components/reasoningpart.ts +1 -1
  79. package/packages/orq-rc/src/models/operations/createtool.ts +4 -4
  80. package/packages/orq-rc/src/models/operations/getalltools.ts +4 -4
  81. package/packages/orq-rc/src/models/operations/getv2humanevalsets.ts +2 -2
  82. package/packages/orq-rc/src/models/operations/getv2humanevalsetsid.ts +2 -2
  83. package/packages/orq-rc/src/models/operations/listdeploymentversions.ts +1 -1
  84. package/packages/orq-rc/src/models/operations/patchv2humanevalsetsid.ts +2 -2
  85. package/packages/orq-rc/src/models/operations/postv2humanevalsets.ts +2 -2
  86. package/packages/orq-rc/src/models/operations/retrievetool.ts +4 -4
  87. package/packages/orq-rc/src/models/operations/runagent.ts +1 -1
  88. package/packages/orq-rc/src/models/operations/streamrunagent.ts +1 -1
  89. package/packages/orq-rc/src/models/operations/updatetool.ts +4 -4
  90. package/src/lib/config.ts +3 -3
  91. package/src/models/components/autorouterconfig.ts +21 -0
  92. package/src/models/components/autorouterv2config.ts +54 -0
  93. package/src/models/components/autorouterv2creatorconfig.ts +9 -0
  94. package/src/models/components/autorouterv2effortconfig.ts +18 -0
  95. package/src/models/components/budgetmatch.ts +1 -1
  96. package/src/models/components/classifyretryconfig.ts +5 -5
  97. package/src/models/components/embeddingretryconfig.ts +5 -5
  98. package/src/models/components/evaluatorcalltimeout.ts +42 -0
  99. package/src/models/components/evaluatorretryconfig.ts +45 -0
  100. package/src/models/components/index.ts +2 -0
  101. package/src/models/components/invokeevaluatorrequest.ts +19 -0
  102. package/src/models/components/loadbalancerconfig.ts +24 -2
  103. package/src/models/components/reasoning.ts +14 -0
  104. package/src/models/components/reasoningparam.ts +14 -0
  105. package/src/models/components/reasoningpart.ts +1 -1
  106. package/src/models/components/responseretryconfig.ts +5 -5
  107. package/src/models/operations/createtool.ts +4 -4
  108. package/src/models/operations/getalltools.ts +4 -4
  109. package/src/models/operations/getv2humanevalsets.ts +2 -2
  110. package/src/models/operations/getv2humanevalsetsid.ts +2 -2
  111. package/src/models/operations/listdeploymentversions.ts +1 -1
  112. package/src/models/operations/modelcreateawsbedrock.ts +6 -0
  113. package/src/models/operations/modelupdateawsbedrock.ts +6 -0
  114. package/src/models/operations/patchv2humanevalsetsid.ts +2 -2
  115. package/src/models/operations/postv2humanevalsets.ts +2 -2
  116. package/src/models/operations/retrievetool.ts +4 -4
  117. package/src/models/operations/runagent.ts +1 -1
  118. package/src/models/operations/streamrunagent.ts +1 -1
  119. package/src/models/operations/updatetool.ts +4 -4
@@ -21,14 +21,35 @@ import {
21
21
  } from "./sessionaffinityconfig.js";
22
22
 
23
23
  export type AutoRouterConfig = {
24
+ /**
25
+ * Catalog model whose benchmarks this private model copies to join Smart Router pools.
26
+ */
24
27
  benchmarkModel?: string | undefined;
28
+ /**
29
+ * Model used when the router classifies a request as simple.
30
+ */
25
31
  economicalModel?: string | undefined;
32
+ /**
33
+ * Identifier of the Smart Router configuration.
34
+ */
26
35
  id?: string | undefined;
36
+ /**
37
+ * Models the router chooses from, written as provider/model_id.
38
+ */
27
39
  models?: Array<string> | null | undefined;
40
+ /**
41
+ * Routing preference: quality, balanced, or cost.
42
+ */
28
43
  profile?: string | undefined;
29
44
  sessionAffinity?: SessionAffinityConfig | undefined;
45
+ /**
46
+ * Model used when the router classifies a request as complex.
47
+ */
30
48
  strongModel?: string | undefined;
31
49
  v2?: AutoRouterV2Config | undefined;
50
+ /**
51
+ * Version of the Smart Router configuration format.
52
+ */
32
53
  version?: string | undefined;
33
54
  };
34
55
 
@@ -22,23 +22,77 @@ import {
22
22
 
23
23
  export type AutoRouterV2Config = {
24
24
  aaCreator?: AutoRouterV2CreatorConfig | undefined;
25
+ /**
26
+ * Benchmark scores reported by Artificial Analysis, keyed by evaluation.
27
+ */
25
28
  aaEvaluations?: { [k: string]: number | null } | undefined;
29
+ /**
30
+ * Whether the intelligence index is estimated rather than measured.
31
+ */
26
32
  aaIndexIsEstimated?: boolean | undefined;
33
+ /**
34
+ * Version of the intelligence index the score came from.
35
+ */
27
36
  aaIndexVersion?: string | undefined;
37
+ /**
38
+ * Whether Artificial Analysis classifies the model as a reasoning model.
39
+ */
28
40
  aaIsReasoning?: boolean | undefined;
41
+ /**
42
+ * Median output tokens per second measured by Artificial Analysis.
43
+ */
29
44
  aaMedianOutputTokensPerSecond?: number | undefined;
45
+ /**
46
+ * Median time to the first answer token measured by Artificial Analysis.
47
+ */
30
48
  aaMedianTimeToFirstAnswerToken?: number | undefined;
49
+ /**
50
+ * Median time to first token in seconds measured by Artificial Analysis.
51
+ */
31
52
  aaMedianTimeToFirstTokenSeconds?: number | undefined;
53
+ /**
54
+ * Artificial Analysis model identifier.
55
+ */
32
56
  aaModelId?: string | undefined;
57
+ /**
58
+ * Model name reported by Artificial Analysis.
59
+ */
33
60
  aaName?: string | undefined;
61
+ /**
62
+ * Token prices reported by Artificial Analysis, keyed by price type.
63
+ */
34
64
  aaPricing?: { [k: string]: number | null } | undefined;
65
+ /**
66
+ * Reasoning effort the benchmarked score applies to.
67
+ */
35
68
  aaReasoningEffort?: string | undefined;
69
+ /**
70
+ * Model release date reported by Artificial Analysis.
71
+ */
36
72
  aaReleaseDate?: string | undefined;
73
+ /**
74
+ * Artificial Analysis slug of the model.
75
+ */
37
76
  aaSlug?: string | undefined;
77
+ /**
78
+ * Reasoning effort applied when a request does not set one.
79
+ */
38
80
  defaultEffort?: string | undefined;
81
+ /**
82
+ * Whether the default effort has a benchmarked score.
83
+ */
39
84
  defaultEffortScored?: boolean | undefined;
85
+ /**
86
+ * Artificial Analysis intelligence index the router ranks the model by.
87
+ */
40
88
  intelligenceIndex: number;
89
+ /**
90
+ * Blended price per million tokens, in USD.
91
+ */
41
92
  price: number;
93
+ /**
94
+ * Benchmark data for each reasoning effort the model exposes.
95
+ */
42
96
  reasoningEfforts?: { [k: string]: AutoRouterV2EffortConfig } | undefined;
43
97
  };
44
98
 
@@ -8,8 +8,17 @@ import { Result as SafeParseResult } from "../../types/fp.js";
8
8
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
9
 
10
10
  export type AutoRouterV2CreatorConfig = {
11
+ /**
12
+ * Artificial Analysis identifier of the creator.
13
+ */
11
14
  id: string;
15
+ /**
16
+ * Creator name reported by Artificial Analysis.
17
+ */
12
18
  name: string;
19
+ /**
20
+ * Artificial Analysis slug of the creator.
21
+ */
13
22
  slug?: string | undefined;
14
23
  };
15
24
 
@@ -9,11 +9,29 @@ import { Result as SafeParseResult } from "../../types/fp.js";
9
9
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
10
 
11
11
  export type AutoRouterV2EffortConfig = {
12
+ /**
13
+ * Whether the score at this effort is estimated.
14
+ */
12
15
  aaIndexIsEstimated?: boolean | undefined;
16
+ /**
17
+ * Version of the intelligence index measured at this effort.
18
+ */
13
19
  aaIndexVersion?: string | undefined;
20
+ /**
21
+ * Whether the model runs as a reasoning model at this effort.
22
+ */
14
23
  aaIsReasoning?: boolean | undefined;
24
+ /**
25
+ * Reasoning effort label Artificial Analysis reports for this entry.
26
+ */
15
27
  aaReasoningEffort?: string | undefined;
28
+ /**
29
+ * Artificial Analysis slug of the model at this effort.
30
+ */
16
31
  aaSlug?: string | undefined;
32
+ /**
33
+ * Intelligence index measured at this effort.
34
+ */
17
35
  intelligenceIndex: number;
18
36
  };
19
37
 
@@ -8,7 +8,7 @@ import { Result as SafeParseResult } from "../../types/fp.js";
8
8
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
9
 
10
10
  /**
11
- * CEL expression that decides whether a budget applies to a request. Available variables: `model`, `provider`, `model_id`, `api_key`, `identity`, `project`, `metadata` (map), `headers` (map, lowercase keys). An empty expression always matches. Expressions are syntax-validated at write time.
11
+ * CEL expression that decides whether a budget applies to a request. Available variables: `model`, `provider`, `model_id`, `api_key`, `identity`, `project`, `metadata` (map), `headers` (map, lowercase keys). Required unless the budget is created from a `scope`, and rejected on update when left empty. A workspace-wide budget stores an empty expression, which matches every request in the workspace. Expressions are syntax-validated at write time.
12
12
  */
13
13
  export type BudgetMatch = {
14
14
  cel?: string | undefined;
@@ -7,19 +7,19 @@ import { remap as remap$ } from "../../lib/primitives.js";
7
7
 
8
8
  export type ClassifyRetryConfig = {
9
9
  /**
10
- * Number of retries per model after the initial attempt (1-5). No retries are made when retry is omitted.
10
+ * Number of retries per model after the initial attempt (0-5). Set 0 to disable retries. When retry is omitted, the gateway retries twice.
11
11
  */
12
12
  count: number;
13
13
  /**
14
- * HTTP status codes that trigger retries, between 100 and 599. Retry-After is honored; otherwise the gateway waits one second.
14
+ * HTTP status codes that trigger retries, between 100 and 599. Defaults to [408, 429, 500, 502, 503, 504, 529]. Retry-After is honored; otherwise the gateway backs off exponentially.
15
15
  */
16
- onCodes: Array<number>;
16
+ onCodes?: Array<number> | undefined;
17
17
  };
18
18
 
19
19
  /** @internal */
20
20
  export type ClassifyRetryConfig$Outbound = {
21
21
  count: number;
22
- on_codes: Array<number>;
22
+ on_codes?: Array<number> | undefined;
23
23
  };
24
24
 
25
25
  /** @internal */
@@ -29,7 +29,7 @@ export const ClassifyRetryConfig$outboundSchema: z.ZodType<
29
29
  ClassifyRetryConfig
30
30
  > = z.object({
31
31
  count: z.number().int(),
32
- onCodes: z.array(z.number().int()),
32
+ onCodes: z.array(z.number().int()).optional(),
33
33
  }).transform((v) => {
34
34
  return remap$(v, {
35
35
  onCodes: "on_codes",
@@ -7,19 +7,19 @@ import { remap as remap$ } from "../../lib/primitives.js";
7
7
 
8
8
  export type EmbeddingRetryConfig = {
9
9
  /**
10
- * Number of retry attempts (1-5).
10
+ * Number of retries per model after the initial attempt (0-5). Set 0 to disable retries. When retry is omitted, the gateway retries twice.
11
11
  */
12
12
  count: number;
13
13
  /**
14
- * HTTP status codes that trigger retry logic.
14
+ * HTTP status codes that trigger a retry. Defaults to [408, 429, 500, 502, 503, 504, 529].
15
15
  */
16
- onCodes: Array<number> | null;
16
+ onCodes?: Array<number> | null | undefined;
17
17
  };
18
18
 
19
19
  /** @internal */
20
20
  export type EmbeddingRetryConfig$Outbound = {
21
21
  count: number;
22
- on_codes: Array<number> | null;
22
+ on_codes?: Array<number> | null | undefined;
23
23
  };
24
24
 
25
25
  /** @internal */
@@ -29,7 +29,7 @@ export const EmbeddingRetryConfig$outboundSchema: z.ZodType<
29
29
  EmbeddingRetryConfig
30
30
  > = z.object({
31
31
  count: z.number().int(),
32
- onCodes: z.nullable(z.array(z.number().int())),
32
+ onCodes: z.nullable(z.array(z.number().int())).optional(),
33
33
  }).transform((v) => {
34
34
  return remap$(v, {
35
35
  onCodes: "on_codes",
@@ -0,0 +1,42 @@
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
+
8
+ export type EvaluatorCallTimeout = {
9
+ /**
10
+ * Maximum milliseconds per provider attempt (or execution for non-LLM evaluators).
11
+ *
12
+ * @remarks
13
+ * Omitted uses the server default (120000). The server caps each invocation at ten minutes.
14
+ */
15
+ callTimeout?: number | undefined;
16
+ };
17
+
18
+ /** @internal */
19
+ export type EvaluatorCallTimeout$Outbound = {
20
+ call_timeout?: number | undefined;
21
+ };
22
+
23
+ /** @internal */
24
+ export const EvaluatorCallTimeout$outboundSchema: z.ZodType<
25
+ EvaluatorCallTimeout$Outbound,
26
+ z.ZodTypeDef,
27
+ EvaluatorCallTimeout
28
+ > = z.object({
29
+ callTimeout: z.number().int().optional(),
30
+ }).transform((v) => {
31
+ return remap$(v, {
32
+ callTimeout: "call_timeout",
33
+ });
34
+ });
35
+
36
+ export function evaluatorCallTimeoutToJSON(
37
+ evaluatorCallTimeout: EvaluatorCallTimeout,
38
+ ): string {
39
+ return JSON.stringify(
40
+ EvaluatorCallTimeout$outboundSchema.parse(evaluatorCallTimeout),
41
+ );
42
+ }
@@ -0,0 +1,45 @@
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
+
8
+ export type EvaluatorRetryConfig = {
9
+ /**
10
+ * Retries after the first attempt. Zero disables retries; omitted retry preserves existing policy.
11
+ */
12
+ count?: number | undefined;
13
+ /**
14
+ * Omitted uses the gateway's default transient status codes.
15
+ */
16
+ onCodes?: Array<number> | undefined;
17
+ };
18
+
19
+ /** @internal */
20
+ export type EvaluatorRetryConfig$Outbound = {
21
+ count?: number | undefined;
22
+ on_codes?: Array<number> | undefined;
23
+ };
24
+
25
+ /** @internal */
26
+ export const EvaluatorRetryConfig$outboundSchema: z.ZodType<
27
+ EvaluatorRetryConfig$Outbound,
28
+ z.ZodTypeDef,
29
+ EvaluatorRetryConfig
30
+ > = z.object({
31
+ count: z.number().int().optional(),
32
+ onCodes: z.array(z.number().int()).optional(),
33
+ }).transform((v) => {
34
+ return remap$(v, {
35
+ onCodes: "on_codes",
36
+ });
37
+ });
38
+
39
+ export function evaluatorRetryConfigToJSON(
40
+ evaluatorRetryConfig: EvaluatorRetryConfig,
41
+ ): string {
42
+ return JSON.stringify(
43
+ EvaluatorRetryConfig$outboundSchema.parse(evaluatorRetryConfig),
44
+ );
45
+ }
@@ -229,6 +229,7 @@ export * from "./errorpart.js";
229
229
  export * from "./errorstreamingevent.js";
230
230
  export * from "./evaluationcontext.js";
231
231
  export * from "./evaluationresult.js";
232
+ export * from "./evaluatorcalltimeout.js";
232
233
  export * from "./evaluatorfilter.js";
233
234
  export * from "./evaluatorref.js";
234
235
  export * from "./evaluatorresponsefunction.js";
@@ -238,6 +239,7 @@ export * from "./evaluatorresponsellm.js";
238
239
  export * from "./evaluatorresponsepython.js";
239
240
  export * from "./evaluatorresponseragas.js";
240
241
  export * from "./evaluatorresponsetypescript.js";
242
+ export * from "./evaluatorretryconfig.js";
241
243
  export * from "./executionnamedstreamingevent.js";
242
244
  export * from "./executionreviewedstreamingevent.js";
243
245
  export * from "./executionreviewrequiredstreamingevent.js";
@@ -8,6 +8,16 @@ import {
8
8
  EvaluationContext$Outbound,
9
9
  EvaluationContext$outboundSchema,
10
10
  } from "./evaluationcontext.js";
11
+ import {
12
+ EvaluatorCallTimeout,
13
+ EvaluatorCallTimeout$Outbound,
14
+ EvaluatorCallTimeout$outboundSchema,
15
+ } from "./evaluatorcalltimeout.js";
16
+ import {
17
+ EvaluatorRetryConfig,
18
+ EvaluatorRetryConfig$Outbound,
19
+ EvaluatorRetryConfig$outboundSchema,
20
+ } from "./evaluatorretryconfig.js";
11
21
 
12
22
  /**
13
23
  * Accepts two shapes. `context` names its fields after the template variables
@@ -71,6 +81,11 @@ export type InvokeEvaluatorRequest = {
71
81
  * `context.variables`.
72
82
  */
73
83
  variables?: { [k: string]: any } | undefined;
84
+ /**
85
+ * Overrides llm_eval provider retries for this invocation, including every jury judge.
86
+ */
87
+ retry?: EvaluatorRetryConfig | undefined;
88
+ timeout?: EvaluatorCallTimeout | undefined;
74
89
  };
75
90
 
76
91
  /** @internal */
@@ -83,6 +98,8 @@ export type InvokeEvaluatorRequest$Outbound = {
83
98
  retrievals?: Array<string> | undefined;
84
99
  messages?: Array<{ [k: string]: any }> | undefined;
85
100
  variables?: { [k: string]: any } | undefined;
101
+ retry?: EvaluatorRetryConfig$Outbound | undefined;
102
+ timeout?: EvaluatorCallTimeout$Outbound | undefined;
86
103
  };
87
104
 
88
105
  /** @internal */
@@ -99,6 +116,8 @@ export const InvokeEvaluatorRequest$outboundSchema: z.ZodType<
99
116
  retrievals: z.array(z.string()).optional(),
100
117
  messages: z.array(z.record(z.any())).optional(),
101
118
  variables: z.record(z.any()).optional(),
119
+ retry: EvaluatorRetryConfig$outboundSchema.optional(),
120
+ timeout: EvaluatorCallTimeout$outboundSchema.optional(),
102
121
  });
103
122
 
104
123
  export function invokeEvaluatorRequestToJSON(
@@ -3,17 +3,39 @@
3
3
  */
4
4
 
5
5
  import * as z from "zod/v3";
6
+ import { ClosedEnum } from "../../types/enums.js";
6
7
  import {
7
8
  LoadBalancerModelConfig,
8
9
  LoadBalancerModelConfig$Outbound,
9
10
  LoadBalancerModelConfig$outboundSchema,
10
11
  } from "./loadbalancermodelconfig.js";
11
12
 
13
+ /**
14
+ * Strategy used to pick a model: weight_based splits traffic by weight, round_robin rotates through the list, latency_based favors the fastest model. An unrecognized value falls back to weight_based.
15
+ */
16
+ export const LoadBalancerConfigType = {
17
+ WeightBased: "weight_based",
18
+ RoundRobin: "round_robin",
19
+ LatencyBased: "latency_based",
20
+ } as const;
21
+ /**
22
+ * Strategy used to pick a model: weight_based splits traffic by weight, round_robin rotates through the list, latency_based favors the fastest model. An unrecognized value falls back to weight_based.
23
+ */
24
+ export type LoadBalancerConfigType = ClosedEnum<typeof LoadBalancerConfigType>;
25
+
12
26
  export type LoadBalancerConfig = {
13
27
  models: Array<LoadBalancerModelConfig> | null;
14
- type: string;
28
+ /**
29
+ * Strategy used to pick a model: weight_based splits traffic by weight, round_robin rotates through the list, latency_based favors the fastest model. An unrecognized value falls back to weight_based.
30
+ */
31
+ type: LoadBalancerConfigType;
15
32
  };
16
33
 
34
+ /** @internal */
35
+ export const LoadBalancerConfigType$outboundSchema: z.ZodNativeEnum<
36
+ typeof LoadBalancerConfigType
37
+ > = z.nativeEnum(LoadBalancerConfigType);
38
+
17
39
  /** @internal */
18
40
  export type LoadBalancerConfig$Outbound = {
19
41
  models: Array<LoadBalancerModelConfig$Outbound> | null;
@@ -27,7 +49,7 @@ export const LoadBalancerConfig$outboundSchema: z.ZodType<
27
49
  LoadBalancerConfig
28
50
  > = z.object({
29
51
  models: z.nullable(z.array(LoadBalancerModelConfig$outboundSchema)),
30
- type: z.string(),
52
+ type: LoadBalancerConfigType$outboundSchema,
31
53
  });
32
54
 
33
55
  export function loadBalancerConfigToJSON(
@@ -8,6 +8,13 @@ import { ClosedEnum } from "../../types/enums.js";
8
8
  import { Result as SafeParseResult } from "../../types/fp.js";
9
9
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
10
 
11
+ export const ReasoningContext = {
12
+ Auto: "auto",
13
+ CurrentTurn: "current_turn",
14
+ AllTurns: "all_turns",
15
+ } as const;
16
+ export type ReasoningContext = ClosedEnum<typeof ReasoningContext>;
17
+
11
18
  /**
12
19
  * Constrains effort on reasoning for reasoning models. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.
13
20
  */
@@ -40,6 +47,7 @@ export const ReasoningSummary = {
40
47
  export type ReasoningSummary = ClosedEnum<typeof ReasoningSummary>;
41
48
 
42
49
  export type Reasoning = {
50
+ context?: ReasoningContext | undefined;
43
51
  /**
44
52
  * Constrains effort on reasoning for reasoning models. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.
45
53
  */
@@ -50,6 +58,11 @@ export type Reasoning = {
50
58
  summary?: ReasoningSummary | null | undefined;
51
59
  };
52
60
 
61
+ /** @internal */
62
+ export const ReasoningContext$inboundSchema: z.ZodNativeEnum<
63
+ typeof ReasoningContext
64
+ > = z.nativeEnum(ReasoningContext);
65
+
53
66
  /** @internal */
54
67
  export const ReasoningEffort1$inboundSchema: z.ZodNativeEnum<
55
68
  typeof ReasoningEffort1
@@ -66,6 +79,7 @@ export const Reasoning$inboundSchema: z.ZodType<
66
79
  z.ZodTypeDef,
67
80
  unknown
68
81
  > = z.object({
82
+ context: ReasoningContext$inboundSchema.optional(),
69
83
  effort: ReasoningEffort1$inboundSchema.optional(),
70
84
  summary: z.nullable(ReasoningSummary$inboundSchema).optional(),
71
85
  });
@@ -5,6 +5,13 @@
5
5
  import * as z from "zod/v3";
6
6
  import { ClosedEnum } from "../../types/enums.js";
7
7
 
8
+ export const Context = {
9
+ Auto: "auto",
10
+ CurrentTurn: "current_turn",
11
+ AllTurns: "all_turns",
12
+ } as const;
13
+ export type Context = ClosedEnum<typeof Context>;
14
+
8
15
  /**
9
16
  * Constrains effort on reasoning for reasoning models. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.
10
17
  */
@@ -37,6 +44,7 @@ export const Summary = {
37
44
  export type Summary = ClosedEnum<typeof Summary>;
38
45
 
39
46
  export type ReasoningParam = {
47
+ context?: Context | undefined;
40
48
  /**
41
49
  * Constrains effort on reasoning for reasoning models. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.
42
50
  */
@@ -47,6 +55,10 @@ export type ReasoningParam = {
47
55
  summary?: Summary | undefined;
48
56
  };
49
57
 
58
+ /** @internal */
59
+ export const Context$outboundSchema: z.ZodNativeEnum<typeof Context> = z
60
+ .nativeEnum(Context);
61
+
50
62
  /** @internal */
51
63
  export const Effort$outboundSchema: z.ZodNativeEnum<typeof Effort> = z
52
64
  .nativeEnum(Effort);
@@ -57,6 +69,7 @@ export const Summary$outboundSchema: z.ZodNativeEnum<typeof Summary> = z
57
69
 
58
70
  /** @internal */
59
71
  export type ReasoningParam$Outbound = {
72
+ context?: string | undefined;
60
73
  effort?: string | undefined;
61
74
  summary?: string | undefined;
62
75
  };
@@ -67,6 +80,7 @@ export const ReasoningParam$outboundSchema: z.ZodType<
67
80
  z.ZodTypeDef,
68
81
  ReasoningParam
69
82
  > = z.object({
83
+ context: Context$outboundSchema.optional(),
70
84
  effort: Effort$outboundSchema.optional(),
71
85
  summary: Summary$outboundSchema.optional(),
72
86
  });
@@ -40,7 +40,7 @@ export const ReasoningPart$inboundSchema: z.ZodType<
40
40
  z.ZodTypeDef,
41
41
  unknown
42
42
  > = z.object({
43
- _id: z.string().default("reasoning_01m5jntmgpwj9ht0xew9c2r8f8"),
43
+ _id: z.string().default("reasoning_01m5mn8fxtbj443d19mf32g7sx"),
44
44
  metadata: z.record(z.any()).optional(),
45
45
  kind: z.literal("reasoning"),
46
46
  reasoning: z.string(),
@@ -7,19 +7,19 @@ import { remap as remap$ } from "../../lib/primitives.js";
7
7
 
8
8
  export type ResponseRetryConfig = {
9
9
  /**
10
- * Number of retries (1-5).
10
+ * Number of retries per model after the initial attempt (0-5). Set 0 to disable retries. When retry is omitted, the gateway retries twice.
11
11
  */
12
12
  count: number;
13
13
  /**
14
- * HTTP status codes that trigger a retry (e.g. [429, 500, 502, 503]).
14
+ * HTTP status codes that trigger a retry. Defaults to [408, 429, 500, 502, 503, 504, 529].
15
15
  */
16
- onCodes: Array<number> | null;
16
+ onCodes?: Array<number> | null | undefined;
17
17
  };
18
18
 
19
19
  /** @internal */
20
20
  export type ResponseRetryConfig$Outbound = {
21
21
  count: number;
22
- on_codes: Array<number> | null;
22
+ on_codes?: Array<number> | null | undefined;
23
23
  };
24
24
 
25
25
  /** @internal */
@@ -29,7 +29,7 @@ export const ResponseRetryConfig$outboundSchema: z.ZodType<
29
29
  ResponseRetryConfig
30
30
  > = z.object({
31
31
  count: z.number().int(),
32
- onCodes: z.nullable(z.array(z.number().int())),
32
+ onCodes: z.nullable(z.array(z.number().int())).optional(),
33
33
  }).transform((v) => {
34
34
  return remap$(v, {
35
35
  onCodes: "on_codes",
@@ -1575,7 +1575,7 @@ export const ResponseBodyCodeExecutionTool$inboundSchema: z.ZodType<
1575
1575
  z.ZodTypeDef,
1576
1576
  unknown
1577
1577
  > = z.object({
1578
- _id: z.string().default("tool_01M5JNTMNEHPDNPC4X0GD3R2C4"),
1578
+ _id: z.string().default("tool_01M5MN8G2HJAEXH0DAM23CJQ37"),
1579
1579
  path: z.string(),
1580
1580
  key: z.string(),
1581
1581
  display_name: z.string().optional(),
@@ -1761,7 +1761,7 @@ export const ResponseBodyHTTPTool$inboundSchema: z.ZodType<
1761
1761
  z.ZodTypeDef,
1762
1762
  unknown
1763
1763
  > = z.object({
1764
- _id: z.string().default("tool_01M5JNTMND1QD0XXWHAJAD4NVK"),
1764
+ _id: z.string().default("tool_01M5MN8G2G2MJPR0NEX04B744B"),
1765
1765
  path: z.string(),
1766
1766
  key: z.string(),
1767
1767
  display_name: z.string().optional(),
@@ -1854,7 +1854,7 @@ export const ResponseBodyJSONSchemaTool$inboundSchema: z.ZodType<
1854
1854
  z.ZodTypeDef,
1855
1855
  unknown
1856
1856
  > = z.object({
1857
- _id: z.string().default("tool_01M5JNTMNC5HHKXE777R9G60KK"),
1857
+ _id: z.string().default("tool_01M5MN8G2F5SQEQGBECXHMJXZM"),
1858
1858
  path: z.string(),
1859
1859
  key: z.string(),
1860
1860
  display_name: z.string().optional(),
@@ -1955,7 +1955,7 @@ export const ResponseBodyFunctionTool$inboundSchema: z.ZodType<
1955
1955
  z.ZodTypeDef,
1956
1956
  unknown
1957
1957
  > = z.object({
1958
- _id: z.string().default("tool_01M5JNTMNBSGVQ7Z9W1HQKCFBF"),
1958
+ _id: z.string().default("tool_01M5MN8G2ES354BQE3EYTYRYNE"),
1959
1959
  path: z.string(),
1960
1960
  key: z.string(),
1961
1961
  display_name: z.string().optional(),
@@ -639,7 +639,7 @@ export const DataCodeExecutionTool$inboundSchema: z.ZodType<
639
639
  z.ZodTypeDef,
640
640
  unknown
641
641
  > = z.object({
642
- _id: z.string().default("tool_01M5JNTMN6MNB0EE7H58GQM8CM"),
642
+ _id: z.string().default("tool_01M5MN8G2AB3FA661Q94H5RPRQ"),
643
643
  path: z.string(),
644
644
  key: z.string(),
645
645
  display_name: z.string().optional(),
@@ -821,7 +821,7 @@ export const DataHTTPTool$inboundSchema: z.ZodType<
821
821
  z.ZodTypeDef,
822
822
  unknown
823
823
  > = z.object({
824
- _id: z.string().default("tool_01M5JNTMN5R65P08ZH4DT1ACWD"),
824
+ _id: z.string().default("tool_01M5MN8G28ZSRSE39T51Q8ES7K"),
825
825
  path: z.string(),
826
826
  key: z.string(),
827
827
  display_name: z.string().optional(),
@@ -914,7 +914,7 @@ export const DataJSONSchemaTool$inboundSchema: z.ZodType<
914
914
  z.ZodTypeDef,
915
915
  unknown
916
916
  > = z.object({
917
- _id: z.string().default("tool_01M5JNTMN4MCEB5ARHKRQ62WFE"),
917
+ _id: z.string().default("tool_01M5MN8G28GC8W7YAZ96MB1N51"),
918
918
  path: z.string(),
919
919
  key: z.string(),
920
920
  display_name: z.string().optional(),
@@ -1012,7 +1012,7 @@ export const DataFunctionTool$inboundSchema: z.ZodType<
1012
1012
  z.ZodTypeDef,
1013
1013
  unknown
1014
1014
  > = z.object({
1015
- _id: z.string().default("tool_01M5JNTMN369D53FJGX3HYJRGK"),
1015
+ _id: z.string().default("tool_01M5MN8G27NTDRFDGHT4E5C7R0"),
1016
1016
  path: z.string(),
1017
1017
  key: z.string(),
1018
1018
  display_name: z.string().optional(),
@@ -140,7 +140,7 @@ export const GetV2HumanEvalSetsResponseBody2$inboundSchema: z.ZodType<
140
140
  created: z.string().datetime({ offset: true }).transform(v => new Date(v))
141
141
  .optional(),
142
142
  updated: z.string().datetime({ offset: true }).default(
143
- "2026-10-22T20:46:09.166Z",
143
+ "2026-10-23T15:14:43.538Z",
144
144
  ).transform(v => new Date(v)),
145
145
  filter_type: z.literal("name"),
146
146
  filter_value: z.string(),
@@ -185,7 +185,7 @@ export const GetV2HumanEvalSetsResponseBody1$inboundSchema: z.ZodType<
185
185
  created: z.string().datetime({ offset: true }).transform(v => new Date(v))
186
186
  .optional(),
187
187
  updated: z.string().datetime({ offset: true }).default(
188
- "2026-10-22T20:46:09.166Z",
188
+ "2026-10-23T15:14:43.538Z",
189
189
  ).transform(v => new Date(v)),
190
190
  filter_type: z.literal("span_type"),
191
191
  filter_values: z.array(z.string()),