@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.
- package/README.md +68 -52
- package/funcs/routerClassifyCreate.d.ts +2 -2
- package/funcs/routerClassifyCreate.d.ts.map +1 -1
- package/funcs/routerClassifyCreate.js +2 -2
- package/funcs/routerClassifyCreate.js.map +1 -1
- package/funcs/routerDecisionsCreate.d.ts +18 -0
- package/funcs/routerDecisionsCreate.d.ts.map +1 -0
- package/funcs/routerDecisionsCreate.js +123 -0
- package/funcs/routerDecisionsCreate.js.map +1 -0
- package/jsr.json +1 -1
- package/lib/config.d.ts +2 -2
- package/lib/config.js +2 -2
- package/models/components/classifyanswer.d.ts +6 -47
- package/models/components/classifyanswer.d.ts.map +1 -1
- package/models/components/classifyanswer.js +11 -20
- package/models/components/classifyanswer.js.map +1 -1
- package/models/components/classifychoiceanswer.d.ts +24 -0
- package/models/components/classifychoiceanswer.d.ts.map +1 -0
- package/models/components/classifychoiceanswer.js +53 -0
- package/models/components/classifychoiceanswer.js.map +1 -0
- package/models/components/classifyinputtokensdetails.d.ts +17 -0
- package/models/components/classifyinputtokensdetails.d.ts.map +1 -0
- package/models/components/classifyinputtokensdetails.js +57 -0
- package/models/components/classifyinputtokensdetails.js.map +1 -0
- package/models/components/classifynoulanswer.d.ts +14 -0
- package/models/components/classifynoulanswer.d.ts.map +1 -0
- package/models/components/classifynoulanswer.js +51 -0
- package/models/components/classifynoulanswer.js.map +1 -0
- package/models/components/classifyrefusalanswer.d.ts +10 -0
- package/models/components/classifyrefusalanswer.d.ts.map +1 -0
- package/models/components/classifyrefusalanswer.js +50 -0
- package/models/components/classifyrefusalanswer.js.map +1 -0
- package/models/components/classifyretryconfig.d.ts +4 -4
- package/models/components/classifyretryconfig.d.ts.map +1 -1
- package/models/components/classifyretryconfig.js +1 -1
- package/models/components/classifyretryconfig.js.map +1 -1
- package/models/components/classifyscoreanswer.d.ts +30 -0
- package/models/components/classifyscoreanswer.d.ts.map +1 -0
- package/models/components/classifyscoreanswer.js +54 -0
- package/models/components/classifyscoreanswer.js.map +1 -0
- package/models/components/classifyusage.d.ts +4 -2
- package/models/components/classifyusage.d.ts.map +1 -1
- package/models/components/classifyusage.js +3 -0
- package/models/components/classifyusage.js.map +1 -1
- package/models/components/index.d.ts +5 -0
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +5 -0
- package/models/components/index.js.map +1 -1
- package/models/components/model.d.ts +4 -0
- package/models/components/model.d.ts.map +1 -1
- package/models/components/model.js +1 -0
- package/models/components/model.js.map +1 -1
- package/models/components/modelmetadata.d.ts +2 -0
- package/models/components/modelmetadata.d.ts.map +1 -1
- package/models/components/modelmetadata.js +4 -0
- package/models/components/modelmetadata.js.map +1 -1
- package/models/components/reasoningpart.js +1 -1
- package/models/errors/createclassify.d.ts +90 -6
- package/models/errors/createclassify.d.ts.map +1 -1
- package/models/errors/createclassify.js +116 -4
- package/models/errors/createclassify.js.map +1 -1
- package/models/errors/createdecisions.d.ts +151 -0
- package/models/errors/createdecisions.d.ts.map +1 -0
- package/models/errors/createdecisions.js +239 -0
- package/models/errors/createdecisions.js.map +1 -0
- package/models/errors/index.d.ts +1 -0
- package/models/errors/index.d.ts.map +1 -1
- package/models/errors/index.js +1 -0
- package/models/errors/index.js.map +1 -1
- package/models/operations/createclassify.d.ts +9 -4
- package/models/operations/createclassify.d.ts.map +1 -1
- package/models/operations/createclassify.js +2 -0
- package/models/operations/createclassify.js.map +1 -1
- package/models/operations/createdecisions.d.ts +237 -0
- package/models/operations/createdecisions.d.ts.map +1 -0
- package/models/operations/createdecisions.js +148 -0
- package/models/operations/createdecisions.js.map +1 -0
- package/models/operations/createtool.js +4 -4
- package/models/operations/getalltools.js +4 -4
- package/models/operations/getv2humanevalsets.js +2 -2
- package/models/operations/getv2humanevalsetsid.js +2 -2
- package/models/operations/index.d.ts +1 -0
- package/models/operations/index.d.ts.map +1 -1
- package/models/operations/index.js +1 -0
- package/models/operations/index.js.map +1 -1
- package/models/operations/patchv2humanevalsetsid.js +2 -2
- package/models/operations/postv2feedbackevaluation.js +4 -4
- package/models/operations/postv2humanevalsets.js +2 -2
- package/models/operations/retrievetool.js +4 -4
- package/models/operations/runagent.js +1 -1
- package/models/operations/streamrunagent.js +1 -1
- package/models/operations/updatetool.js +4 -4
- package/package.json +3 -3
- package/sdk/classify.d.ts +1 -1
- package/sdk/classify.js +1 -1
- package/sdk/decisions.d.ts +12 -0
- package/sdk/decisions.d.ts.map +1 -0
- package/sdk/decisions.js +22 -0
- package/sdk/decisions.js.map +1 -0
- package/sdk/router.d.ts +3 -0
- package/sdk/router.d.ts.map +1 -1
- package/sdk/router.js +4 -0
- package/sdk/router.js.map +1 -1
- package/src/funcs/routerClassifyCreate.ts +31 -3
- package/src/funcs/routerDecisionsCreate.ts +218 -0
- package/src/lib/config.ts +2 -2
- package/src/models/components/classifyanswer.ts +28 -56
- package/src/models/components/classifychoiceanswer.ts +46 -0
- package/src/models/components/classifyinputtokensdetails.ts +45 -0
- package/src/models/components/classifynoulanswer.ts +36 -0
- package/src/models/components/classifyrefusalanswer.ts +31 -0
- package/src/models/components/classifyretryconfig.ts +5 -5
- package/src/models/components/classifyscoreanswer.ts +51 -0
- package/src/models/components/classifyusage.ts +9 -2
- package/src/models/components/index.ts +5 -0
- package/src/models/components/model.ts +5 -0
- package/src/models/components/modelmetadata.ts +6 -0
- package/src/models/components/reasoningpart.ts +1 -1
- package/src/models/errors/createclassify.ts +214 -6
- package/src/models/errors/createdecisions.ts +363 -0
- package/src/models/errors/index.ts +1 -0
- package/src/models/operations/createclassify.ts +11 -4
- package/src/models/operations/createdecisions.ts +434 -0
- package/src/models/operations/createtool.ts +4 -4
- package/src/models/operations/getalltools.ts +4 -4
- package/src/models/operations/getv2humanevalsets.ts +2 -2
- package/src/models/operations/getv2humanevalsetsid.ts +2 -2
- package/src/models/operations/index.ts +1 -0
- package/src/models/operations/patchv2humanevalsetsid.ts +2 -2
- package/src/models/operations/postv2feedbackevaluation.ts +4 -4
- package/src/models/operations/postv2humanevalsets.ts +2 -2
- package/src/models/operations/retrievetool.ts +4 -4
- package/src/models/operations/runagent.ts +1 -1
- package/src/models/operations/streamrunagent.ts +1 -1
- package/src/models/operations/updatetool.ts +4 -4
- package/src/sdk/classify.ts +1 -1
- package/src/sdk/decisions.ts +27 -0
- package/src/sdk/router.ts +6 -0
|
@@ -96,7 +96,7 @@ exports.RequestBody4$outboundSchema = z.object({
|
|
|
96
96
|
source: exports.PostV2FeedbackEvaluationRequestBodyFeedbackRequestSource$outboundSchema
|
|
97
97
|
.default("orq"),
|
|
98
98
|
explanation: z.string().optional(),
|
|
99
|
-
reviewedAt: z.date().default(() => new Date("2026-10-
|
|
99
|
+
reviewedAt: z.date().default(() => new Date("2026-10-07T09:10:48.342Z"))
|
|
100
100
|
.transform(v => v.toISOString()),
|
|
101
101
|
type: z.literal("string_array"),
|
|
102
102
|
values: z.array(z.string()),
|
|
@@ -126,7 +126,7 @@ exports.Three$outboundSchema = z.object({
|
|
|
126
126
|
source: exports.PostV2FeedbackEvaluationRequestBodyFeedbackSource$outboundSchema
|
|
127
127
|
.default("orq"),
|
|
128
128
|
explanation: z.string().optional(),
|
|
129
|
-
reviewedAt: z.date().default(() => new Date("2026-10-
|
|
129
|
+
reviewedAt: z.date().default(() => new Date("2026-10-07T09:10:48.342Z"))
|
|
130
130
|
.transform(v => v.toISOString()),
|
|
131
131
|
type: z.literal("boolean"),
|
|
132
132
|
value: z.boolean(),
|
|
@@ -154,7 +154,7 @@ exports.RequestBody2$outboundSchema = z.object({
|
|
|
154
154
|
humanReviewId: z.string().optional(),
|
|
155
155
|
source: exports.PostV2FeedbackEvaluationRequestBodySource$outboundSchema.default("orq"),
|
|
156
156
|
explanation: z.string().optional(),
|
|
157
|
-
reviewedAt: z.date().default(() => new Date("2026-10-
|
|
157
|
+
reviewedAt: z.date().default(() => new Date("2026-10-07T09:10:48.341Z"))
|
|
158
158
|
.transform(v => v.toISOString()),
|
|
159
159
|
type: z.literal("number"),
|
|
160
160
|
value: z.number(),
|
|
@@ -181,7 +181,7 @@ exports.RequestBody1$outboundSchema = z.object({
|
|
|
181
181
|
humanReviewId: z.string().optional(),
|
|
182
182
|
source: exports.RequestBodySource$outboundSchema.default("orq"),
|
|
183
183
|
explanation: z.string().optional(),
|
|
184
|
-
reviewedAt: z.date().default(() => new Date("2026-10-
|
|
184
|
+
reviewedAt: z.date().default(() => new Date("2026-10-07T09:10:48.341Z"))
|
|
185
185
|
.transform(v => v.toISOString()),
|
|
186
186
|
type: z.literal("string"),
|
|
187
187
|
value: z.string(),
|
|
@@ -106,7 +106,7 @@ exports.PostV2HumanEvalSetsResponseBody2$inboundSchema = z.object({
|
|
|
106
106
|
updated_by_id: z.string().optional(),
|
|
107
107
|
created: z.string().datetime({ offset: true }).transform(v => new Date(v))
|
|
108
108
|
.optional(),
|
|
109
|
-
updated: z.string().datetime({ offset: true }).default("2026-10-
|
|
109
|
+
updated: z.string().datetime({ offset: true }).default("2026-10-07T09:10:41.835Z").transform(v => new Date(v)),
|
|
110
110
|
filter_type: z.literal("name"),
|
|
111
111
|
filter_value: z.string(),
|
|
112
112
|
}).transform((v) => {
|
|
@@ -137,7 +137,7 @@ exports.PostV2HumanEvalSetsResponseBody1$inboundSchema = z.object({
|
|
|
137
137
|
updated_by_id: z.string().optional(),
|
|
138
138
|
created: z.string().datetime({ offset: true }).transform(v => new Date(v))
|
|
139
139
|
.optional(),
|
|
140
|
-
updated: z.string().datetime({ offset: true }).default("2026-10-
|
|
140
|
+
updated: z.string().datetime({ offset: true }).default("2026-10-07T09:10:41.835Z").transform(v => new Date(v)),
|
|
141
141
|
filter_type: z.literal("span_type"),
|
|
142
142
|
filter_values: z.array(z.string()),
|
|
143
143
|
}).transform((v) => {
|
|
@@ -164,7 +164,7 @@ function retrieveToolResponseBodyCodeToolFromJSON(jsonString) {
|
|
|
164
164
|
}
|
|
165
165
|
/** @internal */
|
|
166
166
|
exports.RetrieveToolResponseBodyCodeExecutionTool$inboundSchema = z.object({
|
|
167
|
-
_id: z.string().default("
|
|
167
|
+
_id: z.string().default("tool_01M4AT2CQNC99M1NPTPME1BYYZ"),
|
|
168
168
|
path: z.string(),
|
|
169
169
|
key: z.string(),
|
|
170
170
|
display_name: z.string().optional(),
|
|
@@ -253,7 +253,7 @@ function retrieveToolResponseBodyHttpFromJSON(jsonString) {
|
|
|
253
253
|
}
|
|
254
254
|
/** @internal */
|
|
255
255
|
exports.RetrieveToolResponseBodyHTTPTool$inboundSchema = z.object({
|
|
256
|
-
_id: z.string().default("
|
|
256
|
+
_id: z.string().default("tool_01M4AT2CQM8NKGGMN0J5N977TM"),
|
|
257
257
|
path: z.string(),
|
|
258
258
|
key: z.string(),
|
|
259
259
|
display_name: z.string().optional(),
|
|
@@ -303,7 +303,7 @@ function retrieveToolResponseBodyJsonSchemaFromJSON(jsonString) {
|
|
|
303
303
|
}
|
|
304
304
|
/** @internal */
|
|
305
305
|
exports.RetrieveToolResponseBodyJSONSchemaTool$inboundSchema = z.object({
|
|
306
|
-
_id: z.string().default("
|
|
306
|
+
_id: z.string().default("tool_01M4AT2CQMQ4DYK75CT7EX9821"),
|
|
307
307
|
path: z.string(),
|
|
308
308
|
key: z.string(),
|
|
309
309
|
display_name: z.string().optional(),
|
|
@@ -357,7 +357,7 @@ function retrieveToolResponseBodyFunctionFromJSON(jsonString) {
|
|
|
357
357
|
}
|
|
358
358
|
/** @internal */
|
|
359
359
|
exports.RetrieveToolResponseBodyFunctionTool$inboundSchema = z.object({
|
|
360
|
-
_id: z.string().default("
|
|
360
|
+
_id: z.string().default("tool_01M4AT2CQKJKRB7QEDWZVFV147"),
|
|
361
361
|
path: z.string(),
|
|
362
362
|
key: z.string(),
|
|
363
363
|
display_name: z.string().optional(),
|
|
@@ -1098,7 +1098,7 @@ function agentToolInputRunSchemaToJSON(agentToolInputRunSchema) {
|
|
|
1098
1098
|
}
|
|
1099
1099
|
/** @internal */
|
|
1100
1100
|
exports.Tools$outboundSchema = z.object({
|
|
1101
|
-
id: z.string().default("
|
|
1101
|
+
id: z.string().default("01M4AT2CNBT9PFKGDH1KEVSMHA"),
|
|
1102
1102
|
name: z.string(),
|
|
1103
1103
|
description: z.string().optional(),
|
|
1104
1104
|
schema: z.lazy(() => exports.AgentToolInputRunSchema$outboundSchema),
|
|
@@ -1064,7 +1064,7 @@ function streamRunAgentAgentToolInputRunAgentsSchemaToJSON(streamRunAgentAgentTo
|
|
|
1064
1064
|
}
|
|
1065
1065
|
/** @internal */
|
|
1066
1066
|
exports.AgentToolInputRunTools$outboundSchema = z.object({
|
|
1067
|
-
id: z.string().default("
|
|
1067
|
+
id: z.string().default("01M4AT2CNWQ4P3B6C584T0PAZ6"),
|
|
1068
1068
|
name: z.string(),
|
|
1069
1069
|
description: z.string().optional(),
|
|
1070
1070
|
schema: z.lazy(() => exports.StreamRunAgentAgentToolInputRunAgentsSchema$outboundSchema),
|
|
@@ -536,7 +536,7 @@ function updateToolResponseBodyCodeToolFromJSON(jsonString) {
|
|
|
536
536
|
}
|
|
537
537
|
/** @internal */
|
|
538
538
|
exports.UpdateToolResponseBodyCodeExecutionTool$inboundSchema = z.object({
|
|
539
|
-
_id: z.string().default("
|
|
539
|
+
_id: z.string().default("tool_01M4AT2CQDQCBGPWHA2X69DZY7"),
|
|
540
540
|
path: z.string(),
|
|
541
541
|
key: z.string(),
|
|
542
542
|
display_name: z.string().optional(),
|
|
@@ -625,7 +625,7 @@ function updateToolResponseBodyHttpFromJSON(jsonString) {
|
|
|
625
625
|
}
|
|
626
626
|
/** @internal */
|
|
627
627
|
exports.UpdateToolResponseBodyHTTPTool$inboundSchema = z.object({
|
|
628
|
-
_id: z.string().default("
|
|
628
|
+
_id: z.string().default("tool_01M4AT2CQCHG6FXM6PV31K1N54"),
|
|
629
629
|
path: z.string(),
|
|
630
630
|
key: z.string(),
|
|
631
631
|
display_name: z.string().optional(),
|
|
@@ -675,7 +675,7 @@ function updateToolResponseBodyJsonSchemaFromJSON(jsonString) {
|
|
|
675
675
|
}
|
|
676
676
|
/** @internal */
|
|
677
677
|
exports.UpdateToolResponseBodyJSONSchemaTool$inboundSchema = z.object({
|
|
678
|
-
_id: z.string().default("
|
|
678
|
+
_id: z.string().default("tool_01M4AT2CQC76S92CVGNSCR7P45"),
|
|
679
679
|
path: z.string(),
|
|
680
680
|
key: z.string(),
|
|
681
681
|
display_name: z.string().optional(),
|
|
@@ -729,7 +729,7 @@ function updateToolResponseBodyFunctionFromJSON(jsonString) {
|
|
|
729
729
|
}
|
|
730
730
|
/** @internal */
|
|
731
731
|
exports.UpdateToolResponseBodyFunctionTool$inboundSchema = z.object({
|
|
732
|
-
_id: z.string().default("
|
|
732
|
+
_id: z.string().default("tool_01M4AT2CQB6KC0KY5WFFJF3TTX"),
|
|
733
733
|
path: z.string(),
|
|
734
734
|
key: z.string(),
|
|
735
735
|
display_name: z.string().optional(),
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orq-ai/node",
|
|
3
|
-
"version": "4.16.0-rc.
|
|
3
|
+
"version": "4.16.0-rc.58",
|
|
4
4
|
"author": "Orq",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
7
|
+
"types": "./index.d.ts",
|
|
7
8
|
"import": "./index.js",
|
|
8
|
-
"require": "./index.js"
|
|
9
|
-
"types": "./index.d.ts"
|
|
9
|
+
"require": "./index.js"
|
|
10
10
|
},
|
|
11
11
|
"./*": "./*",
|
|
12
12
|
"./langchain": {
|
package/sdk/classify.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export declare class Classify extends ClientSDK {
|
|
|
5
5
|
* Classify
|
|
6
6
|
*
|
|
7
7
|
* @remarks
|
|
8
|
-
* **Beta.** Runs typed classification questions (`noul`, `choice`, `score`) against
|
|
8
|
+
* **Beta.** Runs typed classification questions (`noul`, `choice`, `score`) against a native classify provider, including OpenAI Decisions with `openai/gpt-6-luna`, or a chat model that supports classify emulation. Emulated models answer through one structured-output call and their probabilities are model-reported rather than calibrated. Native providers can return `refusal` for individual questions; refused answers contain only `type`. The request and response follow the TypeSafe classification contract; `model` in the response identifies the primary or fallback model that answered and `usage` carries the computed cost like the Responses API. Both `/v3/router/classify` and `/v3/router/decisions` use this contract, including ordered `fallbacks`, request-level `retry`, and `identity` attribution. Both require `classify.execute`. This endpoint currently does not apply PII plugins or guardrails.
|
|
9
9
|
*/
|
|
10
10
|
create(request: operations.CreateClassifyRequestBody, options?: RequestOptions): Promise<operations.CreateClassifyResponseBody>;
|
|
11
11
|
}
|
package/sdk/classify.js
CHANGED
|
@@ -12,7 +12,7 @@ class Classify extends sdks_js_1.ClientSDK {
|
|
|
12
12
|
* Classify
|
|
13
13
|
*
|
|
14
14
|
* @remarks
|
|
15
|
-
* **Beta.** Runs typed classification questions (`noul`, `choice`, `score`) against
|
|
15
|
+
* **Beta.** Runs typed classification questions (`noul`, `choice`, `score`) against a native classify provider, including OpenAI Decisions with `openai/gpt-6-luna`, or a chat model that supports classify emulation. Emulated models answer through one structured-output call and their probabilities are model-reported rather than calibrated. Native providers can return `refusal` for individual questions; refused answers contain only `type`. The request and response follow the TypeSafe classification contract; `model` in the response identifies the primary or fallback model that answered and `usage` carries the computed cost like the Responses API. Both `/v3/router/classify` and `/v3/router/decisions` use this contract, including ordered `fallbacks`, request-level `retry`, and `identity` attribution. Both require `classify.execute`. This endpoint currently does not apply PII plugins or guardrails.
|
|
16
16
|
*/
|
|
17
17
|
async create(request, options) {
|
|
18
18
|
return (0, fp_js_1.unwrapAsync)((0, routerClassifyCreate_js_1.routerClassifyCreate)(this, request, options));
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
|
|
2
|
+
import * as operations from "../models/operations/index.js";
|
|
3
|
+
export declare class Decisions extends ClientSDK {
|
|
4
|
+
/**
|
|
5
|
+
* Decisions
|
|
6
|
+
*
|
|
7
|
+
* @remarks
|
|
8
|
+
* **Beta.** Runs typed classification questions (`noul`, `choice`, `score`) against a native classify provider, including OpenAI Decisions with `openai/gpt-6-luna`, or a chat model that supports classify emulation. Emulated models answer through one structured-output call and their probabilities are model-reported rather than calibrated. Native providers can return `refusal` for individual questions; refused answers contain only `type`. The request and response follow the TypeSafe classification contract; `model` in the response identifies the primary or fallback model that answered and `usage` carries the computed cost like the Responses API. Both `/v3/router/classify` and `/v3/router/decisions` use this contract, including ordered `fallbacks`, request-level `retry`, and `identity` attribution. Both require `classify.execute`. This endpoint currently does not apply PII plugins or guardrails.
|
|
9
|
+
*/
|
|
10
|
+
create(request: operations.CreateDecisionsRequestBody, options?: RequestOptions): Promise<operations.CreateDecisionsResponseBody>;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=decisions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decisions.d.ts","sourceRoot":"","sources":["../src/sdk/decisions.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAG5D,qBAAa,SAAU,SAAQ,SAAS;IACtC;;;;;OAKG;IACG,MAAM,CACV,OAAO,EAAE,UAAU,CAAC,0BAA0B,EAC9C,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,2BAA2B,CAAC;CAOnD"}
|
package/sdk/decisions.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.Decisions = void 0;
|
|
7
|
+
const routerDecisionsCreate_js_1 = require("../funcs/routerDecisionsCreate.js");
|
|
8
|
+
const sdks_js_1 = require("../lib/sdks.js");
|
|
9
|
+
const fp_js_1 = require("../types/fp.js");
|
|
10
|
+
class Decisions extends sdks_js_1.ClientSDK {
|
|
11
|
+
/**
|
|
12
|
+
* Decisions
|
|
13
|
+
*
|
|
14
|
+
* @remarks
|
|
15
|
+
* **Beta.** Runs typed classification questions (`noul`, `choice`, `score`) against a native classify provider, including OpenAI Decisions with `openai/gpt-6-luna`, or a chat model that supports classify emulation. Emulated models answer through one structured-output call and their probabilities are model-reported rather than calibrated. Native providers can return `refusal` for individual questions; refused answers contain only `type`. The request and response follow the TypeSafe classification contract; `model` in the response identifies the primary or fallback model that answered and `usage` carries the computed cost like the Responses API. Both `/v3/router/classify` and `/v3/router/decisions` use this contract, including ordered `fallbacks`, request-level `retry`, and `identity` attribution. Both require `classify.execute`. This endpoint currently does not apply PII plugins or guardrails.
|
|
16
|
+
*/
|
|
17
|
+
async create(request, options) {
|
|
18
|
+
return (0, fp_js_1.unwrapAsync)((0, routerDecisionsCreate_js_1.routerDecisionsCreate)(this, request, options));
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
exports.Decisions = Decisions;
|
|
22
|
+
//# sourceMappingURL=decisions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decisions.js","sourceRoot":"","sources":["../src/sdk/decisions.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,gFAA0E;AAC1E,4CAA2D;AAE3D,0CAA6C;AAE7C,MAAa,SAAU,SAAQ,mBAAS;IACtC;;;;;OAKG;IACH,KAAK,CAAC,MAAM,CACV,OAA8C,EAC9C,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,gDAAqB,EACtC,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;CACF;AAjBD,8BAiBC"}
|
package/sdk/router.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { Audio } from "./audio.js";
|
|
|
4
4
|
import { Chat } from "./chat.js";
|
|
5
5
|
import { Classify } from "./classify.js";
|
|
6
6
|
import { Completions } from "./completions.js";
|
|
7
|
+
import { Decisions } from "./decisions.js";
|
|
7
8
|
import { Embeddings } from "./embeddings.js";
|
|
8
9
|
import { Images } from "./images.js";
|
|
9
10
|
import { Moderations } from "./moderations.js";
|
|
@@ -25,6 +26,8 @@ export declare class Router extends ClientSDK {
|
|
|
25
26
|
get embeddings(): Embeddings;
|
|
26
27
|
private _classify?;
|
|
27
28
|
get classify(): Classify;
|
|
29
|
+
private _decisions?;
|
|
30
|
+
get decisions(): Decisions;
|
|
28
31
|
/**
|
|
29
32
|
* Extracts text content while maintaining document structure and hierarchy
|
|
30
33
|
*/
|
package/sdk/router.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../src/sdk/router.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAE5D,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,qBAAa,MAAO,SAAQ,SAAS;IACnC,OAAO,CAAC,KAAK,CAAC,CAAO;IACrB,IAAI,IAAI,IAAI,IAAI,CAEf;IAED,OAAO,CAAC,YAAY,CAAC,CAAc;IACnC,IAAI,WAAW,IAAI,WAAW,CAE7B;IAED,OAAO,CAAC,OAAO,CAAC,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O,CAAC,KAAK,CAAC,CAAO;IACrB,IAAI,IAAI,IAAI,IAAI,CAEf;IAED,OAAO,CAAC,YAAY,CAAC,CAAc;IACnC,IAAI,WAAW,IAAI,WAAW,CAE7B;IAED,OAAO,CAAC,OAAO,CAAC,CAAS;IACzB,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED,OAAO,CAAC,MAAM,CAAC,CAAQ;IACvB,IAAI,KAAK,IAAI,KAAK,CAEjB;IAED,OAAO,CAAC,YAAY,CAAC,CAAc;IACnC,IAAI,WAAW,IAAI,WAAW,CAE7B;IAED,OAAO,CAAC,OAAO,CAAC,CAAS;IACzB,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED,OAAO,CAAC,WAAW,CAAC,CAAa;IACjC,IAAI,UAAU,IAAI,UAAU,CAE3B;IAED,OAAO,CAAC,SAAS,CAAC,CAAW;IAC7B,IAAI,QAAQ,IAAI,QAAQ,CAEvB;IAED,OAAO,CAAC,UAAU,CAAC,CAAY;IAC/B,IAAI,SAAS,IAAI,SAAS,CAEzB;IAED;;OAEG;IACG,GAAG,CACP,OAAO,EAAE,UAAU,CAAC,0BAA0B,EAC9C,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,2BAA2B,CAAC;CAOnD"}
|
package/sdk/router.js
CHANGED
|
@@ -11,6 +11,7 @@ const audio_js_1 = require("./audio.js");
|
|
|
11
11
|
const chat_js_1 = require("./chat.js");
|
|
12
12
|
const classify_js_1 = require("./classify.js");
|
|
13
13
|
const completions_js_1 = require("./completions.js");
|
|
14
|
+
const decisions_js_1 = require("./decisions.js");
|
|
14
15
|
const embeddings_js_1 = require("./embeddings.js");
|
|
15
16
|
const images_js_1 = require("./images.js");
|
|
16
17
|
const moderations_js_1 = require("./moderations.js");
|
|
@@ -40,6 +41,9 @@ class Router extends sdks_js_1.ClientSDK {
|
|
|
40
41
|
get classify() {
|
|
41
42
|
return (this._classify ?? (this._classify = new classify_js_1.Classify(this._options)));
|
|
42
43
|
}
|
|
44
|
+
get decisions() {
|
|
45
|
+
return (this._decisions ?? (this._decisions = new decisions_js_1.Decisions(this._options)));
|
|
46
|
+
}
|
|
43
47
|
/**
|
|
44
48
|
* Extracts text content while maintaining document structure and hierarchy
|
|
45
49
|
*/
|
package/sdk/router.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"router.js","sourceRoot":"","sources":["../src/sdk/router.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,wDAAkD;AAClD,4CAA2D;AAE3D,0CAA6C;AAC7C,yCAAmC;AACnC,uCAAiC;AACjC,+CAAyC;AACzC,qDAA+C;AAC/C,mDAA6C;AAC7C,2CAAqC;AACrC,qDAA+C;AAC/C,2CAAqC;AAErC,MAAa,MAAO,SAAQ,mBAAS;IAEnC,IAAI,IAAI;QACN,OAAO,CAAC,IAAI,CAAC,KAAK,KAAV,IAAI,CAAC,KAAK,GAAK,IAAI,cAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAC,CAAC;IAClD,CAAC;IAGD,IAAI,WAAW;QACb,OAAO,CAAC,IAAI,CAAC,YAAY,KAAjB,IAAI,CAAC,YAAY,GAAK,IAAI,4BAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAC,CAAC;IAChE,CAAC;IAGD,IAAI,MAAM;QACR,OAAO,CAAC,IAAI,CAAC,OAAO,KAAZ,IAAI,CAAC,OAAO,GAAK,IAAI,kBAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAC,CAAC;IACtD,CAAC;IAGD,IAAI,KAAK;QACP,OAAO,CAAC,IAAI,CAAC,MAAM,KAAX,IAAI,CAAC,MAAM,GAAK,IAAI,gBAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAC,CAAC;IACpD,CAAC;IAGD,IAAI,WAAW;QACb,OAAO,CAAC,IAAI,CAAC,YAAY,KAAjB,IAAI,CAAC,YAAY,GAAK,IAAI,4BAAW,CAAC,IAAI,CAAC,QAAQ,CA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,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;CACF;AA3DD,wBA2DC"}
|
|
@@ -30,7 +30,7 @@ import { Result } from "../types/fp.js";
|
|
|
30
30
|
* Classify
|
|
31
31
|
*
|
|
32
32
|
* @remarks
|
|
33
|
-
* **Beta.** Runs typed classification questions (`noul`, `choice`, `score`) against
|
|
33
|
+
* **Beta.** Runs typed classification questions (`noul`, `choice`, `score`) against a native classify provider, including OpenAI Decisions with `openai/gpt-6-luna`, or a chat model that supports classify emulation. Emulated models answer through one structured-output call and their probabilities are model-reported rather than calibrated. Native providers can return `refusal` for individual questions; refused answers contain only `type`. The request and response follow the TypeSafe classification contract; `model` in the response identifies the primary or fallback model that answered and `usage` carries the computed cost like the Responses API. Both `/v3/router/classify` and `/v3/router/decisions` use this contract, including ordered `fallbacks`, request-level `retry`, and `identity` attribution. Both require `classify.execute`. This endpoint currently does not apply PII plugins or guardrails.
|
|
34
34
|
*/
|
|
35
35
|
export function routerClassifyCreate(
|
|
36
36
|
client: OrqCore,
|
|
@@ -42,6 +42,10 @@ export function routerClassifyCreate(
|
|
|
42
42
|
| errors.CreateClassifyResponseBody
|
|
43
43
|
| errors.CreateClassifyRouterClassifyResponseBody
|
|
44
44
|
| errors.CreateClassifyRouterClassifyResponseResponseBody
|
|
45
|
+
| errors.CreateClassifyRouterClassifyResponse422ResponseBody
|
|
46
|
+
| errors.CreateClassifyRouterClassifyResponse429ResponseBody
|
|
47
|
+
| errors.CreateClassifyRouterClassifyResponse500ResponseBody
|
|
48
|
+
| errors.CreateClassifyRouterClassifyResponse502ResponseBody
|
|
45
49
|
| OrqError
|
|
46
50
|
| ResponseValidationError
|
|
47
51
|
| ConnectionError
|
|
@@ -70,6 +74,10 @@ async function $do(
|
|
|
70
74
|
| errors.CreateClassifyResponseBody
|
|
71
75
|
| errors.CreateClassifyRouterClassifyResponseBody
|
|
72
76
|
| errors.CreateClassifyRouterClassifyResponseResponseBody
|
|
77
|
+
| errors.CreateClassifyRouterClassifyResponse422ResponseBody
|
|
78
|
+
| errors.CreateClassifyRouterClassifyResponse429ResponseBody
|
|
79
|
+
| errors.CreateClassifyRouterClassifyResponse500ResponseBody
|
|
80
|
+
| errors.CreateClassifyRouterClassifyResponse502ResponseBody
|
|
73
81
|
| OrqError
|
|
74
82
|
| ResponseValidationError
|
|
75
83
|
| ConnectionError
|
|
@@ -155,6 +163,10 @@ async function $do(
|
|
|
155
163
|
| errors.CreateClassifyResponseBody
|
|
156
164
|
| errors.CreateClassifyRouterClassifyResponseBody
|
|
157
165
|
| errors.CreateClassifyRouterClassifyResponseResponseBody
|
|
166
|
+
| errors.CreateClassifyRouterClassifyResponse422ResponseBody
|
|
167
|
+
| errors.CreateClassifyRouterClassifyResponse429ResponseBody
|
|
168
|
+
| errors.CreateClassifyRouterClassifyResponse500ResponseBody
|
|
169
|
+
| errors.CreateClassifyRouterClassifyResponse502ResponseBody
|
|
158
170
|
| OrqError
|
|
159
171
|
| ResponseValidationError
|
|
160
172
|
| ConnectionError
|
|
@@ -167,13 +179,29 @@ async function $do(
|
|
|
167
179
|
M.json(200, operations.CreateClassifyResponseBody$inboundSchema),
|
|
168
180
|
M.jsonErr(400, errors.CreateClassifyResponseBody$inboundSchema),
|
|
169
181
|
M.jsonErr(
|
|
170
|
-
|
|
182
|
+
401,
|
|
171
183
|
errors.CreateClassifyRouterClassifyResponseBody$inboundSchema,
|
|
172
184
|
),
|
|
173
185
|
M.jsonErr(
|
|
174
|
-
|
|
186
|
+
403,
|
|
175
187
|
errors.CreateClassifyRouterClassifyResponseResponseBody$inboundSchema,
|
|
176
188
|
),
|
|
189
|
+
M.jsonErr(
|
|
190
|
+
422,
|
|
191
|
+
errors.CreateClassifyRouterClassifyResponse422ResponseBody$inboundSchema,
|
|
192
|
+
),
|
|
193
|
+
M.jsonErr(
|
|
194
|
+
429,
|
|
195
|
+
errors.CreateClassifyRouterClassifyResponse429ResponseBody$inboundSchema,
|
|
196
|
+
),
|
|
197
|
+
M.jsonErr(
|
|
198
|
+
500,
|
|
199
|
+
errors.CreateClassifyRouterClassifyResponse500ResponseBody$inboundSchema,
|
|
200
|
+
),
|
|
201
|
+
M.jsonErr(
|
|
202
|
+
502,
|
|
203
|
+
errors.CreateClassifyRouterClassifyResponse502ResponseBody$inboundSchema,
|
|
204
|
+
),
|
|
177
205
|
M.fail("4XX"),
|
|
178
206
|
M.fail("5XX"),
|
|
179
207
|
)(response, req, { extraFields: responseFields });
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { OrqCore } from "../core.js";
|
|
6
|
+
import { encodeJSON } from "../lib/encodings.js";
|
|
7
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
8
|
+
import * as M from "../lib/matchers.js";
|
|
9
|
+
import { compactMap } from "../lib/primitives.js";
|
|
10
|
+
import { safeParse } from "../lib/schemas.js";
|
|
11
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
12
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
13
|
+
import { pathToFunc } from "../lib/url.js";
|
|
14
|
+
import {
|
|
15
|
+
ConnectionError,
|
|
16
|
+
InvalidRequestError,
|
|
17
|
+
RequestAbortedError,
|
|
18
|
+
RequestTimeoutError,
|
|
19
|
+
UnexpectedClientError,
|
|
20
|
+
} from "../models/errors/httpclienterrors.js";
|
|
21
|
+
import * as errors from "../models/errors/index.js";
|
|
22
|
+
import { OrqError } from "../models/errors/orqerror.js";
|
|
23
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
24
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
25
|
+
import * as operations from "../models/operations/index.js";
|
|
26
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
27
|
+
import { Result } from "../types/fp.js";
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Decisions
|
|
31
|
+
*
|
|
32
|
+
* @remarks
|
|
33
|
+
* **Beta.** Runs typed classification questions (`noul`, `choice`, `score`) against a native classify provider, including OpenAI Decisions with `openai/gpt-6-luna`, or a chat model that supports classify emulation. Emulated models answer through one structured-output call and their probabilities are model-reported rather than calibrated. Native providers can return `refusal` for individual questions; refused answers contain only `type`. The request and response follow the TypeSafe classification contract; `model` in the response identifies the primary or fallback model that answered and `usage` carries the computed cost like the Responses API. Both `/v3/router/classify` and `/v3/router/decisions` use this contract, including ordered `fallbacks`, request-level `retry`, and `identity` attribution. Both require `classify.execute`. This endpoint currently does not apply PII plugins or guardrails.
|
|
34
|
+
*/
|
|
35
|
+
export function routerDecisionsCreate(
|
|
36
|
+
client: OrqCore,
|
|
37
|
+
request: operations.CreateDecisionsRequestBody,
|
|
38
|
+
options?: RequestOptions,
|
|
39
|
+
): APIPromise<
|
|
40
|
+
Result<
|
|
41
|
+
operations.CreateDecisionsResponseBody,
|
|
42
|
+
| errors.CreateDecisionsResponseBody
|
|
43
|
+
| errors.CreateDecisionsRouterDecisionsResponseBody
|
|
44
|
+
| errors.CreateDecisionsRouterDecisionsResponseResponseBody
|
|
45
|
+
| errors.CreateDecisionsRouterDecisionsResponse422ResponseBody
|
|
46
|
+
| errors.CreateDecisionsRouterDecisionsResponse429ResponseBody
|
|
47
|
+
| errors.CreateDecisionsRouterDecisionsResponse500ResponseBody
|
|
48
|
+
| errors.CreateDecisionsRouterDecisionsResponse502ResponseBody
|
|
49
|
+
| OrqError
|
|
50
|
+
| ResponseValidationError
|
|
51
|
+
| ConnectionError
|
|
52
|
+
| RequestAbortedError
|
|
53
|
+
| RequestTimeoutError
|
|
54
|
+
| InvalidRequestError
|
|
55
|
+
| UnexpectedClientError
|
|
56
|
+
| SDKValidationError
|
|
57
|
+
>
|
|
58
|
+
> {
|
|
59
|
+
return new APIPromise($do(
|
|
60
|
+
client,
|
|
61
|
+
request,
|
|
62
|
+
options,
|
|
63
|
+
));
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
async function $do(
|
|
67
|
+
client: OrqCore,
|
|
68
|
+
request: operations.CreateDecisionsRequestBody,
|
|
69
|
+
options?: RequestOptions,
|
|
70
|
+
): Promise<
|
|
71
|
+
[
|
|
72
|
+
Result<
|
|
73
|
+
operations.CreateDecisionsResponseBody,
|
|
74
|
+
| errors.CreateDecisionsResponseBody
|
|
75
|
+
| errors.CreateDecisionsRouterDecisionsResponseBody
|
|
76
|
+
| errors.CreateDecisionsRouterDecisionsResponseResponseBody
|
|
77
|
+
| errors.CreateDecisionsRouterDecisionsResponse422ResponseBody
|
|
78
|
+
| errors.CreateDecisionsRouterDecisionsResponse429ResponseBody
|
|
79
|
+
| errors.CreateDecisionsRouterDecisionsResponse500ResponseBody
|
|
80
|
+
| errors.CreateDecisionsRouterDecisionsResponse502ResponseBody
|
|
81
|
+
| OrqError
|
|
82
|
+
| ResponseValidationError
|
|
83
|
+
| ConnectionError
|
|
84
|
+
| RequestAbortedError
|
|
85
|
+
| RequestTimeoutError
|
|
86
|
+
| InvalidRequestError
|
|
87
|
+
| UnexpectedClientError
|
|
88
|
+
| SDKValidationError
|
|
89
|
+
>,
|
|
90
|
+
APICall,
|
|
91
|
+
]
|
|
92
|
+
> {
|
|
93
|
+
const parsed = safeParse(
|
|
94
|
+
request,
|
|
95
|
+
(value) =>
|
|
96
|
+
operations.CreateDecisionsRequestBody$outboundSchema.parse(value),
|
|
97
|
+
"Input validation failed",
|
|
98
|
+
);
|
|
99
|
+
if (!parsed.ok) {
|
|
100
|
+
return [parsed, { status: "invalid" }];
|
|
101
|
+
}
|
|
102
|
+
const payload = parsed.value;
|
|
103
|
+
const body = encodeJSON("body", payload, { explode: true });
|
|
104
|
+
|
|
105
|
+
const path = pathToFunc("/v3/router/decisions")();
|
|
106
|
+
|
|
107
|
+
const headers = new Headers(compactMap({
|
|
108
|
+
"Content-Type": "application/json",
|
|
109
|
+
Accept: "application/json",
|
|
110
|
+
}));
|
|
111
|
+
|
|
112
|
+
const secConfig = await extractSecurity(client._options.apiKey);
|
|
113
|
+
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
114
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
115
|
+
|
|
116
|
+
const context = {
|
|
117
|
+
options: client._options,
|
|
118
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
119
|
+
operationID: "CreateDecisions",
|
|
120
|
+
oAuth2Scopes: null,
|
|
121
|
+
|
|
122
|
+
resolvedSecurity: requestSecurity,
|
|
123
|
+
|
|
124
|
+
securitySource: client._options.apiKey,
|
|
125
|
+
retryConfig: options?.retries
|
|
126
|
+
|| client._options.retryConfig
|
|
127
|
+
|| { strategy: "none" },
|
|
128
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
const requestRes = client._createRequest(context, {
|
|
132
|
+
security: requestSecurity,
|
|
133
|
+
method: "POST",
|
|
134
|
+
baseURL: options?.serverURL,
|
|
135
|
+
path: path,
|
|
136
|
+
headers: headers,
|
|
137
|
+
body: body,
|
|
138
|
+
userAgent: client._options.userAgent,
|
|
139
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
|
|
140
|
+
}, options);
|
|
141
|
+
if (!requestRes.ok) {
|
|
142
|
+
return [requestRes, { status: "invalid" }];
|
|
143
|
+
}
|
|
144
|
+
const req = requestRes.value;
|
|
145
|
+
|
|
146
|
+
const doResult = await client._do(req, {
|
|
147
|
+
context,
|
|
148
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
149
|
+
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
150
|
+
retryConfig: context.retryConfig,
|
|
151
|
+
retryCodes: context.retryCodes,
|
|
152
|
+
});
|
|
153
|
+
if (!doResult.ok) {
|
|
154
|
+
return [doResult, { status: "request-error", request: req }];
|
|
155
|
+
}
|
|
156
|
+
const response = doResult.value;
|
|
157
|
+
|
|
158
|
+
const responseFields = {
|
|
159
|
+
HttpMeta: { Response: response, Request: req },
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
const [result] = await M.match<
|
|
163
|
+
operations.CreateDecisionsResponseBody,
|
|
164
|
+
| errors.CreateDecisionsResponseBody
|
|
165
|
+
| errors.CreateDecisionsRouterDecisionsResponseBody
|
|
166
|
+
| errors.CreateDecisionsRouterDecisionsResponseResponseBody
|
|
167
|
+
| errors.CreateDecisionsRouterDecisionsResponse422ResponseBody
|
|
168
|
+
| errors.CreateDecisionsRouterDecisionsResponse429ResponseBody
|
|
169
|
+
| errors.CreateDecisionsRouterDecisionsResponse500ResponseBody
|
|
170
|
+
| errors.CreateDecisionsRouterDecisionsResponse502ResponseBody
|
|
171
|
+
| OrqError
|
|
172
|
+
| ResponseValidationError
|
|
173
|
+
| ConnectionError
|
|
174
|
+
| RequestAbortedError
|
|
175
|
+
| RequestTimeoutError
|
|
176
|
+
| InvalidRequestError
|
|
177
|
+
| UnexpectedClientError
|
|
178
|
+
| SDKValidationError
|
|
179
|
+
>(
|
|
180
|
+
M.json(200, operations.CreateDecisionsResponseBody$inboundSchema),
|
|
181
|
+
M.jsonErr(400, errors.CreateDecisionsResponseBody$inboundSchema),
|
|
182
|
+
M.jsonErr(
|
|
183
|
+
401,
|
|
184
|
+
errors.CreateDecisionsRouterDecisionsResponseBody$inboundSchema,
|
|
185
|
+
),
|
|
186
|
+
M.jsonErr(
|
|
187
|
+
403,
|
|
188
|
+
errors.CreateDecisionsRouterDecisionsResponseResponseBody$inboundSchema,
|
|
189
|
+
),
|
|
190
|
+
M.jsonErr(
|
|
191
|
+
422,
|
|
192
|
+
errors
|
|
193
|
+
.CreateDecisionsRouterDecisionsResponse422ResponseBody$inboundSchema,
|
|
194
|
+
),
|
|
195
|
+
M.jsonErr(
|
|
196
|
+
429,
|
|
197
|
+
errors
|
|
198
|
+
.CreateDecisionsRouterDecisionsResponse429ResponseBody$inboundSchema,
|
|
199
|
+
),
|
|
200
|
+
M.jsonErr(
|
|
201
|
+
500,
|
|
202
|
+
errors
|
|
203
|
+
.CreateDecisionsRouterDecisionsResponse500ResponseBody$inboundSchema,
|
|
204
|
+
),
|
|
205
|
+
M.jsonErr(
|
|
206
|
+
502,
|
|
207
|
+
errors
|
|
208
|
+
.CreateDecisionsRouterDecisionsResponse502ResponseBody$inboundSchema,
|
|
209
|
+
),
|
|
210
|
+
M.fail("4XX"),
|
|
211
|
+
M.fail("5XX"),
|
|
212
|
+
)(response, req, { extraFields: responseFields });
|
|
213
|
+
if (!result.ok) {
|
|
214
|
+
return [result, { status: "complete", request: req, response }];
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
return [result, { status: "complete", request: req, response }];
|
|
218
|
+
}
|
package/src/lib/config.ts
CHANGED
|
@@ -58,7 +58,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
58
58
|
export const SDK_METADATA = {
|
|
59
59
|
language: "typescript",
|
|
60
60
|
openapiDocVersion: "2.0",
|
|
61
|
-
sdkVersion: "4.16.0-rc.
|
|
61
|
+
sdkVersion: "4.16.0-rc.58",
|
|
62
62
|
genVersion: "2.943.0",
|
|
63
|
-
userAgent: "speakeasy-sdk/typescript 4.16.0-rc.
|
|
63
|
+
userAgent: "speakeasy-sdk/typescript 4.16.0-rc.58 2.943.0 2.0 @orq-ai/node",
|
|
64
64
|
} as const;
|