@openrouter/sdk 0.13.19 → 0.13.21
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/chatcontentimage.d.ts +4 -3
- package/esm/models/chatcontentimage.js +2 -1
- package/esm/models/fusionsource.d.ts +28 -0
- package/esm/models/fusionsource.js +24 -0
- package/esm/models/index.d.ts +1 -0
- package/esm/models/index.js +1 -0
- package/esm/models/outputfusionservertoolitem.d.ts +6 -0
- package/esm/models/outputfusionservertoolitem.js +3 -0
- package/jsr.json +1 -1
- package/package.json +4 -4
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.21";
|
|
53
53
|
readonly genVersion: "2.884.4";
|
|
54
|
-
readonly userAgent: "speakeasy-sdk/typescript 0.13.
|
|
54
|
+
readonly userAgent: "speakeasy-sdk/typescript 0.13.21 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.21",
|
|
30
30
|
genVersion: "2.884.4",
|
|
31
|
-
userAgent: "speakeasy-sdk/typescript 0.13.
|
|
31
|
+
userAgent: "speakeasy-sdk/typescript 0.13.21 2.884.4 1.0.0 @openrouter/sdk",
|
|
32
32
|
};
|
|
33
33
|
//# sourceMappingURL=config.js.map
|
|
@@ -3,20 +3,21 @@ 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
5
|
/**
|
|
6
|
-
* Image detail level for vision models
|
|
6
|
+
* Image detail level for vision models. `original` is an OpenRouter extension (not in the OpenAI Chat Completions spec) requesting true original-resolution media; it is downgraded to `high` for providers that lack an original-resolution tier.
|
|
7
7
|
*/
|
|
8
8
|
export declare const ChatContentImageDetail: {
|
|
9
9
|
readonly Auto: "auto";
|
|
10
10
|
readonly Low: "low";
|
|
11
11
|
readonly High: "high";
|
|
12
|
+
readonly Original: "original";
|
|
12
13
|
};
|
|
13
14
|
/**
|
|
14
|
-
* Image detail level for vision models
|
|
15
|
+
* Image detail level for vision models. `original` is an OpenRouter extension (not in the OpenAI Chat Completions spec) requesting true original-resolution media; it is downgraded to `high` for providers that lack an original-resolution tier.
|
|
15
16
|
*/
|
|
16
17
|
export type ChatContentImageDetail = OpenEnum<typeof ChatContentImageDetail>;
|
|
17
18
|
export type ChatContentImageImageUrl = {
|
|
18
19
|
/**
|
|
19
|
-
* Image detail level for vision models
|
|
20
|
+
* Image detail level for vision models. `original` is an OpenRouter extension (not in the OpenAI Chat Completions spec) requesting true original-resolution media; it is downgraded to `high` for providers that lack an original-resolution tier.
|
|
20
21
|
*/
|
|
21
22
|
detail?: ChatContentImageDetail | undefined;
|
|
22
23
|
/**
|
|
@@ -7,12 +7,13 @@ 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
9
|
/**
|
|
10
|
-
* Image detail level for vision models
|
|
10
|
+
* Image detail level for vision models. `original` is an OpenRouter extension (not in the OpenAI Chat Completions spec) requesting true original-resolution media; it is downgraded to `high` for providers that lack an original-resolution tier.
|
|
11
11
|
*/
|
|
12
12
|
export const ChatContentImageDetail = {
|
|
13
13
|
Auto: "auto",
|
|
14
14
|
Low: "low",
|
|
15
15
|
High: "high",
|
|
16
|
+
Original: "original",
|
|
16
17
|
};
|
|
17
18
|
/** @internal */
|
|
18
19
|
export const ChatContentImageDetail$inboundSchema = openEnums.inboundSchema(ChatContentImageDetail);
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
3
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
4
|
+
/**
|
|
5
|
+
* A web page retrieved via web search during a fusion run.
|
|
6
|
+
*/
|
|
7
|
+
export type FusionSource = {
|
|
8
|
+
/**
|
|
9
|
+
* Title of the retrieved web page.
|
|
10
|
+
*/
|
|
11
|
+
title: string;
|
|
12
|
+
/**
|
|
13
|
+
* URL of the web page a panel or the judge retrieved during the run.
|
|
14
|
+
*/
|
|
15
|
+
url: string;
|
|
16
|
+
};
|
|
17
|
+
/** @internal */
|
|
18
|
+
export declare const FusionSource$inboundSchema: z.ZodType<FusionSource, unknown>;
|
|
19
|
+
/** @internal */
|
|
20
|
+
export type FusionSource$Outbound = {
|
|
21
|
+
title: string;
|
|
22
|
+
url: string;
|
|
23
|
+
};
|
|
24
|
+
/** @internal */
|
|
25
|
+
export declare const FusionSource$outboundSchema: z.ZodType<FusionSource$Outbound, FusionSource>;
|
|
26
|
+
export declare function fusionSourceToJSON(fusionSource: FusionSource): string;
|
|
27
|
+
export declare function fusionSourceFromJSON(jsonString: string): SafeParseResult<FusionSource, SDKValidationError>;
|
|
28
|
+
//# sourceMappingURL=fusionsource.d.ts.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 36747573906e
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { safeParse } from "../lib/schemas.js";
|
|
7
|
+
/** @internal */
|
|
8
|
+
export const FusionSource$inboundSchema = z
|
|
9
|
+
.object({
|
|
10
|
+
title: z.string(),
|
|
11
|
+
url: z.string(),
|
|
12
|
+
});
|
|
13
|
+
/** @internal */
|
|
14
|
+
export const FusionSource$outboundSchema = z.object({
|
|
15
|
+
title: z.string(),
|
|
16
|
+
url: z.string(),
|
|
17
|
+
});
|
|
18
|
+
export function fusionSourceToJSON(fusionSource) {
|
|
19
|
+
return JSON.stringify(FusionSource$outboundSchema.parse(fusionSource));
|
|
20
|
+
}
|
|
21
|
+
export function fusionSourceFromJSON(jsonString) {
|
|
22
|
+
return safeParse(jsonString, (x) => FusionSource$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'FusionSource' from JSON`);
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=fusionsource.js.map
|
package/esm/models/index.d.ts
CHANGED
|
@@ -210,6 +210,7 @@ export * from "./fusioncallpanelreasoningdeltaevent.js";
|
|
|
210
210
|
export * from "./fusionplugin.js";
|
|
211
211
|
export * from "./fusionservertoolconfig.js";
|
|
212
212
|
export * from "./fusionservertoolopenrouter.js";
|
|
213
|
+
export * from "./fusionsource.js";
|
|
213
214
|
export * from "./generationcontentdata.js";
|
|
214
215
|
export * from "./generationcontentresponse.js";
|
|
215
216
|
export * from "./generationresponse.js";
|
package/esm/models/index.js
CHANGED
|
@@ -214,6 +214,7 @@ export * from "./fusioncallpanelreasoningdeltaevent.js";
|
|
|
214
214
|
export * from "./fusionplugin.js";
|
|
215
215
|
export * from "./fusionservertoolconfig.js";
|
|
216
216
|
export * from "./fusionservertoolopenrouter.js";
|
|
217
|
+
export * from "./fusionsource.js";
|
|
217
218
|
export * from "./generationcontentdata.js";
|
|
218
219
|
export * from "./generationcontentresponse.js";
|
|
219
220
|
export * from "./generationresponse.js";
|
|
@@ -3,6 +3,7 @@ import { ClosedEnum } from "../types/enums.js";
|
|
|
3
3
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
4
4
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
5
|
import { FusionAnalysisResult, FusionAnalysisResult$Outbound } from "./fusionanalysisresult.js";
|
|
6
|
+
import { FusionSource, FusionSource$Outbound } from "./fusionsource.js";
|
|
6
7
|
import { ToolCallStatus } from "./toolcallstatus.js";
|
|
7
8
|
export type FailedModel = {
|
|
8
9
|
/**
|
|
@@ -51,6 +52,10 @@ export type OutputFusionServerToolItem = {
|
|
|
51
52
|
* Analysis models that produced a response in this fusion run, with each model's full panel content.
|
|
52
53
|
*/
|
|
53
54
|
responses?: Array<ResponseT> | undefined;
|
|
55
|
+
/**
|
|
56
|
+
* Web pages the analysis panels and judge retrieved via web search during this fusion run, deduplicated by URL across the whole run. Present when at least one model cited a source.
|
|
57
|
+
*/
|
|
58
|
+
sources?: Array<FusionSource> | undefined;
|
|
54
59
|
status: ToolCallStatus;
|
|
55
60
|
type: OutputFusionServerToolItemType;
|
|
56
61
|
};
|
|
@@ -91,6 +96,7 @@ export type OutputFusionServerToolItem$Outbound = {
|
|
|
91
96
|
failure_reason?: string | undefined;
|
|
92
97
|
id?: string | undefined;
|
|
93
98
|
responses?: Array<ResponseT$Outbound> | undefined;
|
|
99
|
+
sources?: Array<FusionSource$Outbound> | undefined;
|
|
94
100
|
status: string;
|
|
95
101
|
type: string;
|
|
96
102
|
};
|
|
@@ -6,6 +6,7 @@ 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 { FusionAnalysisResult$inboundSchema, FusionAnalysisResult$outboundSchema, } from "./fusionanalysisresult.js";
|
|
9
|
+
import { FusionSource$inboundSchema, FusionSource$outboundSchema, } from "./fusionsource.js";
|
|
9
10
|
import { ToolCallStatus$inboundSchema, ToolCallStatus$outboundSchema, } from "./toolcallstatus.js";
|
|
10
11
|
export const OutputFusionServerToolItemType = {
|
|
11
12
|
OpenrouterFusion: "openrouter:fusion",
|
|
@@ -65,6 +66,7 @@ export const OutputFusionServerToolItem$inboundSchema = z.object({
|
|
|
65
66
|
failure_reason: z.string().optional(),
|
|
66
67
|
id: z.string().optional(),
|
|
67
68
|
responses: z.array(z.lazy(() => ResponseT$inboundSchema)).optional(),
|
|
69
|
+
sources: z.array(FusionSource$inboundSchema).optional(),
|
|
68
70
|
status: ToolCallStatus$inboundSchema,
|
|
69
71
|
type: OutputFusionServerToolItemType$inboundSchema,
|
|
70
72
|
}).transform((v) => {
|
|
@@ -81,6 +83,7 @@ export const OutputFusionServerToolItem$outboundSchema = z.object({
|
|
|
81
83
|
failureReason: z.string().optional(),
|
|
82
84
|
id: z.string().optional(),
|
|
83
85
|
responses: z.array(z.lazy(() => ResponseT$outboundSchema)).optional(),
|
|
86
|
+
sources: z.array(FusionSource$outboundSchema).optional(),
|
|
84
87
|
status: ToolCallStatus$outboundSchema,
|
|
85
88
|
type: OutputFusionServerToolItemType$outboundSchema,
|
|
86
89
|
}).transform((v) => {
|
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.21",
|
|
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
|
-
"
|
|
76
|
+
"postinstall": "node scripts/check-types.js || true",
|
|
77
77
|
"test": "vitest --run --project unit",
|
|
78
|
-
"compile": "tsc",
|
|
79
78
|
"test:e2e": "vitest --run --project e2e",
|
|
80
79
|
"test:transit": "exit 0",
|
|
81
80
|
"test:watch": "vitest --watch --project unit",
|
|
82
81
|
"typecheck": "tsc --noEmit",
|
|
82
|
+
"prepare": "npm run build",
|
|
83
83
|
"typecheck:transit": "exit 0",
|
|
84
|
-
"
|
|
84
|
+
"compile": "tsc"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {},
|
|
87
87
|
"devDependencies": {
|