@openrouter/sdk 1.2.145 → 1.2.147
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/publicendpoint.d.ts +12 -0
- package/esm/models/publicendpoint.js +14 -0
- package/jsr.json +1 -1
- package/package.json +7 -7
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.147";
|
|
54
54
|
readonly genVersion: "2.914.0";
|
|
55
|
-
readonly userAgent: "speakeasy-sdk/typescript 1.2.
|
|
55
|
+
readonly userAgent: "speakeasy-sdk/typescript 1.2.147 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.147",
|
|
33
33
|
genVersion: "2.914.0",
|
|
34
|
-
userAgent: "speakeasy-sdk/typescript 1.2.
|
|
34
|
+
userAgent: "speakeasy-sdk/typescript 1.2.147 2.914.0 1.0.0 @openrouter/sdk",
|
|
35
35
|
};
|
|
36
36
|
//# sourceMappingURL=config.js.map
|
|
@@ -8,6 +8,14 @@ import { PricingOverride } from "./pricingoverride.js";
|
|
|
8
8
|
import { ProviderName } from "./providername.js";
|
|
9
9
|
import { Quantization } from "./quantization.js";
|
|
10
10
|
import { ToolChoiceSupport } from "./toolchoicesupport.js";
|
|
11
|
+
export type Decisions = {
|
|
12
|
+
latency: PercentileStats | null;
|
|
13
|
+
/**
|
|
14
|
+
* Total requests admitted for this workload in the window.
|
|
15
|
+
*/
|
|
16
|
+
requestCount: number | null;
|
|
17
|
+
throughput: PercentileStats | null;
|
|
18
|
+
};
|
|
11
19
|
export type Embeddings = {
|
|
12
20
|
latency: PercentileStats | null;
|
|
13
21
|
/**
|
|
@@ -76,6 +84,7 @@ export type VideoGeneration = {
|
|
|
76
84
|
* Endpoint performance over the last 30 minutes, keyed by the kind of request served (e.g. `text_generation`, `image_generation`). Additive to the legacy singular latency and throughput fields; image and video generation report end-to-end latency. Only visible when authenticated with an API key or cookie.
|
|
77
85
|
*/
|
|
78
86
|
export type PerfLast30mByWorkload = {
|
|
87
|
+
decisions?: Decisions | undefined;
|
|
79
88
|
embeddings?: Embeddings | undefined;
|
|
80
89
|
imageGeneration?: ImageGeneration | undefined;
|
|
81
90
|
rerank?: Rerank | undefined;
|
|
@@ -202,6 +211,9 @@ export type PublicEndpoint = {
|
|
|
202
211
|
uptimeLast5m: number | null;
|
|
203
212
|
};
|
|
204
213
|
/** @internal */
|
|
214
|
+
export declare const Decisions$inboundSchema: z.ZodType<Decisions, unknown>;
|
|
215
|
+
export declare function decisionsFromJSON(jsonString: string): SafeParseResult<Decisions, SDKValidationError>;
|
|
216
|
+
/** @internal */
|
|
205
217
|
export declare const Embeddings$inboundSchema: z.ZodType<Embeddings, unknown>;
|
|
206
218
|
export declare function embeddingsFromJSON(jsonString: string): SafeParseResult<Embeddings, SDKValidationError>;
|
|
207
219
|
/** @internal */
|
|
@@ -13,6 +13,19 @@ import { ProviderName$inboundSchema } from "./providername.js";
|
|
|
13
13
|
import { Quantization$inboundSchema } from "./quantization.js";
|
|
14
14
|
import { ToolChoiceSupport$inboundSchema, } from "./toolchoicesupport.js";
|
|
15
15
|
/** @internal */
|
|
16
|
+
export const Decisions$inboundSchema = z.object({
|
|
17
|
+
latency: z.nullable(PercentileStats$inboundSchema),
|
|
18
|
+
request_count: z.nullable(z.int()),
|
|
19
|
+
throughput: z.nullable(PercentileStats$inboundSchema),
|
|
20
|
+
}).transform((v) => {
|
|
21
|
+
return remap$(v, {
|
|
22
|
+
"request_count": "requestCount",
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
export function decisionsFromJSON(jsonString) {
|
|
26
|
+
return safeParse(jsonString, (x) => Decisions$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Decisions' from JSON`);
|
|
27
|
+
}
|
|
28
|
+
/** @internal */
|
|
16
29
|
export const Embeddings$inboundSchema = z
|
|
17
30
|
.object({
|
|
18
31
|
latency: z.nullable(PercentileStats$inboundSchema),
|
|
@@ -119,6 +132,7 @@ export function videoGenerationFromJSON(jsonString) {
|
|
|
119
132
|
}
|
|
120
133
|
/** @internal */
|
|
121
134
|
export const PerfLast30mByWorkload$inboundSchema = z.object({
|
|
135
|
+
decisions: z.lazy(() => Decisions$inboundSchema).optional(),
|
|
122
136
|
embeddings: z.lazy(() => Embeddings$inboundSchema).optional(),
|
|
123
137
|
image_generation: z.lazy(() => ImageGeneration$inboundSchema).optional(),
|
|
124
138
|
rerank: z.lazy(() => Rerank$inboundSchema).optional(),
|
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.147",
|
|
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,15 +73,15 @@
|
|
|
73
73
|
"lint": "eslint --cache --max-warnings=0 src",
|
|
74
74
|
"build": "tsc",
|
|
75
75
|
"prepublishOnly": "npm run build",
|
|
76
|
-
"test
|
|
77
|
-
"
|
|
76
|
+
"test": "vitest --run --project unit",
|
|
77
|
+
"typecheck": "tsc --noEmit",
|
|
78
78
|
"typecheck:transit": "exit 0",
|
|
79
|
-
"compile": "tsc",
|
|
80
79
|
"postinstall": "node scripts/check-types.js || true",
|
|
81
|
-
"
|
|
80
|
+
"prepare": "npm run build",
|
|
82
81
|
"test:e2e": "vitest --run --project e2e",
|
|
83
|
-
"
|
|
84
|
-
"
|
|
82
|
+
"test:transit": "exit 0",
|
|
83
|
+
"test:watch": "vitest --watch --project unit",
|
|
84
|
+
"compile": "tsc"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {},
|
|
87
87
|
"devDependencies": {
|