@openrouter/sdk 0.13.28 → 0.13.29
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/chatfunctiontool.d.ts +3 -2
- package/esm/models/chatfunctiontool.js +2 -0
- package/esm/models/fusionservertoolopenrouter.d.ts +9 -2
- package/esm/models/fusionservertoolopenrouter.js +6 -1
- package/esm/models/responsesrequest.d.ts +12 -4
- package/esm/models/responsesrequest.js +2 -2
- package/jsr.json +1 -1
- package/package.json +6 -6
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.29";
|
|
53
53
|
readonly genVersion: "2.884.4";
|
|
54
|
-
readonly userAgent: "speakeasy-sdk/typescript 0.13.
|
|
54
|
+
readonly userAgent: "speakeasy-sdk/typescript 0.13.29 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.29",
|
|
30
30
|
genVersion: "2.884.4",
|
|
31
|
-
userAgent: "speakeasy-sdk/typescript 0.13.
|
|
31
|
+
userAgent: "speakeasy-sdk/typescript 0.13.29 2.884.4 1.0.0 @openrouter/sdk",
|
|
32
32
|
};
|
|
33
33
|
//# sourceMappingURL=config.js.map
|
|
@@ -7,6 +7,7 @@ import { ChatSearchModelsServerTool, ChatSearchModelsServerTool$Outbound } from
|
|
|
7
7
|
import { ChatWebSearchShorthand, ChatWebSearchShorthand$Outbound } from "./chatwebsearchshorthand.js";
|
|
8
8
|
import { DatetimeServerTool, DatetimeServerTool$Outbound } from "./datetimeservertool.js";
|
|
9
9
|
import { FilesServerTool, FilesServerTool$Outbound } from "./filesservertool.js";
|
|
10
|
+
import { FusionServerToolOpenRouter, FusionServerToolOpenRouter$Outbound } from "./fusionservertoolopenrouter.js";
|
|
10
11
|
import { ImageGenerationServerToolOpenRouter, ImageGenerationServerToolOpenRouter$Outbound } from "./imagegenerationservertoolopenrouter.js";
|
|
11
12
|
import { OpenRouterWebSearchServerTool, OpenRouterWebSearchServerTool$Outbound } from "./openrouterwebsearchservertool.js";
|
|
12
13
|
import { SubagentServerToolOpenRouter, SubagentServerToolOpenRouter$Outbound } from "./subagentservertoolopenrouter.js";
|
|
@@ -52,7 +53,7 @@ export type ChatFunctionToolFunction = {
|
|
|
52
53
|
/**
|
|
53
54
|
* Tool definition for function calling (regular function or OpenRouter built-in server tool)
|
|
54
55
|
*/
|
|
55
|
-
export type ChatFunctionTool = ChatFunctionToolFunction | AdvisorServerToolOpenRouter | BashServerTool | DatetimeServerTool | FilesServerTool | ImageGenerationServerToolOpenRouter | ChatSearchModelsServerTool | SubagentServerToolOpenRouter | WebFetchServerTool | OpenRouterWebSearchServerTool | ChatWebSearchShorthand;
|
|
56
|
+
export type ChatFunctionTool = ChatFunctionToolFunction | AdvisorServerToolOpenRouter | BashServerTool | DatetimeServerTool | FilesServerTool | FusionServerToolOpenRouter | ImageGenerationServerToolOpenRouter | ChatSearchModelsServerTool | SubagentServerToolOpenRouter | WebFetchServerTool | OpenRouterWebSearchServerTool | ChatWebSearchShorthand;
|
|
56
57
|
/** @internal */
|
|
57
58
|
export type ChatFunctionToolFunctionFunction$Outbound = {
|
|
58
59
|
description?: string | undefined;
|
|
@@ -77,7 +78,7 @@ export type ChatFunctionToolFunction$Outbound = {
|
|
|
77
78
|
export declare const ChatFunctionToolFunction$outboundSchema: z.ZodType<ChatFunctionToolFunction$Outbound, ChatFunctionToolFunction>;
|
|
78
79
|
export declare function chatFunctionToolFunctionToJSON(chatFunctionToolFunction: ChatFunctionToolFunction): string;
|
|
79
80
|
/** @internal */
|
|
80
|
-
export type ChatFunctionTool$Outbound = ChatFunctionToolFunction$Outbound | AdvisorServerToolOpenRouter$Outbound | BashServerTool$Outbound | DatetimeServerTool$Outbound | FilesServerTool$Outbound | ImageGenerationServerToolOpenRouter$Outbound | ChatSearchModelsServerTool$Outbound | SubagentServerToolOpenRouter$Outbound | WebFetchServerTool$Outbound | OpenRouterWebSearchServerTool$Outbound | ChatWebSearchShorthand$Outbound;
|
|
81
|
+
export type ChatFunctionTool$Outbound = ChatFunctionToolFunction$Outbound | AdvisorServerToolOpenRouter$Outbound | BashServerTool$Outbound | DatetimeServerTool$Outbound | FilesServerTool$Outbound | FusionServerToolOpenRouter$Outbound | ImageGenerationServerToolOpenRouter$Outbound | ChatSearchModelsServerTool$Outbound | SubagentServerToolOpenRouter$Outbound | WebFetchServerTool$Outbound | OpenRouterWebSearchServerTool$Outbound | ChatWebSearchShorthand$Outbound;
|
|
81
82
|
/** @internal */
|
|
82
83
|
export declare const ChatFunctionTool$outboundSchema: z.ZodType<ChatFunctionTool$Outbound, ChatFunctionTool>;
|
|
83
84
|
export declare function chatFunctionToolToJSON(chatFunctionTool: ChatFunctionTool): string;
|
|
@@ -11,6 +11,7 @@ import { ChatSearchModelsServerTool$outboundSchema, } from "./chatsearchmodelsse
|
|
|
11
11
|
import { ChatWebSearchShorthand$outboundSchema, } from "./chatwebsearchshorthand.js";
|
|
12
12
|
import { DatetimeServerTool$outboundSchema, } from "./datetimeservertool.js";
|
|
13
13
|
import { FilesServerTool$outboundSchema, } from "./filesservertool.js";
|
|
14
|
+
import { FusionServerToolOpenRouter$outboundSchema, } from "./fusionservertoolopenrouter.js";
|
|
14
15
|
import { ImageGenerationServerToolOpenRouter$outboundSchema, } from "./imagegenerationservertoolopenrouter.js";
|
|
15
16
|
import { OpenRouterWebSearchServerTool$outboundSchema, } from "./openrouterwebsearchservertool.js";
|
|
16
17
|
import { SubagentServerToolOpenRouter$outboundSchema, } from "./subagentservertoolopenrouter.js";
|
|
@@ -50,6 +51,7 @@ export const ChatFunctionTool$outboundSchema = z.union([
|
|
|
50
51
|
BashServerTool$outboundSchema,
|
|
51
52
|
DatetimeServerTool$outboundSchema,
|
|
52
53
|
FilesServerTool$outboundSchema,
|
|
54
|
+
FusionServerToolOpenRouter$outboundSchema,
|
|
53
55
|
ImageGenerationServerToolOpenRouter$outboundSchema,
|
|
54
56
|
ChatSearchModelsServerTool$outboundSchema,
|
|
55
57
|
SubagentServerToolOpenRouter$outboundSchema,
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import * as z from "zod/v4";
|
|
2
|
+
import { ClosedEnum } from "../types/enums.js";
|
|
2
3
|
import { FusionServerToolConfig, FusionServerToolConfig$Outbound } from "./fusionservertoolconfig.js";
|
|
4
|
+
export declare const FusionServerToolOpenRouterType: {
|
|
5
|
+
readonly OpenrouterFusion: "openrouter:fusion";
|
|
6
|
+
};
|
|
7
|
+
export type FusionServerToolOpenRouterType = ClosedEnum<typeof FusionServerToolOpenRouterType>;
|
|
3
8
|
/**
|
|
4
9
|
* OpenRouter built-in server tool: fans out the user prompt to a panel of analysis models, then asks a judge model to summarize their collective output as structured JSON the outer model can synthesize from.
|
|
5
10
|
*/
|
|
@@ -8,12 +13,14 @@ export type FusionServerToolOpenRouter = {
|
|
|
8
13
|
* Configuration for the openrouter:fusion server tool.
|
|
9
14
|
*/
|
|
10
15
|
parameters?: FusionServerToolConfig | undefined;
|
|
11
|
-
type:
|
|
16
|
+
type: FusionServerToolOpenRouterType;
|
|
12
17
|
};
|
|
13
18
|
/** @internal */
|
|
19
|
+
export declare const FusionServerToolOpenRouterType$outboundSchema: z.ZodEnum<typeof FusionServerToolOpenRouterType>;
|
|
20
|
+
/** @internal */
|
|
14
21
|
export type FusionServerToolOpenRouter$Outbound = {
|
|
15
22
|
parameters?: FusionServerToolConfig$Outbound | undefined;
|
|
16
|
-
type:
|
|
23
|
+
type: string;
|
|
17
24
|
};
|
|
18
25
|
/** @internal */
|
|
19
26
|
export declare const FusionServerToolOpenRouter$outboundSchema: z.ZodType<FusionServerToolOpenRouter$Outbound, FusionServerToolOpenRouter>;
|
|
@@ -4,10 +4,15 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import * as z from "zod/v4";
|
|
6
6
|
import { FusionServerToolConfig$outboundSchema, } from "./fusionservertoolconfig.js";
|
|
7
|
+
export const FusionServerToolOpenRouterType = {
|
|
8
|
+
OpenrouterFusion: "openrouter:fusion",
|
|
9
|
+
};
|
|
10
|
+
/** @internal */
|
|
11
|
+
export const FusionServerToolOpenRouterType$outboundSchema = z.enum(FusionServerToolOpenRouterType);
|
|
7
12
|
/** @internal */
|
|
8
13
|
export const FusionServerToolOpenRouter$outboundSchema = z.object({
|
|
9
14
|
parameters: FusionServerToolConfig$outboundSchema.optional(),
|
|
10
|
-
type:
|
|
15
|
+
type: FusionServerToolOpenRouterType$outboundSchema,
|
|
11
16
|
});
|
|
12
17
|
export function fusionServerToolOpenRouterToJSON(fusionServerToolOpenRouter) {
|
|
13
18
|
return JSON.stringify(FusionServerToolOpenRouter$outboundSchema.parse(fusionServerToolOpenRouter));
|
|
@@ -77,7 +77,9 @@ export type ResponsesRequestToolUnion = ResponsesRequestToolFunction | PreviewWe
|
|
|
77
77
|
type: "openrouter:datetime";
|
|
78
78
|
}) | (FilesServerTool & {
|
|
79
79
|
type: "openrouter:files";
|
|
80
|
-
}) | FusionServerToolOpenRouter
|
|
80
|
+
}) | (FusionServerToolOpenRouter & {
|
|
81
|
+
type: "openrouter:fusion";
|
|
82
|
+
}) | (ImageGenerationServerToolOpenRouter & {
|
|
81
83
|
type: "openrouter:image_generation";
|
|
82
84
|
}) | (ChatSearchModelsServerTool & {
|
|
83
85
|
type: "openrouter:experimental__search_models";
|
|
@@ -169,7 +171,9 @@ export type ResponsesRequest = {
|
|
|
169
171
|
type: "openrouter:datetime";
|
|
170
172
|
}) | (FilesServerTool & {
|
|
171
173
|
type: "openrouter:files";
|
|
172
|
-
}) | FusionServerToolOpenRouter
|
|
174
|
+
}) | (FusionServerToolOpenRouter & {
|
|
175
|
+
type: "openrouter:fusion";
|
|
176
|
+
}) | (ImageGenerationServerToolOpenRouter & {
|
|
173
177
|
type: "openrouter:image_generation";
|
|
174
178
|
}) | (ChatSearchModelsServerTool & {
|
|
175
179
|
type: "openrouter:experimental__search_models";
|
|
@@ -220,7 +224,9 @@ export type ResponsesRequestToolUnion$Outbound = ResponsesRequestToolFunction$Ou
|
|
|
220
224
|
type: "openrouter:datetime";
|
|
221
225
|
}) | (FilesServerTool$Outbound & {
|
|
222
226
|
type: "openrouter:files";
|
|
223
|
-
}) | FusionServerToolOpenRouter$Outbound
|
|
227
|
+
}) | (FusionServerToolOpenRouter$Outbound & {
|
|
228
|
+
type: "openrouter:fusion";
|
|
229
|
+
}) | (ImageGenerationServerToolOpenRouter$Outbound & {
|
|
224
230
|
type: "openrouter:image_generation";
|
|
225
231
|
}) | (ChatSearchModelsServerTool$Outbound & {
|
|
226
232
|
type: "openrouter:experimental__search_models";
|
|
@@ -277,7 +283,9 @@ export type ResponsesRequest$Outbound = {
|
|
|
277
283
|
type: "openrouter:datetime";
|
|
278
284
|
}) | (FilesServerTool$Outbound & {
|
|
279
285
|
type: "openrouter:files";
|
|
280
|
-
}) | FusionServerToolOpenRouter$Outbound
|
|
286
|
+
}) | (FusionServerToolOpenRouter$Outbound & {
|
|
287
|
+
type: "openrouter:fusion";
|
|
288
|
+
}) | (ImageGenerationServerToolOpenRouter$Outbound & {
|
|
281
289
|
type: "openrouter:image_generation";
|
|
282
290
|
}) | (ChatSearchModelsServerTool$Outbound & {
|
|
283
291
|
type: "openrouter:experimental__search_models";
|
|
@@ -108,7 +108,7 @@ export const ResponsesRequestToolUnion$outboundSchema = z.union([
|
|
|
108
108
|
SubagentServerToolOpenRouter$outboundSchema.and(z.object({ type: z.literal("openrouter:subagent") })),
|
|
109
109
|
DatetimeServerTool$outboundSchema.and(z.object({ type: z.literal("openrouter:datetime") })),
|
|
110
110
|
FilesServerTool$outboundSchema.and(z.object({ type: z.literal("openrouter:files") })),
|
|
111
|
-
FusionServerToolOpenRouter$outboundSchema,
|
|
111
|
+
FusionServerToolOpenRouter$outboundSchema.and(z.object({ type: z.literal("openrouter:fusion") })),
|
|
112
112
|
ImageGenerationServerToolOpenRouter$outboundSchema.and(z.object({ type: z.literal("openrouter:image_generation") })),
|
|
113
113
|
ChatSearchModelsServerTool$outboundSchema.and(z.object({ type: z.literal("openrouter:experimental__search_models") })),
|
|
114
114
|
WebFetchServerTool$outboundSchema.and(z.object({ type: z.literal("openrouter:web_fetch") })),
|
|
@@ -183,7 +183,7 @@ export const ResponsesRequest$outboundSchema = z.object({
|
|
|
183
183
|
SubagentServerToolOpenRouter$outboundSchema.and(z.object({ type: z.literal("openrouter:subagent") })),
|
|
184
184
|
DatetimeServerTool$outboundSchema.and(z.object({ type: z.literal("openrouter:datetime") })),
|
|
185
185
|
FilesServerTool$outboundSchema.and(z.object({ type: z.literal("openrouter:files") })),
|
|
186
|
-
FusionServerToolOpenRouter$outboundSchema,
|
|
186
|
+
FusionServerToolOpenRouter$outboundSchema.and(z.object({ type: z.literal("openrouter:fusion") })),
|
|
187
187
|
ImageGenerationServerToolOpenRouter$outboundSchema.and(z.object({ type: z.literal("openrouter:image_generation") })),
|
|
188
188
|
ChatSearchModelsServerTool$outboundSchema.and(z.object({ type: z.literal("openrouter:experimental__search_models") })),
|
|
189
189
|
WebFetchServerTool$outboundSchema.and(z.object({ type: z.literal("openrouter:web_fetch") })),
|
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.29",
|
|
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
|
-
"prepare": "npm run build",
|
|
77
|
-
"test:transit": "exit 0",
|
|
78
|
-
"typecheck": "tsc --noEmit",
|
|
79
76
|
"compile": "tsc",
|
|
80
77
|
"postinstall": "node scripts/check-types.js || true",
|
|
81
78
|
"test": "vitest --run --project unit",
|
|
82
79
|
"test:e2e": "vitest --run --project e2e",
|
|
83
|
-
"
|
|
84
|
-
"typecheck:transit": "exit 0"
|
|
80
|
+
"typecheck": "tsc --noEmit",
|
|
81
|
+
"typecheck:transit": "exit 0",
|
|
82
|
+
"prepare": "npm run build",
|
|
83
|
+
"test:transit": "exit 0",
|
|
84
|
+
"test:watch": "vitest --watch --project unit"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {},
|
|
87
87
|
"devDependencies": {
|