@openrouter/sdk 1.5.12 → 1.5.13
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/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/models/decisionsimageasset.d.ts +34 -0
- package/esm/models/decisionsimageasset.js +33 -0
- package/esm/models/decisionsrequest.d.ts +10 -0
- package/esm/models/decisionsrequest.js +2 -0
- package/esm/models/index.d.ts +1 -0
- package/esm/models/index.js +1 -0
- package/esm/models/inputaudio.d.ts +5 -5
- package/esm/models/inputaudio.js +5 -5
- package/jsr.json +1 -1
- package/package.json +5 -5
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.5.
|
|
53
|
+
readonly sdkVersion: "1.5.13";
|
|
54
54
|
readonly genVersion: "2.948.4";
|
|
55
|
-
readonly userAgent: "speakeasy-sdk/typescript 1.5.
|
|
55
|
+
readonly userAgent: "speakeasy-sdk/typescript 1.5.13 2.948.4 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.5.
|
|
32
|
+
sdkVersion: "1.5.13",
|
|
33
33
|
genVersion: "2.948.4",
|
|
34
|
-
userAgent: "speakeasy-sdk/typescript 1.5.
|
|
34
|
+
userAgent: "speakeasy-sdk/typescript 1.5.13 2.948.4 1.0.0 @openrouter/sdk",
|
|
35
35
|
};
|
|
36
36
|
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { ClosedEnum, OpenEnum } from "../types/enums.js";
|
|
3
|
+
export declare const DecisionsImageAssetFormat: {
|
|
4
|
+
readonly Png: "png";
|
|
5
|
+
readonly Jpg: "jpg";
|
|
6
|
+
readonly Jpeg: "jpeg";
|
|
7
|
+
};
|
|
8
|
+
export type DecisionsImageAssetFormat = OpenEnum<typeof DecisionsImageAssetFormat>;
|
|
9
|
+
export declare const DecisionsImageAssetType: {
|
|
10
|
+
readonly Image: "image";
|
|
11
|
+
};
|
|
12
|
+
export type DecisionsImageAssetType = ClosedEnum<typeof DecisionsImageAssetType>;
|
|
13
|
+
/**
|
|
14
|
+
* An image sent once and referenced by its key in the `assets` map. `data_base64` is the PNG or JPEG file in standard base64 with no `data:` prefix. The multipart `part` field of TypeSafe's API is not accepted.
|
|
15
|
+
*/
|
|
16
|
+
export type DecisionsImageAsset = {
|
|
17
|
+
dataBase64: string;
|
|
18
|
+
format: DecisionsImageAssetFormat;
|
|
19
|
+
type?: DecisionsImageAssetType | undefined;
|
|
20
|
+
};
|
|
21
|
+
/** @internal */
|
|
22
|
+
export declare const DecisionsImageAssetFormat$outboundSchema: z.ZodType<string, DecisionsImageAssetFormat>;
|
|
23
|
+
/** @internal */
|
|
24
|
+
export declare const DecisionsImageAssetType$outboundSchema: z.ZodEnum<typeof DecisionsImageAssetType>;
|
|
25
|
+
/** @internal */
|
|
26
|
+
export type DecisionsImageAsset$Outbound = {
|
|
27
|
+
data_base64: string;
|
|
28
|
+
format: string;
|
|
29
|
+
type?: string | undefined;
|
|
30
|
+
};
|
|
31
|
+
/** @internal */
|
|
32
|
+
export declare const DecisionsImageAsset$outboundSchema: z.ZodType<DecisionsImageAsset$Outbound, DecisionsImageAsset>;
|
|
33
|
+
export declare function decisionsImageAssetToJSON(decisionsImageAsset: DecisionsImageAsset): string;
|
|
34
|
+
//# sourceMappingURL=decisionsimageasset.d.ts.map
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 4869a6173b1c
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
|
+
import * as openEnums from "../types/enums.js";
|
|
8
|
+
export const DecisionsImageAssetFormat = {
|
|
9
|
+
Png: "png",
|
|
10
|
+
Jpg: "jpg",
|
|
11
|
+
Jpeg: "jpeg",
|
|
12
|
+
};
|
|
13
|
+
export const DecisionsImageAssetType = {
|
|
14
|
+
Image: "image",
|
|
15
|
+
};
|
|
16
|
+
/** @internal */
|
|
17
|
+
export const DecisionsImageAssetFormat$outboundSchema = openEnums.outboundSchema(DecisionsImageAssetFormat);
|
|
18
|
+
/** @internal */
|
|
19
|
+
export const DecisionsImageAssetType$outboundSchema = z.enum(DecisionsImageAssetType);
|
|
20
|
+
/** @internal */
|
|
21
|
+
export const DecisionsImageAsset$outboundSchema = z.object({
|
|
22
|
+
dataBase64: z.string(),
|
|
23
|
+
format: DecisionsImageAssetFormat$outboundSchema,
|
|
24
|
+
type: DecisionsImageAssetType$outboundSchema.optional(),
|
|
25
|
+
}).transform((v) => {
|
|
26
|
+
return remap$(v, {
|
|
27
|
+
dataBase64: "data_base64",
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
export function decisionsImageAssetToJSON(decisionsImageAsset) {
|
|
31
|
+
return JSON.stringify(DecisionsImageAsset$outboundSchema.parse(decisionsImageAsset));
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=decisionsimageasset.js.map
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as z from "zod/v4";
|
|
2
2
|
import { DecisionsBoxQuestion, DecisionsBoxQuestion$Outbound } from "./decisionsboxquestion.js";
|
|
3
3
|
import { DecisionsChoiceQuestion, DecisionsChoiceQuestion$Outbound } from "./decisionschoicequestion.js";
|
|
4
|
+
import { DecisionsImageAsset, DecisionsImageAsset$Outbound } from "./decisionsimageasset.js";
|
|
4
5
|
import { DecisionsNoulQuestion, DecisionsNoulQuestion$Outbound } from "./decisionsnoulquestion.js";
|
|
5
6
|
import { DecisionsScoreQuestion, DecisionsScoreQuestion$Outbound } from "./decisionsscorequestion.js";
|
|
6
7
|
import { ProviderPreferences, ProviderPreferences$Outbound } from "./providerpreferences.js";
|
|
@@ -16,6 +17,12 @@ export type State = string | {
|
|
|
16
17
|
[k: string]: any;
|
|
17
18
|
} | Array<any>;
|
|
18
19
|
export type DecisionsRequest = {
|
|
20
|
+
/**
|
|
21
|
+
* Images keyed by reference string, as in TypeSafe's API. Write a reference wherever the image belongs in `state`, `instructions`, or `criteria`; every asset must be referenced at least once. Jev reads a reference as a whole string value or inside longer text. Other Decisions models read a whole-string reference wherever they read an `image_url` part and reject a reference inside longer text.
|
|
22
|
+
*/
|
|
23
|
+
assets?: {
|
|
24
|
+
[k: string]: DecisionsImageAsset;
|
|
25
|
+
} | undefined;
|
|
19
26
|
model: string;
|
|
20
27
|
provider?: ProviderPreferences | null | undefined;
|
|
21
28
|
questions: {
|
|
@@ -51,6 +58,9 @@ export declare const State$outboundSchema: z.ZodType<State$Outbound, State>;
|
|
|
51
58
|
export declare function stateToJSON(state: State): string;
|
|
52
59
|
/** @internal */
|
|
53
60
|
export type DecisionsRequest$Outbound = {
|
|
61
|
+
assets?: {
|
|
62
|
+
[k: string]: DecisionsImageAsset$Outbound;
|
|
63
|
+
} | undefined;
|
|
54
64
|
model: string;
|
|
55
65
|
provider?: ProviderPreferences$Outbound | null | undefined;
|
|
56
66
|
questions: {
|
|
@@ -6,6 +6,7 @@ import * as z from "zod/v4";
|
|
|
6
6
|
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
7
|
import { DecisionsBoxQuestion$outboundSchema, } from "./decisionsboxquestion.js";
|
|
8
8
|
import { DecisionsChoiceQuestion$outboundSchema, } from "./decisionschoicequestion.js";
|
|
9
|
+
import { DecisionsImageAsset$outboundSchema, } from "./decisionsimageasset.js";
|
|
9
10
|
import { DecisionsNoulQuestion$outboundSchema, } from "./decisionsnoulquestion.js";
|
|
10
11
|
import { DecisionsScoreQuestion$outboundSchema, } from "./decisionsscorequestion.js";
|
|
11
12
|
import { ProviderPreferences$outboundSchema, } from "./providerpreferences.js";
|
|
@@ -31,6 +32,7 @@ export function stateToJSON(state) {
|
|
|
31
32
|
}
|
|
32
33
|
/** @internal */
|
|
33
34
|
export const DecisionsRequest$outboundSchema = z.object({
|
|
35
|
+
assets: z.record(z.string(), DecisionsImageAsset$outboundSchema).optional(),
|
|
34
36
|
model: z.string(),
|
|
35
37
|
provider: z.nullable(ProviderPreferences$outboundSchema).optional(),
|
|
36
38
|
questions: z.record(z.string(), z.union([
|
package/esm/models/index.d.ts
CHANGED
|
@@ -295,6 +295,7 @@ export * from "./decisionsboxanswer.js";
|
|
|
295
295
|
export * from "./decisionsboxquestion.js";
|
|
296
296
|
export * from "./decisionschoiceanswer.js";
|
|
297
297
|
export * from "./decisionschoicequestion.js";
|
|
298
|
+
export * from "./decisionsimageasset.js";
|
|
298
299
|
export * from "./decisionsnoulanswer.js";
|
|
299
300
|
export * from "./decisionsnoulquestion.js";
|
|
300
301
|
export * from "./decisionsrequest.js";
|
package/esm/models/index.js
CHANGED
|
@@ -299,6 +299,7 @@ export * from "./decisionsboxanswer.js";
|
|
|
299
299
|
export * from "./decisionsboxquestion.js";
|
|
300
300
|
export * from "./decisionschoiceanswer.js";
|
|
301
301
|
export * from "./decisionschoicequestion.js";
|
|
302
|
+
export * from "./decisionsimageasset.js";
|
|
302
303
|
export * from "./decisionsnoulanswer.js";
|
|
303
304
|
export * from "./decisionsnoulquestion.js";
|
|
304
305
|
export * from "./decisionsrequest.js";
|
|
@@ -2,14 +2,14 @@ import * as z from "zod/v4";
|
|
|
2
2
|
import { OpenEnum } from "../types/enums.js";
|
|
3
3
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
4
4
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
|
-
export declare const
|
|
5
|
+
export declare const InputAudioFormat: {
|
|
6
6
|
readonly Mp3: "mp3";
|
|
7
7
|
readonly Wav: "wav";
|
|
8
8
|
};
|
|
9
|
-
export type
|
|
9
|
+
export type InputAudioFormat = OpenEnum<typeof InputAudioFormat>;
|
|
10
10
|
export type InputAudioInputAudio = {
|
|
11
11
|
data: string;
|
|
12
|
-
format:
|
|
12
|
+
format: InputAudioFormat;
|
|
13
13
|
};
|
|
14
14
|
/**
|
|
15
15
|
* Audio input content item
|
|
@@ -19,9 +19,9 @@ export type InputAudio = {
|
|
|
19
19
|
type: "input_audio";
|
|
20
20
|
};
|
|
21
21
|
/** @internal */
|
|
22
|
-
export declare const
|
|
22
|
+
export declare const InputAudioFormat$inboundSchema: z.ZodType<InputAudioFormat, unknown>;
|
|
23
23
|
/** @internal */
|
|
24
|
-
export declare const
|
|
24
|
+
export declare const InputAudioFormat$outboundSchema: z.ZodType<string, InputAudioFormat>;
|
|
25
25
|
/** @internal */
|
|
26
26
|
export declare const InputAudioInputAudio$inboundSchema: z.ZodType<InputAudioInputAudio, unknown>;
|
|
27
27
|
/** @internal */
|
package/esm/models/inputaudio.js
CHANGED
|
@@ -6,23 +6,23 @@ import * as z from "zod/v4";
|
|
|
6
6
|
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
7
|
import { safeParse } from "../lib/schemas.js";
|
|
8
8
|
import * as openEnums from "../types/enums.js";
|
|
9
|
-
export const
|
|
9
|
+
export const InputAudioFormat = {
|
|
10
10
|
Mp3: "mp3",
|
|
11
11
|
Wav: "wav",
|
|
12
12
|
};
|
|
13
13
|
/** @internal */
|
|
14
|
-
export const
|
|
14
|
+
export const InputAudioFormat$inboundSchema = openEnums.inboundSchema(InputAudioFormat);
|
|
15
15
|
/** @internal */
|
|
16
|
-
export const
|
|
16
|
+
export const InputAudioFormat$outboundSchema = openEnums.outboundSchema(InputAudioFormat);
|
|
17
17
|
/** @internal */
|
|
18
18
|
export const InputAudioInputAudio$inboundSchema = z.object({
|
|
19
19
|
data: z.string(),
|
|
20
|
-
format:
|
|
20
|
+
format: InputAudioFormat$inboundSchema,
|
|
21
21
|
});
|
|
22
22
|
/** @internal */
|
|
23
23
|
export const InputAudioInputAudio$outboundSchema = z.object({
|
|
24
24
|
data: z.string(),
|
|
25
|
-
format:
|
|
25
|
+
format: InputAudioFormat$outboundSchema,
|
|
26
26
|
});
|
|
27
27
|
export function inputAudioInputAudioToJSON(inputAudioInputAudio) {
|
|
28
28
|
return JSON.stringify(InputAudioInputAudio$outboundSchema.parse(inputAudioInputAudio));
|
package/jsr.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openrouter/sdk",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.13",
|
|
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": [
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"license": "Apache-2.0",
|
|
22
22
|
"packageManager": "pnpm@10.22.0",
|
|
23
23
|
"publishConfig": {
|
|
24
|
-
"
|
|
25
|
-
"
|
|
24
|
+
"access": "public",
|
|
25
|
+
"provenance": true
|
|
26
26
|
},
|
|
27
27
|
"type": "module",
|
|
28
28
|
"main": "./esm/index.js",
|
|
@@ -74,13 +74,13 @@
|
|
|
74
74
|
"build": "tsc && node scripts/unbarrel-imports.js",
|
|
75
75
|
"prepublishOnly": "npm run build",
|
|
76
76
|
"postinstall": "node scripts/check-types.js || true",
|
|
77
|
-
"test:
|
|
77
|
+
"test:transit": "exit 0",
|
|
78
78
|
"test:watch": "vitest --watch --project unit",
|
|
79
79
|
"typecheck": "tsc --noEmit",
|
|
80
80
|
"compile": "tsc && node scripts/unbarrel-imports.js",
|
|
81
81
|
"prepare": "npm run build",
|
|
82
82
|
"test": "vitest --run --project unit",
|
|
83
|
-
"test:
|
|
83
|
+
"test:e2e": "vitest --run --project e2e",
|
|
84
84
|
"typecheck:transit": "exit 0"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {
|