@openrouter/sdk 0.13.55 → 0.13.56
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/chatrequest.d.ts +6 -0
- package/esm/models/chatrequest.js +2 -0
- package/esm/models/index.d.ts +2 -0
- package/esm/models/index.js +2 -0
- package/esm/models/parameter.d.ts +1 -0
- package/esm/models/parameter.js +1 -0
- package/esm/models/prediction.d.ts +31 -0
- package/esm/models/prediction.js +26 -0
- package/esm/models/predictioncontenttext.d.ts +24 -0
- package/esm/models/predictioncontenttext.js +19 -0
- package/jsr.json +1 -1
- package/package.json +5 -5
package/esm/lib/config.d.ts
CHANGED
|
@@ -49,8 +49,8 @@ export declare function serverURLFromOptions(options: SDKOptions): URL | null;
|
|
|
49
49
|
export declare const SDK_METADATA: {
|
|
50
50
|
readonly language: "typescript";
|
|
51
51
|
readonly openapiDocVersion: "1.0.0";
|
|
52
|
-
readonly sdkVersion: "0.13.
|
|
52
|
+
readonly sdkVersion: "0.13.56";
|
|
53
53
|
readonly genVersion: "2.884.4";
|
|
54
|
-
readonly userAgent: "speakeasy-sdk/typescript 0.13.
|
|
54
|
+
readonly userAgent: "speakeasy-sdk/typescript 0.13.56 2.884.4 1.0.0 @openrouter/sdk";
|
|
55
55
|
};
|
|
56
56
|
//# sourceMappingURL=config.d.ts.map
|
package/esm/lib/config.js
CHANGED
|
@@ -26,8 +26,8 @@ export function serverURLFromOptions(options) {
|
|
|
26
26
|
export const SDK_METADATA = {
|
|
27
27
|
language: "typescript",
|
|
28
28
|
openapiDocVersion: "1.0.0",
|
|
29
|
-
sdkVersion: "0.13.
|
|
29
|
+
sdkVersion: "0.13.56",
|
|
30
30
|
genVersion: "2.884.4",
|
|
31
|
-
userAgent: "speakeasy-sdk/typescript 0.13.
|
|
31
|
+
userAgent: "speakeasy-sdk/typescript 0.13.56 2.884.4 1.0.0 @openrouter/sdk",
|
|
32
32
|
};
|
|
33
33
|
//# sourceMappingURL=config.js.map
|
|
@@ -19,6 +19,7 @@ import { FusionPlugin, FusionPlugin$Outbound } from "./fusionplugin.js";
|
|
|
19
19
|
import { ImageConfig, ImageConfig$Outbound } from "./imageconfig.js";
|
|
20
20
|
import { ModerationPlugin, ModerationPlugin$Outbound } from "./moderationplugin.js";
|
|
21
21
|
import { ParetoRouterPlugin, ParetoRouterPlugin$Outbound } from "./paretorouterplugin.js";
|
|
22
|
+
import { Prediction, Prediction$Outbound } from "./prediction.js";
|
|
22
23
|
import { PromptCacheOptions, PromptCacheOptions$Outbound } from "./promptcacheoptions.js";
|
|
23
24
|
import { ProviderPreferences, ProviderPreferences$Outbound } from "./providerpreferences.js";
|
|
24
25
|
import { ResponseHealingPlugin, ResponseHealingPlugin$Outbound } from "./responsehealingplugin.js";
|
|
@@ -171,6 +172,10 @@ export type ChatRequest = {
|
|
|
171
172
|
* Plugins you want to enable for this request, including their settings.
|
|
172
173
|
*/
|
|
173
174
|
plugins?: Array<AutoRouterPlugin | ContextCompressionPlugin | FileParserPlugin | FusionPlugin | ModerationPlugin | ParetoRouterPlugin | ResponseHealingPlugin | WebSearchPlugin | WebFetchPlugin> | undefined;
|
|
175
|
+
/**
|
|
176
|
+
* Static predicted output content. Supported models can use this to reduce latency when much of the response is known in advance.
|
|
177
|
+
*/
|
|
178
|
+
prediction?: Prediction | null | undefined;
|
|
174
179
|
/**
|
|
175
180
|
* Presence penalty (-2.0 to 2.0)
|
|
176
181
|
*/
|
|
@@ -320,6 +325,7 @@ export type ChatRequest$Outbound = {
|
|
|
320
325
|
models?: Array<string> | undefined;
|
|
321
326
|
parallel_tool_calls?: boolean | null | undefined;
|
|
322
327
|
plugins?: Array<AutoRouterPlugin$Outbound | ContextCompressionPlugin$Outbound | FileParserPlugin$Outbound | FusionPlugin$Outbound | ModerationPlugin$Outbound | ParetoRouterPlugin$Outbound | ResponseHealingPlugin$Outbound | WebSearchPlugin$Outbound | WebFetchPlugin$Outbound> | undefined;
|
|
328
|
+
prediction?: Prediction$Outbound | null | undefined;
|
|
323
329
|
presence_penalty?: number | null | undefined;
|
|
324
330
|
prompt_cache_key?: string | null | undefined;
|
|
325
331
|
prompt_cache_options?: PromptCacheOptions$Outbound | null | undefined;
|
|
@@ -24,6 +24,7 @@ import { FusionPlugin$outboundSchema, } from "./fusionplugin.js";
|
|
|
24
24
|
import { ImageConfig$outboundSchema, } from "./imageconfig.js";
|
|
25
25
|
import { ModerationPlugin$outboundSchema, } from "./moderationplugin.js";
|
|
26
26
|
import { ParetoRouterPlugin$outboundSchema, } from "./paretorouterplugin.js";
|
|
27
|
+
import { Prediction$outboundSchema, } from "./prediction.js";
|
|
27
28
|
import { PromptCacheOptions$outboundSchema, } from "./promptcacheoptions.js";
|
|
28
29
|
import { ProviderPreferences$outboundSchema, } from "./providerpreferences.js";
|
|
29
30
|
import { ResponseHealingPlugin$outboundSchema, } from "./responsehealingplugin.js";
|
|
@@ -151,6 +152,7 @@ export const ChatRequest$outboundSchema = z.object({
|
|
|
151
152
|
WebSearchPlugin$outboundSchema,
|
|
152
153
|
WebFetchPlugin$outboundSchema,
|
|
153
154
|
])).optional(),
|
|
155
|
+
prediction: z.nullable(Prediction$outboundSchema).optional(),
|
|
154
156
|
presencePenalty: z.nullable(z.number()).optional(),
|
|
155
157
|
promptCacheKey: z.nullable(z.string()).optional(),
|
|
156
158
|
promptCacheOptions: z.nullable(PromptCacheOptions$outboundSchema).optional(),
|
package/esm/models/index.d.ts
CHANGED
|
@@ -396,6 +396,8 @@ export * from "./percentilethroughputcutoffs.js";
|
|
|
396
396
|
export * from "./perrequestlimits.js";
|
|
397
397
|
export * from "./pipelinestage.js";
|
|
398
398
|
export * from "./pipelinestagetype.js";
|
|
399
|
+
export * from "./prediction.js";
|
|
400
|
+
export * from "./predictioncontenttext.js";
|
|
399
401
|
export * from "./preferredmaxlatency.js";
|
|
400
402
|
export * from "./preferredminthroughput.js";
|
|
401
403
|
export * from "./preset.js";
|
package/esm/models/index.js
CHANGED
|
@@ -400,6 +400,8 @@ export * from "./percentilethroughputcutoffs.js";
|
|
|
400
400
|
export * from "./perrequestlimits.js";
|
|
401
401
|
export * from "./pipelinestage.js";
|
|
402
402
|
export * from "./pipelinestagetype.js";
|
|
403
|
+
export * from "./prediction.js";
|
|
404
|
+
export * from "./predictioncontenttext.js";
|
|
403
405
|
export * from "./preferredmaxlatency.js";
|
|
404
406
|
export * from "./preferredminthroughput.js";
|
|
405
407
|
export * from "./preset.js";
|
|
@@ -14,6 +14,7 @@ export declare const Parameter: {
|
|
|
14
14
|
readonly LogitBias: "logit_bias";
|
|
15
15
|
readonly Logprobs: "logprobs";
|
|
16
16
|
readonly TopLogprobs: "top_logprobs";
|
|
17
|
+
readonly Prediction: "prediction";
|
|
17
18
|
readonly Seed: "seed";
|
|
18
19
|
readonly ResponseFormat: "response_format";
|
|
19
20
|
readonly StructuredOutputs: "structured_outputs";
|
package/esm/models/parameter.js
CHANGED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { ClosedEnum } from "../types/enums.js";
|
|
3
|
+
import { PredictionContentText, PredictionContentText$Outbound } from "./predictioncontenttext.js";
|
|
4
|
+
export type PredictionContent = string | Array<PredictionContentText>;
|
|
5
|
+
export declare const PredictionType: {
|
|
6
|
+
readonly Content: "content";
|
|
7
|
+
};
|
|
8
|
+
export type PredictionType = ClosedEnum<typeof PredictionType>;
|
|
9
|
+
/**
|
|
10
|
+
* Static predicted output content. Supported models can use this to reduce latency when much of the response is known in advance.
|
|
11
|
+
*/
|
|
12
|
+
export type Prediction = {
|
|
13
|
+
content: string | Array<PredictionContentText>;
|
|
14
|
+
type: PredictionType;
|
|
15
|
+
};
|
|
16
|
+
/** @internal */
|
|
17
|
+
export type PredictionContent$Outbound = string | Array<PredictionContentText$Outbound>;
|
|
18
|
+
/** @internal */
|
|
19
|
+
export declare const PredictionContent$outboundSchema: z.ZodType<PredictionContent$Outbound, PredictionContent>;
|
|
20
|
+
export declare function predictionContentToJSON(predictionContent: PredictionContent): string;
|
|
21
|
+
/** @internal */
|
|
22
|
+
export declare const PredictionType$outboundSchema: z.ZodEnum<typeof PredictionType>;
|
|
23
|
+
/** @internal */
|
|
24
|
+
export type Prediction$Outbound = {
|
|
25
|
+
content: string | Array<PredictionContentText$Outbound>;
|
|
26
|
+
type: string;
|
|
27
|
+
};
|
|
28
|
+
/** @internal */
|
|
29
|
+
export declare const Prediction$outboundSchema: z.ZodType<Prediction$Outbound, Prediction>;
|
|
30
|
+
export declare function predictionToJSON(prediction: Prediction): string;
|
|
31
|
+
//# sourceMappingURL=prediction.d.ts.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 4fcc379ba382
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { PredictionContentText$outboundSchema, } from "./predictioncontenttext.js";
|
|
7
|
+
export const PredictionType = {
|
|
8
|
+
Content: "content",
|
|
9
|
+
};
|
|
10
|
+
/** @internal */
|
|
11
|
+
export const PredictionContent$outboundSchema = z.union([z.string(), z.array(PredictionContentText$outboundSchema)]);
|
|
12
|
+
export function predictionContentToJSON(predictionContent) {
|
|
13
|
+
return JSON.stringify(PredictionContent$outboundSchema.parse(predictionContent));
|
|
14
|
+
}
|
|
15
|
+
/** @internal */
|
|
16
|
+
export const PredictionType$outboundSchema = z
|
|
17
|
+
.enum(PredictionType);
|
|
18
|
+
/** @internal */
|
|
19
|
+
export const Prediction$outboundSchema = z.object({
|
|
20
|
+
content: z.union([z.string(), z.array(PredictionContentText$outboundSchema)]),
|
|
21
|
+
type: PredictionType$outboundSchema,
|
|
22
|
+
});
|
|
23
|
+
export function predictionToJSON(prediction) {
|
|
24
|
+
return JSON.stringify(Prediction$outboundSchema.parse(prediction));
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=prediction.js.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { ClosedEnum } from "../types/enums.js";
|
|
3
|
+
export declare const PredictionContentTextType: {
|
|
4
|
+
readonly Text: "text";
|
|
5
|
+
};
|
|
6
|
+
export type PredictionContentTextType = ClosedEnum<typeof PredictionContentTextType>;
|
|
7
|
+
/**
|
|
8
|
+
* Text content part for a predicted output.
|
|
9
|
+
*/
|
|
10
|
+
export type PredictionContentText = {
|
|
11
|
+
text: string;
|
|
12
|
+
type: PredictionContentTextType;
|
|
13
|
+
};
|
|
14
|
+
/** @internal */
|
|
15
|
+
export declare const PredictionContentTextType$outboundSchema: z.ZodEnum<typeof PredictionContentTextType>;
|
|
16
|
+
/** @internal */
|
|
17
|
+
export type PredictionContentText$Outbound = {
|
|
18
|
+
text: string;
|
|
19
|
+
type: string;
|
|
20
|
+
};
|
|
21
|
+
/** @internal */
|
|
22
|
+
export declare const PredictionContentText$outboundSchema: z.ZodType<PredictionContentText$Outbound, PredictionContentText>;
|
|
23
|
+
export declare function predictionContentTextToJSON(predictionContentText: PredictionContentText): string;
|
|
24
|
+
//# sourceMappingURL=predictioncontenttext.d.ts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: e7414b3545df
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
export const PredictionContentTextType = {
|
|
7
|
+
Text: "text",
|
|
8
|
+
};
|
|
9
|
+
/** @internal */
|
|
10
|
+
export const PredictionContentTextType$outboundSchema = z.enum(PredictionContentTextType);
|
|
11
|
+
/** @internal */
|
|
12
|
+
export const PredictionContentText$outboundSchema = z.object({
|
|
13
|
+
text: z.string(),
|
|
14
|
+
type: PredictionContentTextType$outboundSchema,
|
|
15
|
+
});
|
|
16
|
+
export function predictionContentTextToJSON(predictionContentText) {
|
|
17
|
+
return JSON.stringify(PredictionContentText$outboundSchema.parse(predictionContentText));
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=predictioncontenttext.js.map
|
package/jsr.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openrouter/sdk",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.56",
|
|
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
|
-
"compile": "tsc",
|
|
77
|
-
"postinstall": "node scripts/check-types.js || true",
|
|
78
76
|
"test": "vitest --run --project unit",
|
|
79
77
|
"test:e2e": "vitest --run --project e2e",
|
|
80
78
|
"test:transit": "exit 0",
|
|
81
79
|
"test:watch": "vitest --watch --project unit",
|
|
82
|
-
"typecheck": "
|
|
80
|
+
"typecheck:transit": "exit 0",
|
|
81
|
+
"compile": "tsc",
|
|
82
|
+
"postinstall": "node scripts/check-types.js || true",
|
|
83
83
|
"prepare": "npm run build",
|
|
84
|
-
"typecheck
|
|
84
|
+
"typecheck": "tsc --noEmit"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {},
|
|
87
87
|
"devDependencies": {
|