@openrouter/sdk 1.2.138 → 1.2.140
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/esm/funcs/decisionsDecisions.d.ts +19 -0
- package/esm/funcs/decisionsDecisions.js +98 -0
- package/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/models/byokproviderslug.d.ts +1 -0
- package/esm/models/byokproviderslug.js +1 -0
- package/esm/models/decisionschoiceanswer.d.ts +15 -0
- package/esm/models/decisionschoiceanswer.js +17 -0
- package/esm/models/decisionschoicequestion.d.ts +20 -0
- package/esm/models/decisionschoicequestion.js +15 -0
- package/esm/models/decisionsnoulanswer.d.ts +11 -0
- package/esm/models/decisionsnoulanswer.js +15 -0
- package/esm/models/decisionsnoulquestion.d.ts +28 -0
- package/esm/models/decisionsnoulquestion.js +24 -0
- package/esm/models/decisionsrequest.d.ts +48 -0
- package/esm/models/decisionsrequest.js +42 -0
- package/esm/models/decisionsresponse.d.ts +35 -0
- package/esm/models/decisionsresponse.js +50 -0
- package/esm/models/decisionsscoreanswer.d.ts +18 -0
- package/esm/models/decisionsscoreanswer.js +18 -0
- package/esm/models/decisionsscorequestion.d.ts +16 -0
- package/esm/models/decisionsscorequestion.js +15 -0
- package/esm/models/generationresponse.d.ts +1 -0
- package/esm/models/generationresponse.js +1 -0
- package/esm/models/imagegenerationproviderpreferences.d.ts +6 -0
- package/esm/models/imagegenerationproviderpreferences.js +1 -0
- package/esm/models/imageoutputmodality.d.ts +1 -0
- package/esm/models/imageoutputmodality.js +1 -0
- package/esm/models/index.d.ts +8 -0
- package/esm/models/index.js +8 -0
- package/esm/models/operations/createapialphadecisions.d.ts +56 -0
- package/esm/models/operations/createapialphadecisions.js +23 -0
- package/esm/models/operations/getmodels.d.ts +1 -1
- package/esm/models/operations/index.d.ts +1 -0
- package/esm/models/operations/index.js +1 -0
- package/esm/models/operations/listbyokkeys.d.ts +1 -0
- package/esm/models/operations/listbyokkeys.js +1 -0
- package/esm/models/operations/listmodelscount.d.ts +1 -1
- package/esm/models/operations/listmodelsuser.d.ts +1 -1
- package/esm/models/outputmodality.d.ts +1 -0
- package/esm/models/outputmodality.js +1 -0
- package/esm/models/providername.d.ts +1 -0
- package/esm/models/providername.js +1 -0
- package/esm/models/provideroptions.d.ts +6 -0
- package/esm/models/provideroptions.js +1 -0
- package/esm/models/providerpreferences.d.ts +1 -1
- package/esm/models/providerresponse.d.ts +1 -0
- package/esm/models/providerresponse.js +1 -0
- package/esm/models/sttresponse.d.ts +4 -0
- package/esm/models/sttresponse.js +1 -0
- package/esm/models/sttword.d.ts +4 -0
- package/esm/models/sttword.js +1 -0
- package/esm/models/videogenerationrequest.d.ts +6 -0
- package/esm/models/videogenerationrequest.js +1 -0
- package/esm/sdk/decisions.d.ts +13 -0
- package/esm/sdk/decisions.js +19 -0
- package/esm/sdk/sdk.d.ts +3 -0
- package/esm/sdk/sdk.js +4 -0
- package/jsr.json +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { OpenRouterCore } from "../core.js";
|
|
2
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
3
|
+
import { ConnectionError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, UnexpectedClientError } from "../models/errors/httpclienterrors.js";
|
|
4
|
+
import * as errors from "../models/errors/index.js";
|
|
5
|
+
import { OpenRouterError } from "../models/errors/openroutererror.js";
|
|
6
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
7
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
8
|
+
import * as models from "../models/index.js";
|
|
9
|
+
import * as operations from "../models/operations/index.js";
|
|
10
|
+
import { APIPromise } from "../types/async.js";
|
|
11
|
+
import { Result } from "../types/fp.js";
|
|
12
|
+
/**
|
|
13
|
+
* Submit a Decisions (questions and answers) request
|
|
14
|
+
*
|
|
15
|
+
* @remarks
|
|
16
|
+
* Submits a Decisions request to the Decisions router
|
|
17
|
+
*/
|
|
18
|
+
export declare function decisionsDecisions(client: OpenRouterCore, request: operations.CreateApiAlphaDecisionsRequest, options?: RequestOptions): APIPromise<Result<models.DecisionsResponse, errors.BadRequestResponseError | errors.UnauthorizedResponseError | errors.PaymentRequiredResponseError | errors.ForbiddenResponseError | errors.NotFoundResponseError | errors.PayloadTooLargeResponseError | errors.TooManyRequestsResponseError | errors.InternalServerResponseError | errors.BadGatewayResponseError | errors.ServiceUnavailableResponseError | errors.EdgeNetworkTimeoutResponseError | errors.ProviderOverloadedResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
19
|
+
//# sourceMappingURL=decisionsDecisions.d.ts.map
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: fe612844275a
|
|
4
|
+
*/
|
|
5
|
+
import { encodeJSON, encodeSimple } from "../lib/encodings.js";
|
|
6
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
7
|
+
import * as M from "../lib/matchers.js";
|
|
8
|
+
import { compactMap } from "../lib/primitives.js";
|
|
9
|
+
import { safeParse } from "../lib/schemas.js";
|
|
10
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
11
|
+
import { pathToFunc } from "../lib/url.js";
|
|
12
|
+
import * as errors from "../models/errors/index.js";
|
|
13
|
+
import * as models from "../models/index.js";
|
|
14
|
+
import * as operations from "../models/operations/index.js";
|
|
15
|
+
import { APIPromise } from "../types/async.js";
|
|
16
|
+
/**
|
|
17
|
+
* Submit a Decisions (questions and answers) request
|
|
18
|
+
*
|
|
19
|
+
* @remarks
|
|
20
|
+
* Submits a Decisions request to the Decisions router
|
|
21
|
+
*/
|
|
22
|
+
export function decisionsDecisions(client, request, options) {
|
|
23
|
+
return new APIPromise($do(client, request, options));
|
|
24
|
+
}
|
|
25
|
+
async function $do(client, request, options) {
|
|
26
|
+
const parsed = safeParse(request, (value) => operations.CreateApiAlphaDecisionsRequest$outboundSchema.parse(value), "Input validation failed");
|
|
27
|
+
if (!parsed.ok) {
|
|
28
|
+
return [parsed, { status: "invalid" }];
|
|
29
|
+
}
|
|
30
|
+
const payload = parsed.value;
|
|
31
|
+
const body = encodeJSON("body", payload.DecisionsRequest, { explode: true });
|
|
32
|
+
const path = pathToFunc("/api/alpha/decisions")();
|
|
33
|
+
const headers = new Headers(compactMap({
|
|
34
|
+
"Content-Type": "application/json",
|
|
35
|
+
Accept: "application/json",
|
|
36
|
+
"HTTP-Referer": encodeSimple("HTTP-Referer", payload["HTTP-Referer"] ?? client._options.httpReferer, { explode: false, charEncoding: "none" }),
|
|
37
|
+
"X-OpenRouter-Categories": encodeSimple("X-OpenRouter-Categories", payload.appCategories ?? client._options.appCategories, { explode: false, charEncoding: "none" }),
|
|
38
|
+
"X-OpenRouter-Title": encodeSimple("X-OpenRouter-Title", payload.appTitle ?? client._options.appTitle, { explode: false, charEncoding: "none" }),
|
|
39
|
+
}));
|
|
40
|
+
const secConfig = await extractSecurity(client._options.apiKey);
|
|
41
|
+
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
42
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
43
|
+
const context = {
|
|
44
|
+
options: client._options,
|
|
45
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
46
|
+
operationID: "createApiAlphaDecisions",
|
|
47
|
+
oAuth2Scopes: null,
|
|
48
|
+
resolvedSecurity: requestSecurity,
|
|
49
|
+
securitySource: client._options.apiKey,
|
|
50
|
+
retryConfig: options?.retries
|
|
51
|
+
|| client._options.retryConfig
|
|
52
|
+
|| {
|
|
53
|
+
strategy: "backoff",
|
|
54
|
+
backoff: {
|
|
55
|
+
initialInterval: 500,
|
|
56
|
+
maxInterval: 60000,
|
|
57
|
+
exponent: 1.5,
|
|
58
|
+
maxElapsedTime: 3600000,
|
|
59
|
+
},
|
|
60
|
+
retryConnectionErrors: true,
|
|
61
|
+
}
|
|
62
|
+
|| { strategy: "none" },
|
|
63
|
+
retryCodes: options?.retryCodes || ["5XX"],
|
|
64
|
+
};
|
|
65
|
+
const requestRes = client._createRequest(context, {
|
|
66
|
+
security: requestSecurity,
|
|
67
|
+
method: "POST",
|
|
68
|
+
baseURL: options?.serverURL,
|
|
69
|
+
path: path,
|
|
70
|
+
headers: headers,
|
|
71
|
+
body: body,
|
|
72
|
+
userAgent: client._options.userAgent,
|
|
73
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
74
|
+
}, options);
|
|
75
|
+
if (!requestRes.ok) {
|
|
76
|
+
return [requestRes, { status: "invalid" }];
|
|
77
|
+
}
|
|
78
|
+
const req = requestRes.value;
|
|
79
|
+
const doResult = await client._do(req, {
|
|
80
|
+
context,
|
|
81
|
+
isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
|
|
82
|
+
retryConfig: context.retryConfig,
|
|
83
|
+
retryCodes: context.retryCodes,
|
|
84
|
+
});
|
|
85
|
+
if (!doResult.ok) {
|
|
86
|
+
return [doResult, { status: "request-error", request: req }];
|
|
87
|
+
}
|
|
88
|
+
const response = doResult.value;
|
|
89
|
+
const responseFields = {
|
|
90
|
+
HttpMeta: { Response: response, Request: req },
|
|
91
|
+
};
|
|
92
|
+
const [result] = await M.match(M.json(200, models.DecisionsResponse$inboundSchema), M.jsonErr(400, errors.BadRequestResponseError$inboundSchema), M.jsonErr(401, errors.UnauthorizedResponseError$inboundSchema), M.jsonErr(402, errors.PaymentRequiredResponseError$inboundSchema), M.jsonErr(403, errors.ForbiddenResponseError$inboundSchema), M.jsonErr(404, errors.NotFoundResponseError$inboundSchema), M.jsonErr(413, errors.PayloadTooLargeResponseError$inboundSchema), M.jsonErr(429, errors.TooManyRequestsResponseError$inboundSchema), M.jsonErr(500, errors.InternalServerResponseError$inboundSchema), M.jsonErr(502, errors.BadGatewayResponseError$inboundSchema), M.jsonErr(503, errors.ServiceUnavailableResponseError$inboundSchema), M.jsonErr(524, errors.EdgeNetworkTimeoutResponseError$inboundSchema), M.jsonErr(529, errors.ProviderOverloadedResponseError$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
|
|
93
|
+
if (!result.ok) {
|
|
94
|
+
return [result, { status: "complete", request: req, response }];
|
|
95
|
+
}
|
|
96
|
+
return [result, { status: "complete", request: req, response }];
|
|
97
|
+
}
|
|
98
|
+
//# sourceMappingURL=decisionsDecisions.js.map
|
package/esm/lib/config.d.ts
CHANGED
|
@@ -50,8 +50,8 @@ export declare function serverURLFromOptions(options: SDKOptions): URL | null;
|
|
|
50
50
|
export declare const SDK_METADATA: {
|
|
51
51
|
readonly language: "typescript";
|
|
52
52
|
readonly openapiDocVersion: "1.0.0";
|
|
53
|
-
readonly sdkVersion: "1.2.
|
|
53
|
+
readonly sdkVersion: "1.2.140";
|
|
54
54
|
readonly genVersion: "2.914.0";
|
|
55
|
-
readonly userAgent: "speakeasy-sdk/typescript 1.2.
|
|
55
|
+
readonly userAgent: "speakeasy-sdk/typescript 1.2.140 2.914.0 1.0.0 @openrouter/sdk";
|
|
56
56
|
};
|
|
57
57
|
//# sourceMappingURL=config.d.ts.map
|
package/esm/lib/config.js
CHANGED
|
@@ -29,8 +29,8 @@ export function serverURLFromOptions(options) {
|
|
|
29
29
|
export const SDK_METADATA = {
|
|
30
30
|
language: "typescript",
|
|
31
31
|
openapiDocVersion: "1.0.0",
|
|
32
|
-
sdkVersion: "1.2.
|
|
32
|
+
sdkVersion: "1.2.140",
|
|
33
33
|
genVersion: "2.914.0",
|
|
34
|
-
userAgent: "speakeasy-sdk/typescript 1.2.
|
|
34
|
+
userAgent: "speakeasy-sdk/typescript 1.2.140 2.914.0 1.0.0 @openrouter/sdk",
|
|
35
35
|
};
|
|
36
36
|
//# sourceMappingURL=config.js.map
|
|
@@ -105,6 +105,7 @@ export declare const BYOKProviderSlug: {
|
|
|
105
105
|
readonly Tenstorrent: "tenstorrent";
|
|
106
106
|
readonly Thinkingmachines: "thinkingmachines";
|
|
107
107
|
readonly Together: "together";
|
|
108
|
+
readonly Typesafe: "typesafe";
|
|
108
109
|
readonly Upstage: "upstage";
|
|
109
110
|
readonly Venice: "venice";
|
|
110
111
|
readonly Voyageai: "voyageai";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
3
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
4
|
+
export type DecisionsChoiceAnswer = {
|
|
5
|
+
choice: string;
|
|
6
|
+
confidence?: number | undefined;
|
|
7
|
+
probabilities?: {
|
|
8
|
+
[k: string]: number;
|
|
9
|
+
} | undefined;
|
|
10
|
+
type: "choice";
|
|
11
|
+
};
|
|
12
|
+
/** @internal */
|
|
13
|
+
export declare const DecisionsChoiceAnswer$inboundSchema: z.ZodType<DecisionsChoiceAnswer, unknown>;
|
|
14
|
+
export declare function decisionsChoiceAnswerFromJSON(jsonString: string): SafeParseResult<DecisionsChoiceAnswer, SDKValidationError>;
|
|
15
|
+
//# sourceMappingURL=decisionschoiceanswer.d.ts.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 430db809b823
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { safeParse } from "../lib/schemas.js";
|
|
7
|
+
/** @internal */
|
|
8
|
+
export const DecisionsChoiceAnswer$inboundSchema = z.object({
|
|
9
|
+
choice: z.string(),
|
|
10
|
+
confidence: z.number().optional(),
|
|
11
|
+
probabilities: z.record(z.string(), z.number()).optional(),
|
|
12
|
+
type: z.literal("choice"),
|
|
13
|
+
});
|
|
14
|
+
export function decisionsChoiceAnswerFromJSON(jsonString) {
|
|
15
|
+
return safeParse(jsonString, (x) => DecisionsChoiceAnswer$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DecisionsChoiceAnswer' from JSON`);
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=decisionschoiceanswer.js.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
export type DecisionsChoiceQuestion = {
|
|
3
|
+
criteria: {
|
|
4
|
+
[k: string]: string;
|
|
5
|
+
};
|
|
6
|
+
instructions: string;
|
|
7
|
+
type: "choice";
|
|
8
|
+
};
|
|
9
|
+
/** @internal */
|
|
10
|
+
export type DecisionsChoiceQuestion$Outbound = {
|
|
11
|
+
criteria: {
|
|
12
|
+
[k: string]: string;
|
|
13
|
+
};
|
|
14
|
+
instructions: string;
|
|
15
|
+
type: "choice";
|
|
16
|
+
};
|
|
17
|
+
/** @internal */
|
|
18
|
+
export declare const DecisionsChoiceQuestion$outboundSchema: z.ZodType<DecisionsChoiceQuestion$Outbound, DecisionsChoiceQuestion>;
|
|
19
|
+
export declare function decisionsChoiceQuestionToJSON(decisionsChoiceQuestion: DecisionsChoiceQuestion): string;
|
|
20
|
+
//# sourceMappingURL=decisionschoicequestion.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 47fb575187d1
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
/** @internal */
|
|
7
|
+
export const DecisionsChoiceQuestion$outboundSchema = z.object({
|
|
8
|
+
criteria: z.record(z.string(), z.string()),
|
|
9
|
+
instructions: z.string(),
|
|
10
|
+
type: z.literal("choice"),
|
|
11
|
+
});
|
|
12
|
+
export function decisionsChoiceQuestionToJSON(decisionsChoiceQuestion) {
|
|
13
|
+
return JSON.stringify(DecisionsChoiceQuestion$outboundSchema.parse(decisionsChoiceQuestion));
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=decisionschoicequestion.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
3
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
4
|
+
export type DecisionsNoulAnswer = {
|
|
5
|
+
noul: number;
|
|
6
|
+
type: "noul";
|
|
7
|
+
};
|
|
8
|
+
/** @internal */
|
|
9
|
+
export declare const DecisionsNoulAnswer$inboundSchema: z.ZodType<DecisionsNoulAnswer, unknown>;
|
|
10
|
+
export declare function decisionsNoulAnswerFromJSON(jsonString: string): SafeParseResult<DecisionsNoulAnswer, SDKValidationError>;
|
|
11
|
+
//# sourceMappingURL=decisionsnoulanswer.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: da6d759cdb2f
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { safeParse } from "../lib/schemas.js";
|
|
7
|
+
/** @internal */
|
|
8
|
+
export const DecisionsNoulAnswer$inboundSchema = z.object({
|
|
9
|
+
noul: z.number(),
|
|
10
|
+
type: z.literal("noul"),
|
|
11
|
+
});
|
|
12
|
+
export function decisionsNoulAnswerFromJSON(jsonString) {
|
|
13
|
+
return safeParse(jsonString, (x) => DecisionsNoulAnswer$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DecisionsNoulAnswer' from JSON`);
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=decisionsnoulanswer.js.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
export type Criteria = {
|
|
3
|
+
false: string;
|
|
4
|
+
true: string;
|
|
5
|
+
};
|
|
6
|
+
export type DecisionsNoulQuestion = {
|
|
7
|
+
criteria?: Criteria | undefined;
|
|
8
|
+
instructions: string;
|
|
9
|
+
type: "noul";
|
|
10
|
+
};
|
|
11
|
+
/** @internal */
|
|
12
|
+
export type Criteria$Outbound = {
|
|
13
|
+
false: string;
|
|
14
|
+
true: string;
|
|
15
|
+
};
|
|
16
|
+
/** @internal */
|
|
17
|
+
export declare const Criteria$outboundSchema: z.ZodType<Criteria$Outbound, Criteria>;
|
|
18
|
+
export declare function criteriaToJSON(criteria: Criteria): string;
|
|
19
|
+
/** @internal */
|
|
20
|
+
export type DecisionsNoulQuestion$Outbound = {
|
|
21
|
+
criteria?: Criteria$Outbound | undefined;
|
|
22
|
+
instructions: string;
|
|
23
|
+
type: "noul";
|
|
24
|
+
};
|
|
25
|
+
/** @internal */
|
|
26
|
+
export declare const DecisionsNoulQuestion$outboundSchema: z.ZodType<DecisionsNoulQuestion$Outbound, DecisionsNoulQuestion>;
|
|
27
|
+
export declare function decisionsNoulQuestionToJSON(decisionsNoulQuestion: DecisionsNoulQuestion): string;
|
|
28
|
+
//# sourceMappingURL=decisionsnoulquestion.d.ts.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 6d8f420a5239
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
/** @internal */
|
|
7
|
+
export const Criteria$outboundSchema = z
|
|
8
|
+
.object({
|
|
9
|
+
false: z.string(),
|
|
10
|
+
true: z.string(),
|
|
11
|
+
});
|
|
12
|
+
export function criteriaToJSON(criteria) {
|
|
13
|
+
return JSON.stringify(Criteria$outboundSchema.parse(criteria));
|
|
14
|
+
}
|
|
15
|
+
/** @internal */
|
|
16
|
+
export const DecisionsNoulQuestion$outboundSchema = z.object({
|
|
17
|
+
criteria: z.lazy(() => Criteria$outboundSchema).optional(),
|
|
18
|
+
instructions: z.string(),
|
|
19
|
+
type: z.literal("noul"),
|
|
20
|
+
});
|
|
21
|
+
export function decisionsNoulQuestionToJSON(decisionsNoulQuestion) {
|
|
22
|
+
return JSON.stringify(DecisionsNoulQuestion$outboundSchema.parse(decisionsNoulQuestion));
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=decisionsnoulquestion.js.map
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { DecisionsChoiceQuestion, DecisionsChoiceQuestion$Outbound } from "./decisionschoicequestion.js";
|
|
3
|
+
import { DecisionsNoulQuestion, DecisionsNoulQuestion$Outbound } from "./decisionsnoulquestion.js";
|
|
4
|
+
import { DecisionsScoreQuestion, DecisionsScoreQuestion$Outbound } from "./decisionsscorequestion.js";
|
|
5
|
+
import { ProviderPreferences, ProviderPreferences$Outbound } from "./providerpreferences.js";
|
|
6
|
+
import { TraceConfig, TraceConfig$Outbound } from "./traceconfig.js";
|
|
7
|
+
/**
|
|
8
|
+
* A Decisions question using a boolean, choice, or ordered score evaluation.
|
|
9
|
+
*/
|
|
10
|
+
export type Questions = DecisionsChoiceQuestion | DecisionsNoulQuestion | DecisionsScoreQuestion;
|
|
11
|
+
export type DecisionsRequest = {
|
|
12
|
+
model: string;
|
|
13
|
+
provider?: ProviderPreferences | null | undefined;
|
|
14
|
+
questions: {
|
|
15
|
+
[k: string]: DecisionsChoiceQuestion | DecisionsNoulQuestion | DecisionsScoreQuestion;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* A unique identifier for grouping related requests (e.g., a conversation or agent workflow). Used for observability grouping in Broadcast and private logging; never sent to the provider. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters.
|
|
19
|
+
*/
|
|
20
|
+
sessionId?: string | undefined;
|
|
21
|
+
state: any;
|
|
22
|
+
/**
|
|
23
|
+
* Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations.
|
|
24
|
+
*/
|
|
25
|
+
trace?: TraceConfig | undefined;
|
|
26
|
+
user?: string | undefined;
|
|
27
|
+
};
|
|
28
|
+
/** @internal */
|
|
29
|
+
export type Questions$Outbound = DecisionsChoiceQuestion$Outbound | DecisionsNoulQuestion$Outbound | DecisionsScoreQuestion$Outbound;
|
|
30
|
+
/** @internal */
|
|
31
|
+
export declare const Questions$outboundSchema: z.ZodType<Questions$Outbound, Questions>;
|
|
32
|
+
export declare function questionsToJSON(questions: Questions): string;
|
|
33
|
+
/** @internal */
|
|
34
|
+
export type DecisionsRequest$Outbound = {
|
|
35
|
+
model: string;
|
|
36
|
+
provider?: ProviderPreferences$Outbound | null | undefined;
|
|
37
|
+
questions: {
|
|
38
|
+
[k: string]: DecisionsChoiceQuestion$Outbound | DecisionsNoulQuestion$Outbound | DecisionsScoreQuestion$Outbound;
|
|
39
|
+
};
|
|
40
|
+
session_id?: string | undefined;
|
|
41
|
+
state: any;
|
|
42
|
+
trace?: TraceConfig$Outbound | undefined;
|
|
43
|
+
user?: string | undefined;
|
|
44
|
+
};
|
|
45
|
+
/** @internal */
|
|
46
|
+
export declare const DecisionsRequest$outboundSchema: z.ZodType<DecisionsRequest$Outbound, DecisionsRequest>;
|
|
47
|
+
export declare function decisionsRequestToJSON(decisionsRequest: DecisionsRequest): string;
|
|
48
|
+
//# sourceMappingURL=decisionsrequest.d.ts.map
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 5ff115bbd9a7
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
|
+
import { DecisionsChoiceQuestion$outboundSchema, } from "./decisionschoicequestion.js";
|
|
8
|
+
import { DecisionsNoulQuestion$outboundSchema, } from "./decisionsnoulquestion.js";
|
|
9
|
+
import { DecisionsScoreQuestion$outboundSchema, } from "./decisionsscorequestion.js";
|
|
10
|
+
import { ProviderPreferences$outboundSchema, } from "./providerpreferences.js";
|
|
11
|
+
import { TraceConfig$outboundSchema, } from "./traceconfig.js";
|
|
12
|
+
/** @internal */
|
|
13
|
+
export const Questions$outboundSchema = z.union([
|
|
14
|
+
DecisionsChoiceQuestion$outboundSchema,
|
|
15
|
+
DecisionsNoulQuestion$outboundSchema,
|
|
16
|
+
DecisionsScoreQuestion$outboundSchema,
|
|
17
|
+
]);
|
|
18
|
+
export function questionsToJSON(questions) {
|
|
19
|
+
return JSON.stringify(Questions$outboundSchema.parse(questions));
|
|
20
|
+
}
|
|
21
|
+
/** @internal */
|
|
22
|
+
export const DecisionsRequest$outboundSchema = z.object({
|
|
23
|
+
model: z.string(),
|
|
24
|
+
provider: z.nullable(ProviderPreferences$outboundSchema).optional(),
|
|
25
|
+
questions: z.record(z.string(), z.union([
|
|
26
|
+
DecisionsChoiceQuestion$outboundSchema,
|
|
27
|
+
DecisionsNoulQuestion$outboundSchema,
|
|
28
|
+
DecisionsScoreQuestion$outboundSchema,
|
|
29
|
+
])),
|
|
30
|
+
sessionId: z.string().optional(),
|
|
31
|
+
state: z.any(),
|
|
32
|
+
trace: TraceConfig$outboundSchema.optional(),
|
|
33
|
+
user: z.string().optional(),
|
|
34
|
+
}).transform((v) => {
|
|
35
|
+
return remap$(v, {
|
|
36
|
+
sessionId: "session_id",
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
export function decisionsRequestToJSON(decisionsRequest) {
|
|
40
|
+
return JSON.stringify(DecisionsRequest$outboundSchema.parse(decisionsRequest));
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=decisionsrequest.js.map
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import * as discriminatedUnionTypes from "../types/discriminatedUnion.js";
|
|
3
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
4
|
+
import { DecisionsChoiceAnswer } from "./decisionschoiceanswer.js";
|
|
5
|
+
import { DecisionsNoulAnswer } from "./decisionsnoulanswer.js";
|
|
6
|
+
import { DecisionsScoreAnswer } from "./decisionsscoreanswer.js";
|
|
7
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
8
|
+
/**
|
|
9
|
+
* A Decisions answer using a boolean, choice, or score evaluation.
|
|
10
|
+
*/
|
|
11
|
+
export type Answers = DecisionsChoiceAnswer | DecisionsNoulAnswer | DecisionsScoreAnswer | discriminatedUnionTypes.Unknown<"type">;
|
|
12
|
+
export type DecisionsResponseUsage = {
|
|
13
|
+
cost?: number | undefined;
|
|
14
|
+
inputTokens: number;
|
|
15
|
+
outputTokens: number;
|
|
16
|
+
};
|
|
17
|
+
export type DecisionsResponse = {
|
|
18
|
+
answers: {
|
|
19
|
+
[k: string]: DecisionsChoiceAnswer | DecisionsNoulAnswer | DecisionsScoreAnswer | discriminatedUnionTypes.Unknown<"type">;
|
|
20
|
+
};
|
|
21
|
+
id?: string | undefined;
|
|
22
|
+
model: string;
|
|
23
|
+
provider?: string | undefined;
|
|
24
|
+
usage: DecisionsResponseUsage;
|
|
25
|
+
};
|
|
26
|
+
/** @internal */
|
|
27
|
+
export declare const Answers$inboundSchema: z.ZodType<Answers, unknown>;
|
|
28
|
+
export declare function answersFromJSON(jsonString: string): SafeParseResult<Answers, SDKValidationError>;
|
|
29
|
+
/** @internal */
|
|
30
|
+
export declare const DecisionsResponseUsage$inboundSchema: z.ZodType<DecisionsResponseUsage, unknown>;
|
|
31
|
+
export declare function decisionsResponseUsageFromJSON(jsonString: string): SafeParseResult<DecisionsResponseUsage, SDKValidationError>;
|
|
32
|
+
/** @internal */
|
|
33
|
+
export declare const DecisionsResponse$inboundSchema: z.ZodType<DecisionsResponse, unknown>;
|
|
34
|
+
export declare function decisionsResponseFromJSON(jsonString: string): SafeParseResult<DecisionsResponse, SDKValidationError>;
|
|
35
|
+
//# sourceMappingURL=decisionsresponse.d.ts.map
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 5989c9497b2d
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../lib/schemas.js";
|
|
8
|
+
import { discriminatedUnion } from "../types/discriminatedUnion.js";
|
|
9
|
+
import { DecisionsChoiceAnswer$inboundSchema, } from "./decisionschoiceanswer.js";
|
|
10
|
+
import { DecisionsNoulAnswer$inboundSchema, } from "./decisionsnoulanswer.js";
|
|
11
|
+
import { DecisionsScoreAnswer$inboundSchema, } from "./decisionsscoreanswer.js";
|
|
12
|
+
/** @internal */
|
|
13
|
+
export const Answers$inboundSchema = discriminatedUnion("type", {
|
|
14
|
+
choice: DecisionsChoiceAnswer$inboundSchema,
|
|
15
|
+
noul: DecisionsNoulAnswer$inboundSchema,
|
|
16
|
+
score: DecisionsScoreAnswer$inboundSchema,
|
|
17
|
+
});
|
|
18
|
+
export function answersFromJSON(jsonString) {
|
|
19
|
+
return safeParse(jsonString, (x) => Answers$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Answers' from JSON`);
|
|
20
|
+
}
|
|
21
|
+
/** @internal */
|
|
22
|
+
export const DecisionsResponseUsage$inboundSchema = z.object({
|
|
23
|
+
cost: z.number().optional(),
|
|
24
|
+
input_tokens: z.int(),
|
|
25
|
+
output_tokens: z.int(),
|
|
26
|
+
}).transform((v) => {
|
|
27
|
+
return remap$(v, {
|
|
28
|
+
"input_tokens": "inputTokens",
|
|
29
|
+
"output_tokens": "outputTokens",
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
export function decisionsResponseUsageFromJSON(jsonString) {
|
|
33
|
+
return safeParse(jsonString, (x) => DecisionsResponseUsage$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DecisionsResponseUsage' from JSON`);
|
|
34
|
+
}
|
|
35
|
+
/** @internal */
|
|
36
|
+
export const DecisionsResponse$inboundSchema = z.object({
|
|
37
|
+
answers: z.record(z.string(), discriminatedUnion("type", {
|
|
38
|
+
choice: DecisionsChoiceAnswer$inboundSchema,
|
|
39
|
+
noul: DecisionsNoulAnswer$inboundSchema,
|
|
40
|
+
score: DecisionsScoreAnswer$inboundSchema,
|
|
41
|
+
})),
|
|
42
|
+
id: z.string().optional(),
|
|
43
|
+
model: z.string(),
|
|
44
|
+
provider: z.string().optional(),
|
|
45
|
+
usage: z.lazy(() => DecisionsResponseUsage$inboundSchema),
|
|
46
|
+
});
|
|
47
|
+
export function decisionsResponseFromJSON(jsonString) {
|
|
48
|
+
return safeParse(jsonString, (x) => DecisionsResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DecisionsResponse' from JSON`);
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=decisionsresponse.js.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
3
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
4
|
+
export type DecisionsScoreAnswer = {
|
|
5
|
+
confidence?: number | undefined;
|
|
6
|
+
legend?: {
|
|
7
|
+
[k: string]: string;
|
|
8
|
+
} | undefined;
|
|
9
|
+
probabilities?: {
|
|
10
|
+
[k: string]: number;
|
|
11
|
+
} | undefined;
|
|
12
|
+
score: number;
|
|
13
|
+
type: "score";
|
|
14
|
+
};
|
|
15
|
+
/** @internal */
|
|
16
|
+
export declare const DecisionsScoreAnswer$inboundSchema: z.ZodType<DecisionsScoreAnswer, unknown>;
|
|
17
|
+
export declare function decisionsScoreAnswerFromJSON(jsonString: string): SafeParseResult<DecisionsScoreAnswer, SDKValidationError>;
|
|
18
|
+
//# sourceMappingURL=decisionsscoreanswer.d.ts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 40ca541d040e
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { safeParse } from "../lib/schemas.js";
|
|
7
|
+
/** @internal */
|
|
8
|
+
export const DecisionsScoreAnswer$inboundSchema = z.object({
|
|
9
|
+
confidence: z.number().optional(),
|
|
10
|
+
legend: z.record(z.string(), z.string()).optional(),
|
|
11
|
+
probabilities: z.record(z.string(), z.number()).optional(),
|
|
12
|
+
score: z.number(),
|
|
13
|
+
type: z.literal("score"),
|
|
14
|
+
});
|
|
15
|
+
export function decisionsScoreAnswerFromJSON(jsonString) {
|
|
16
|
+
return safeParse(jsonString, (x) => DecisionsScoreAnswer$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DecisionsScoreAnswer' from JSON`);
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=decisionsscoreanswer.js.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
export type DecisionsScoreQuestion = {
|
|
3
|
+
criteria: Array<string>;
|
|
4
|
+
instructions: string;
|
|
5
|
+
type: "score";
|
|
6
|
+
};
|
|
7
|
+
/** @internal */
|
|
8
|
+
export type DecisionsScoreQuestion$Outbound = {
|
|
9
|
+
criteria: Array<string>;
|
|
10
|
+
instructions: string;
|
|
11
|
+
type: "score";
|
|
12
|
+
};
|
|
13
|
+
/** @internal */
|
|
14
|
+
export declare const DecisionsScoreQuestion$outboundSchema: z.ZodType<DecisionsScoreQuestion$Outbound, DecisionsScoreQuestion>;
|
|
15
|
+
export declare function decisionsScoreQuestionToJSON(decisionsScoreQuestion: DecisionsScoreQuestion): string;
|
|
16
|
+
//# sourceMappingURL=decisionsscorequestion.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 12efc76ca39f
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
/** @internal */
|
|
7
|
+
export const DecisionsScoreQuestion$outboundSchema = z.object({
|
|
8
|
+
criteria: z.array(z.string()),
|
|
9
|
+
instructions: z.string(),
|
|
10
|
+
type: z.literal("score"),
|
|
11
|
+
});
|
|
12
|
+
export function decisionsScoreQuestionToJSON(decisionsScoreQuestion) {
|
|
13
|
+
return JSON.stringify(DecisionsScoreQuestion$outboundSchema.parse(decisionsScoreQuestion));
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=decisionsscorequestion.js.map
|
|
@@ -401,6 +401,9 @@ export type ImageGenerationProviderPreferencesOptions = {
|
|
|
401
401
|
togetherLite?: {
|
|
402
402
|
[k: string]: any;
|
|
403
403
|
} | undefined;
|
|
404
|
+
typesafe?: {
|
|
405
|
+
[k: string]: any;
|
|
406
|
+
} | undefined;
|
|
404
407
|
ubicloud?: {
|
|
405
408
|
[k: string]: any;
|
|
406
409
|
} | undefined;
|
|
@@ -872,6 +875,9 @@ export type ImageGenerationProviderPreferencesOptions$Outbound = {
|
|
|
872
875
|
"together-lite"?: {
|
|
873
876
|
[k: string]: any;
|
|
874
877
|
} | undefined;
|
|
878
|
+
typesafe?: {
|
|
879
|
+
[k: string]: any;
|
|
880
|
+
} | undefined;
|
|
875
881
|
ubicloud?: {
|
|
876
882
|
[k: string]: any;
|
|
877
883
|
} | undefined;
|
|
@@ -150,6 +150,7 @@ export const ImageGenerationProviderPreferencesOptions$outboundSchema = z.object
|
|
|
150
150
|
thinkingmachines: z.record(z.string(), z.any()).optional(),
|
|
151
151
|
together: z.record(z.string(), z.any()).optional(),
|
|
152
152
|
togetherLite: z.record(z.string(), z.any()).optional(),
|
|
153
|
+
typesafe: z.record(z.string(), z.any()).optional(),
|
|
153
154
|
ubicloud: z.record(z.string(), z.any()).optional(),
|
|
154
155
|
upstage: z.record(z.string(), z.any()).optional(),
|
|
155
156
|
venice: z.record(z.string(), z.any()).optional(),
|
package/esm/models/index.d.ts
CHANGED
|
@@ -198,6 +198,14 @@ export * from "./dabenchmarkentry.js";
|
|
|
198
198
|
export * from "./datetimeservertool.js";
|
|
199
199
|
export * from "./datetimeservertoolconfig.js";
|
|
200
200
|
export * from "./debugevent.js";
|
|
201
|
+
export * from "./decisionschoiceanswer.js";
|
|
202
|
+
export * from "./decisionschoicequestion.js";
|
|
203
|
+
export * from "./decisionsnoulanswer.js";
|
|
204
|
+
export * from "./decisionsnoulquestion.js";
|
|
205
|
+
export * from "./decisionsrequest.js";
|
|
206
|
+
export * from "./decisionsresponse.js";
|
|
207
|
+
export * from "./decisionsscoreanswer.js";
|
|
208
|
+
export * from "./decisionsscorequestion.js";
|
|
201
209
|
export * from "./defaultparameters.js";
|
|
202
210
|
export * from "./deletebyokkeyresponse.js";
|
|
203
211
|
export * from "./deleteguardrailresponse.js";
|
package/esm/models/index.js
CHANGED
|
@@ -202,6 +202,14 @@ export * from "./dabenchmarkentry.js";
|
|
|
202
202
|
export * from "./datetimeservertool.js";
|
|
203
203
|
export * from "./datetimeservertoolconfig.js";
|
|
204
204
|
export * from "./debugevent.js";
|
|
205
|
+
export * from "./decisionschoiceanswer.js";
|
|
206
|
+
export * from "./decisionschoicequestion.js";
|
|
207
|
+
export * from "./decisionsnoulanswer.js";
|
|
208
|
+
export * from "./decisionsnoulquestion.js";
|
|
209
|
+
export * from "./decisionsrequest.js";
|
|
210
|
+
export * from "./decisionsresponse.js";
|
|
211
|
+
export * from "./decisionsscoreanswer.js";
|
|
212
|
+
export * from "./decisionsscorequestion.js";
|
|
205
213
|
export * from "./defaultparameters.js";
|
|
206
214
|
export * from "./deletebyokkeyresponse.js";
|
|
207
215
|
export * from "./deleteguardrailresponse.js";
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import * as models from "../index.js";
|
|
3
|
+
export type CreateApiAlphaDecisionsGlobals = {
|
|
4
|
+
/**
|
|
5
|
+
* The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
|
6
|
+
*
|
|
7
|
+
* @remarks
|
|
8
|
+
* This is used to track API usage per application.
|
|
9
|
+
*/
|
|
10
|
+
httpReferer?: string | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
|
13
|
+
*
|
|
14
|
+
* @remarks
|
|
15
|
+
*/
|
|
16
|
+
appTitle?: string | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
|
|
19
|
+
*
|
|
20
|
+
* @remarks
|
|
21
|
+
*/
|
|
22
|
+
appCategories?: string | undefined;
|
|
23
|
+
};
|
|
24
|
+
export type CreateApiAlphaDecisionsRequest = {
|
|
25
|
+
/**
|
|
26
|
+
* The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
|
27
|
+
*
|
|
28
|
+
* @remarks
|
|
29
|
+
* This is used to track API usage per application.
|
|
30
|
+
*/
|
|
31
|
+
httpReferer?: string | undefined;
|
|
32
|
+
/**
|
|
33
|
+
* The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
|
34
|
+
*
|
|
35
|
+
* @remarks
|
|
36
|
+
*/
|
|
37
|
+
appTitle?: string | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
|
|
40
|
+
*
|
|
41
|
+
* @remarks
|
|
42
|
+
*/
|
|
43
|
+
appCategories?: string | undefined;
|
|
44
|
+
decisionsRequest: models.DecisionsRequest;
|
|
45
|
+
};
|
|
46
|
+
/** @internal */
|
|
47
|
+
export type CreateApiAlphaDecisionsRequest$Outbound = {
|
|
48
|
+
"HTTP-Referer"?: string | undefined;
|
|
49
|
+
appTitle?: string | undefined;
|
|
50
|
+
appCategories?: string | undefined;
|
|
51
|
+
DecisionsRequest: models.DecisionsRequest$Outbound;
|
|
52
|
+
};
|
|
53
|
+
/** @internal */
|
|
54
|
+
export declare const CreateApiAlphaDecisionsRequest$outboundSchema: z.ZodType<CreateApiAlphaDecisionsRequest$Outbound, CreateApiAlphaDecisionsRequest>;
|
|
55
|
+
export declare function createApiAlphaDecisionsRequestToJSON(createApiAlphaDecisionsRequest: CreateApiAlphaDecisionsRequest): string;
|
|
56
|
+
//# sourceMappingURL=createapialphadecisions.d.ts.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 84d520ce3957
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import * as models from "../index.js";
|
|
8
|
+
/** @internal */
|
|
9
|
+
export const CreateApiAlphaDecisionsRequest$outboundSchema = z.object({
|
|
10
|
+
httpReferer: z.string().optional(),
|
|
11
|
+
appTitle: z.string().optional(),
|
|
12
|
+
appCategories: z.string().optional(),
|
|
13
|
+
decisionsRequest: models.DecisionsRequest$outboundSchema,
|
|
14
|
+
}).transform((v) => {
|
|
15
|
+
return remap$(v, {
|
|
16
|
+
httpReferer: "HTTP-Referer",
|
|
17
|
+
decisionsRequest: "DecisionsRequest",
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
export function createApiAlphaDecisionsRequestToJSON(createApiAlphaDecisionsRequest) {
|
|
21
|
+
return JSON.stringify(CreateApiAlphaDecisionsRequest$outboundSchema.parse(createApiAlphaDecisionsRequest));
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=createapialphadecisions.js.map
|
|
@@ -135,7 +135,7 @@ export type GetModelsRequest = {
|
|
|
135
135
|
*/
|
|
136
136
|
supportedParameters?: string | undefined;
|
|
137
137
|
/**
|
|
138
|
-
* Filter models by output modality. Accepts a comma-separated list of modalities (text, image, embeddings, audio, video, rerank, speech, transcription) or "all" to include all models. Defaults to "text".
|
|
138
|
+
* Filter models by output modality. Accepts a comma-separated list of modalities (text, image, embeddings, audio, video, rerank, decisions, speech, transcription) or "all" to include all models. Defaults to "text".
|
|
139
139
|
*/
|
|
140
140
|
outputModalities?: string | undefined;
|
|
141
141
|
/**
|
|
@@ -5,6 +5,7 @@ export * from "./bulkremoveworkspacemembers.js";
|
|
|
5
5
|
export * from "./bulkunassignkeysfromguardrail.js";
|
|
6
6
|
export * from "./bulkunassignmembersfromguardrail.js";
|
|
7
7
|
export * from "./copyvaultsecretstointern.js";
|
|
8
|
+
export * from "./createapialphadecisions.js";
|
|
8
9
|
export * from "./createaudiospeech.js";
|
|
9
10
|
export * from "./createaudiotranscriptions.js";
|
|
10
11
|
export * from "./createaudiotranscriptionsmultipart.js";
|
|
@@ -9,6 +9,7 @@ export * from "./bulkremoveworkspacemembers.js";
|
|
|
9
9
|
export * from "./bulkunassignkeysfromguardrail.js";
|
|
10
10
|
export * from "./bulkunassignmembersfromguardrail.js";
|
|
11
11
|
export * from "./copyvaultsecretstointern.js";
|
|
12
|
+
export * from "./createapialphadecisions.js";
|
|
12
13
|
export * from "./createaudiospeech.js";
|
|
13
14
|
export * from "./createaudiotranscriptions.js";
|
|
14
15
|
export * from "./createaudiotranscriptionsmultipart.js";
|
|
@@ -129,6 +129,7 @@ export declare const Provider: {
|
|
|
129
129
|
readonly Tenstorrent: "tenstorrent";
|
|
130
130
|
readonly Thinkingmachines: "thinkingmachines";
|
|
131
131
|
readonly Together: "together";
|
|
132
|
+
readonly Typesafe: "typesafe";
|
|
132
133
|
readonly Upstage: "upstage";
|
|
133
134
|
readonly Venice: "venice";
|
|
134
135
|
readonly Voyageai: "voyageai";
|
|
@@ -41,7 +41,7 @@ export type ListModelsCountRequest = {
|
|
|
41
41
|
*/
|
|
42
42
|
appCategories?: string | undefined;
|
|
43
43
|
/**
|
|
44
|
-
* Filter models by output modality. Accepts a comma-separated list of modalities (text, image, embeddings, audio, video, rerank, speech, transcription) or "all" to include all models. Defaults to "text".
|
|
44
|
+
* Filter models by output modality. Accepts a comma-separated list of modalities (text, image, embeddings, audio, video, rerank, decisions, speech, transcription) or "all" to include all models. Defaults to "text".
|
|
45
45
|
*/
|
|
46
46
|
outputModalities?: string | undefined;
|
|
47
47
|
};
|
|
@@ -55,7 +55,7 @@ export type ListModelsUserRequest = {
|
|
|
55
55
|
*/
|
|
56
56
|
limit?: number | undefined;
|
|
57
57
|
/**
|
|
58
|
-
* Filter models by output modality. Accepts a comma-separated list of modalities (text, image, embeddings, audio, video, rerank, speech, transcription) or "all" to include all models. Defaults to "text".
|
|
58
|
+
* Filter models by output modality. Accepts a comma-separated list of modalities (text, image, embeddings, audio, video, rerank, decisions, speech, transcription) or "all" to include all models. Defaults to "text".
|
|
59
59
|
*/
|
|
60
60
|
outputModalities?: string | undefined;
|
|
61
61
|
};
|
|
@@ -67,6 +67,7 @@ export declare const ProviderName: {
|
|
|
67
67
|
readonly MoonshotAI: "Moonshot AI";
|
|
68
68
|
readonly Morph: "Morph";
|
|
69
69
|
readonly VoyageAIByMongoDB: "VoyageAI by MongoDB";
|
|
70
|
+
readonly TypeSafe: "TypeSafe";
|
|
70
71
|
readonly NearAI: "Near AI";
|
|
71
72
|
readonly Nebius: "Nebius";
|
|
72
73
|
readonly NexAGI: "Nex AGI";
|
|
@@ -396,6 +396,9 @@ export type ProviderOptions = {
|
|
|
396
396
|
togetherLite?: {
|
|
397
397
|
[k: string]: any;
|
|
398
398
|
} | undefined;
|
|
399
|
+
typesafe?: {
|
|
400
|
+
[k: string]: any;
|
|
401
|
+
} | undefined;
|
|
399
402
|
ubicloud?: {
|
|
400
403
|
[k: string]: any;
|
|
401
404
|
} | undefined;
|
|
@@ -822,6 +825,9 @@ export type ProviderOptions$Outbound = {
|
|
|
822
825
|
"together-lite"?: {
|
|
823
826
|
[k: string]: any;
|
|
824
827
|
} | undefined;
|
|
828
|
+
typesafe?: {
|
|
829
|
+
[k: string]: any;
|
|
830
|
+
} | undefined;
|
|
825
831
|
ubicloud?: {
|
|
826
832
|
[k: string]: any;
|
|
827
833
|
} | undefined;
|
|
@@ -137,6 +137,7 @@ export const ProviderOptions$outboundSchema = z.object({
|
|
|
137
137
|
thinkingmachines: z.record(z.string(), z.any()).optional(),
|
|
138
138
|
together: z.record(z.string(), z.any()).optional(),
|
|
139
139
|
togetherLite: z.record(z.string(), z.any()).optional(),
|
|
140
|
+
typesafe: z.record(z.string(), z.any()).optional(),
|
|
140
141
|
ubicloud: z.record(z.string(), z.any()).optional(),
|
|
141
142
|
upstage: z.record(z.string(), z.any()).optional(),
|
|
142
143
|
venice: z.record(z.string(), z.any()).optional(),
|
|
@@ -60,7 +60,7 @@ export type ProviderPreferencesOrder = ProviderName | string;
|
|
|
60
60
|
*/
|
|
61
61
|
export type ProviderPreferencesSort = ProviderSort | ProviderSortConfig;
|
|
62
62
|
/**
|
|
63
|
-
*
|
|
63
|
+
* Provider routing preferences for the request.
|
|
64
64
|
*/
|
|
65
65
|
export type ProviderPreferences = {
|
|
66
66
|
/**
|
|
@@ -100,6 +100,7 @@ export declare const ProviderResponseProviderName: {
|
|
|
100
100
|
readonly MoonshotAI: "Moonshot AI";
|
|
101
101
|
readonly Morph: "Morph";
|
|
102
102
|
readonly VoyageAIByMongoDB: "VoyageAI by MongoDB";
|
|
103
|
+
readonly TypeSafe: "TypeSafe";
|
|
103
104
|
readonly NearAI: "Near AI";
|
|
104
105
|
readonly Nebius: "Nebius";
|
|
105
106
|
readonly NexAGI: "Nex AGI";
|
|
@@ -8,6 +8,10 @@ import { STTWord } from "./sttword.js";
|
|
|
8
8
|
* STT response containing transcribed text and optional usage statistics
|
|
9
9
|
*/
|
|
10
10
|
export type STTResponse = {
|
|
11
|
+
/**
|
|
12
|
+
* Provider confidence for the whole transcript from 0 to 1, present when response_format is verbose_json and the provider scores the full transcript
|
|
13
|
+
*/
|
|
14
|
+
confidence?: number | undefined;
|
|
11
15
|
/**
|
|
12
16
|
* Duration of the input audio in seconds, present when response_format is verbose_json
|
|
13
17
|
*/
|
|
@@ -10,6 +10,7 @@ import { STTWord$inboundSchema } from "./sttword.js";
|
|
|
10
10
|
/** @internal */
|
|
11
11
|
export const STTResponse$inboundSchema = z
|
|
12
12
|
.object({
|
|
13
|
+
confidence: z.number().optional(),
|
|
13
14
|
duration: z.number().optional(),
|
|
14
15
|
language: z.string().optional(),
|
|
15
16
|
segments: z.array(STTSegment$inboundSchema).optional(),
|
package/esm/models/sttword.d.ts
CHANGED
|
@@ -5,6 +5,10 @@ import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
|
5
5
|
* A timestamped word, returned when the provider includes word-level timestamps
|
|
6
6
|
*/
|
|
7
7
|
export type STTWord = {
|
|
8
|
+
/**
|
|
9
|
+
* Provider confidence for the word from 0 to 1, present when the provider returns per-word confidence
|
|
10
|
+
*/
|
|
11
|
+
confidence?: number | undefined;
|
|
8
12
|
/**
|
|
9
13
|
* Word end time in seconds
|
|
10
14
|
*/
|
package/esm/models/sttword.js
CHANGED
|
@@ -418,6 +418,9 @@ export type VideoGenerationRequestOptions = {
|
|
|
418
418
|
togetherLite?: {
|
|
419
419
|
[k: string]: any;
|
|
420
420
|
} | undefined;
|
|
421
|
+
typesafe?: {
|
|
422
|
+
[k: string]: any;
|
|
423
|
+
} | undefined;
|
|
421
424
|
ubicloud?: {
|
|
422
425
|
[k: string]: any;
|
|
423
426
|
} | undefined;
|
|
@@ -935,6 +938,9 @@ export type VideoGenerationRequestOptions$Outbound = {
|
|
|
935
938
|
"together-lite"?: {
|
|
936
939
|
[k: string]: any;
|
|
937
940
|
} | undefined;
|
|
941
|
+
typesafe?: {
|
|
942
|
+
[k: string]: any;
|
|
943
|
+
} | undefined;
|
|
938
944
|
ubicloud?: {
|
|
939
945
|
[k: string]: any;
|
|
940
946
|
} | undefined;
|
|
@@ -169,6 +169,7 @@ export const VideoGenerationRequestOptions$outboundSchema = z.object({
|
|
|
169
169
|
thinkingmachines: z.record(z.string(), z.any()).optional(),
|
|
170
170
|
together: z.record(z.string(), z.any()).optional(),
|
|
171
171
|
togetherLite: z.record(z.string(), z.any()).optional(),
|
|
172
|
+
typesafe: z.record(z.string(), z.any()).optional(),
|
|
172
173
|
ubicloud: z.record(z.string(), z.any()).optional(),
|
|
173
174
|
upstage: z.record(z.string(), z.any()).optional(),
|
|
174
175
|
venice: z.record(z.string(), z.any()).optional(),
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
|
|
2
|
+
import * as models from "../models/index.js";
|
|
3
|
+
import * as operations from "../models/operations/index.js";
|
|
4
|
+
export declare class Decisions extends ClientSDK {
|
|
5
|
+
/**
|
|
6
|
+
* Submit a Decisions (questions and answers) request
|
|
7
|
+
*
|
|
8
|
+
* @remarks
|
|
9
|
+
* Submits a Decisions request to the Decisions router
|
|
10
|
+
*/
|
|
11
|
+
decisions(request: operations.CreateApiAlphaDecisionsRequest, options?: RequestOptions): Promise<models.DecisionsResponse>;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=decisions.d.ts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 0e5d2e557690
|
|
4
|
+
*/
|
|
5
|
+
import { decisionsDecisions } from "../funcs/decisionsDecisions.js";
|
|
6
|
+
import { ClientSDK } from "../lib/sdks.js";
|
|
7
|
+
import { unwrapAsync } from "../types/fp.js";
|
|
8
|
+
export class Decisions extends ClientSDK {
|
|
9
|
+
/**
|
|
10
|
+
* Submit a Decisions (questions and answers) request
|
|
11
|
+
*
|
|
12
|
+
* @remarks
|
|
13
|
+
* Submits a Decisions request to the Decisions router
|
|
14
|
+
*/
|
|
15
|
+
async decisions(request, options) {
|
|
16
|
+
return unwrapAsync(decisionsDecisions(this, request, options));
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=decisions.js.map
|
package/esm/sdk/sdk.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ import { Classifications } from "./classifications.js";
|
|
|
9
9
|
import { Containers } from "./containers.js";
|
|
10
10
|
import { Credits } from "./credits.js";
|
|
11
11
|
import { Datasets } from "./datasets.js";
|
|
12
|
+
import { Decisions } from "./decisions.js";
|
|
12
13
|
import { Embeddings } from "./embeddings.js";
|
|
13
14
|
import { Endpoints } from "./endpoints.js";
|
|
14
15
|
import { Files } from "./files.js";
|
|
@@ -39,6 +40,8 @@ export { ToolType };
|
|
|
39
40
|
export declare class OpenRouter extends ClientSDK {
|
|
40
41
|
private _analytics?;
|
|
41
42
|
get analytics(): Analytics;
|
|
43
|
+
private _decisions?;
|
|
44
|
+
get decisions(): Decisions;
|
|
42
45
|
private _tts?;
|
|
43
46
|
get tts(): TTS;
|
|
44
47
|
private _stt?;
|
package/esm/sdk/sdk.js
CHANGED
|
@@ -13,6 +13,7 @@ import { Classifications } from "./classifications.js";
|
|
|
13
13
|
import { Containers } from "./containers.js";
|
|
14
14
|
import { Credits } from "./credits.js";
|
|
15
15
|
import { Datasets } from "./datasets.js";
|
|
16
|
+
import { Decisions } from "./decisions.js";
|
|
16
17
|
import { Embeddings } from "./embeddings.js";
|
|
17
18
|
import { Endpoints } from "./endpoints.js";
|
|
18
19
|
import { Files } from "./files.js";
|
|
@@ -42,6 +43,9 @@ export class OpenRouter extends ClientSDK {
|
|
|
42
43
|
get analytics() {
|
|
43
44
|
return (this._analytics ?? (this._analytics = new Analytics(this._options)));
|
|
44
45
|
}
|
|
46
|
+
get decisions() {
|
|
47
|
+
return (this._decisions ?? (this._decisions = new Decisions(this._options)));
|
|
48
|
+
}
|
|
45
49
|
get tts() {
|
|
46
50
|
return (this._tts ?? (this._tts = new TTS(this._options)));
|
|
47
51
|
}
|
package/jsr.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openrouter/sdk",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.140",
|
|
4
4
|
"author": "OpenRouter",
|
|
5
5
|
"description": "The OpenRouter TypeScript SDK is a type-safe toolkit for building AI applications with access to 400+ language models through a unified API.",
|
|
6
6
|
"keywords": [
|
|
@@ -73,14 +73,14 @@
|
|
|
73
73
|
"lint": "eslint --cache --max-warnings=0 src",
|
|
74
74
|
"build": "tsc",
|
|
75
75
|
"prepublishOnly": "npm run build",
|
|
76
|
-
"typecheck": "tsc --noEmit",
|
|
77
76
|
"test": "vitest --run --project unit",
|
|
78
|
-
"test:e2e": "vitest --run --project e2e",
|
|
79
77
|
"test:transit": "exit 0",
|
|
80
78
|
"test:watch": "vitest --watch --project unit",
|
|
79
|
+
"postinstall": "node scripts/check-types.js || true",
|
|
80
|
+
"test:e2e": "vitest --run --project e2e",
|
|
81
|
+
"typecheck": "tsc --noEmit",
|
|
81
82
|
"typecheck:transit": "exit 0",
|
|
82
83
|
"compile": "tsc",
|
|
83
|
-
"postinstall": "node scripts/check-types.js || true",
|
|
84
84
|
"prepare": "npm run build"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {},
|