@openrouter/sdk 0.12.18 → 0.12.20
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/chatwebsearchshorthand.d.ts +1 -1
- package/esm/models/generationresponse.d.ts +4 -0
- package/esm/models/generationresponse.js +2 -0
- package/esm/models/index.d.ts +3 -0
- package/esm/models/index.js +3 -0
- package/esm/models/outputmodality.d.ts +1 -1
- package/esm/models/outputmodality.js +1 -1
- package/esm/models/providername.d.ts +1 -0
- package/esm/models/providername.js +1 -0
- package/esm/models/providerresponse.d.ts +1 -0
- package/esm/models/providerresponse.js +1 -0
- package/esm/models/responsesrequest.d.ts +9 -0
- package/esm/models/responsesrequest.js +3 -0
- package/esm/models/searchqualitylevel.d.ts +2 -2
- package/esm/models/searchqualitylevel.js +1 -1
- package/esm/models/speechrequest.d.ts +6 -0
- package/esm/models/speechrequest.js +2 -0
- package/esm/models/videogenerationrequest.d.ts +6 -0
- package/esm/models/videogenerationrequest.js +2 -0
- package/esm/models/webfetchengineenum.d.ts +19 -0
- package/esm/models/webfetchengineenum.js +18 -0
- package/esm/models/webfetchservertool.d.ts +28 -0
- package/esm/models/webfetchservertool.js +20 -0
- package/esm/models/webfetchservertoolconfig.d.ts +39 -0
- package/esm/models/webfetchservertoolconfig.js +26 -0
- package/esm/models/websearchconfig.d.ts +1 -1
- 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.12.
|
|
52
|
+
readonly sdkVersion: "0.12.20";
|
|
53
53
|
readonly genVersion: "2.879.1";
|
|
54
|
-
readonly userAgent: "speakeasy-sdk/typescript 0.12.
|
|
54
|
+
readonly userAgent: "speakeasy-sdk/typescript 0.12.20 2.879.1 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.12.
|
|
29
|
+
sdkVersion: "0.12.20",
|
|
30
30
|
genVersion: "2.879.1",
|
|
31
|
-
userAgent: "speakeasy-sdk/typescript 0.12.
|
|
31
|
+
userAgent: "speakeasy-sdk/typescript 0.12.20 2.879.1 1.0.0 @openrouter/sdk",
|
|
32
32
|
};
|
|
33
33
|
//# sourceMappingURL=config.js.map
|
|
@@ -6,6 +6,7 @@ import { ChatWebSearchShorthand, ChatWebSearchShorthand$Outbound } from "./chatw
|
|
|
6
6
|
import { DatetimeServerTool, DatetimeServerTool$Outbound } from "./datetimeservertool.js";
|
|
7
7
|
import { ImageGenerationServerToolOpenRouter, ImageGenerationServerToolOpenRouter$Outbound } from "./imagegenerationservertoolopenrouter.js";
|
|
8
8
|
import { OpenRouterWebSearchServerTool, OpenRouterWebSearchServerTool$Outbound } from "./openrouterwebsearchservertool.js";
|
|
9
|
+
import { WebFetchServerTool, WebFetchServerTool$Outbound } from "./webfetchservertool.js";
|
|
9
10
|
/**
|
|
10
11
|
* Function definition for tool calling
|
|
11
12
|
*/
|
|
@@ -47,7 +48,7 @@ export type ChatFunctionToolFunction = {
|
|
|
47
48
|
/**
|
|
48
49
|
* Tool definition for function calling (regular function or OpenRouter built-in server tool)
|
|
49
50
|
*/
|
|
50
|
-
export type ChatFunctionTool = ChatFunctionToolFunction | DatetimeServerTool | ImageGenerationServerToolOpenRouter | ChatSearchModelsServerTool | OpenRouterWebSearchServerTool | ChatWebSearchShorthand;
|
|
51
|
+
export type ChatFunctionTool = ChatFunctionToolFunction | DatetimeServerTool | ImageGenerationServerToolOpenRouter | ChatSearchModelsServerTool | WebFetchServerTool | OpenRouterWebSearchServerTool | ChatWebSearchShorthand;
|
|
51
52
|
/** @internal */
|
|
52
53
|
export type ChatFunctionToolFunctionFunction$Outbound = {
|
|
53
54
|
description?: string | undefined;
|
|
@@ -72,7 +73,7 @@ export type ChatFunctionToolFunction$Outbound = {
|
|
|
72
73
|
export declare const ChatFunctionToolFunction$outboundSchema: z.ZodType<ChatFunctionToolFunction$Outbound, ChatFunctionToolFunction>;
|
|
73
74
|
export declare function chatFunctionToolFunctionToJSON(chatFunctionToolFunction: ChatFunctionToolFunction): string;
|
|
74
75
|
/** @internal */
|
|
75
|
-
export type ChatFunctionTool$Outbound = ChatFunctionToolFunction$Outbound | DatetimeServerTool$Outbound | ImageGenerationServerToolOpenRouter$Outbound | ChatSearchModelsServerTool$Outbound | OpenRouterWebSearchServerTool$Outbound | ChatWebSearchShorthand$Outbound;
|
|
76
|
+
export type ChatFunctionTool$Outbound = ChatFunctionToolFunction$Outbound | DatetimeServerTool$Outbound | ImageGenerationServerToolOpenRouter$Outbound | ChatSearchModelsServerTool$Outbound | WebFetchServerTool$Outbound | OpenRouterWebSearchServerTool$Outbound | ChatWebSearchShorthand$Outbound;
|
|
76
77
|
/** @internal */
|
|
77
78
|
export declare const ChatFunctionTool$outboundSchema: z.ZodType<ChatFunctionTool$Outbound, ChatFunctionTool>;
|
|
78
79
|
export declare function chatFunctionToolToJSON(chatFunctionTool: ChatFunctionTool): string;
|
|
@@ -10,6 +10,7 @@ import { ChatWebSearchShorthand$outboundSchema, } from "./chatwebsearchshorthand
|
|
|
10
10
|
import { DatetimeServerTool$outboundSchema, } from "./datetimeservertool.js";
|
|
11
11
|
import { ImageGenerationServerToolOpenRouter$outboundSchema, } from "./imagegenerationservertoolopenrouter.js";
|
|
12
12
|
import { OpenRouterWebSearchServerTool$outboundSchema, } from "./openrouterwebsearchservertool.js";
|
|
13
|
+
import { WebFetchServerTool$outboundSchema, } from "./webfetchservertool.js";
|
|
13
14
|
export const ChatFunctionToolType = {
|
|
14
15
|
Function: "function",
|
|
15
16
|
};
|
|
@@ -44,6 +45,7 @@ export const ChatFunctionTool$outboundSchema = z.union([
|
|
|
44
45
|
DatetimeServerTool$outboundSchema,
|
|
45
46
|
ImageGenerationServerToolOpenRouter$outboundSchema,
|
|
46
47
|
ChatSearchModelsServerTool$outboundSchema,
|
|
48
|
+
WebFetchServerTool$outboundSchema,
|
|
47
49
|
OpenRouterWebSearchServerTool$outboundSchema,
|
|
48
50
|
ChatWebSearchShorthand$outboundSchema,
|
|
49
51
|
]);
|
|
@@ -37,7 +37,7 @@ export type ChatWebSearchShorthand = {
|
|
|
37
37
|
maxTotalResults?: number | undefined;
|
|
38
38
|
parameters?: WebSearchConfig | undefined;
|
|
39
39
|
/**
|
|
40
|
-
* How much context to retrieve per result. Defaults to medium (15000 chars).
|
|
40
|
+
* How much context to retrieve per result. Defaults to medium (15000 chars). Applies to Exa and Parallel engines; ignored with native provider search and Firecrawl.
|
|
41
41
|
*/
|
|
42
42
|
searchContextSize?: SearchQualityLevel | undefined;
|
|
43
43
|
type: ChatWebSearchShorthandType;
|
|
@@ -101,6 +101,10 @@ export type GenerationResponseData = {
|
|
|
101
101
|
* Native reasoning tokens as reported by provider
|
|
102
102
|
*/
|
|
103
103
|
nativeTokensReasoning: number | null;
|
|
104
|
+
/**
|
|
105
|
+
* Number of web fetches performed
|
|
106
|
+
*/
|
|
107
|
+
numFetches: number | null;
|
|
104
108
|
/**
|
|
105
109
|
* Number of audio inputs in the prompt
|
|
106
110
|
*/
|
|
@@ -42,6 +42,7 @@ export const GenerationResponseData$inboundSchema = z.object({
|
|
|
42
42
|
native_tokens_completion_images: z.nullable(z.int()),
|
|
43
43
|
native_tokens_prompt: z.nullable(z.int()),
|
|
44
44
|
native_tokens_reasoning: z.nullable(z.int()),
|
|
45
|
+
num_fetches: z.nullable(z.int()),
|
|
45
46
|
num_input_audio_prompt: z.nullable(z.int()),
|
|
46
47
|
num_media_completion: z.nullable(z.int()),
|
|
47
48
|
num_media_prompt: z.nullable(z.int()),
|
|
@@ -79,6 +80,7 @@ export const GenerationResponseData$inboundSchema = z.object({
|
|
|
79
80
|
"native_tokens_completion_images": "nativeTokensCompletionImages",
|
|
80
81
|
"native_tokens_prompt": "nativeTokensPrompt",
|
|
81
82
|
"native_tokens_reasoning": "nativeTokensReasoning",
|
|
83
|
+
"num_fetches": "numFetches",
|
|
82
84
|
"num_input_audio_prompt": "numInputAudioPrompt",
|
|
83
85
|
"num_media_completion": "numMediaCompletion",
|
|
84
86
|
"num_media_prompt": "numMediaPrompt",
|
package/esm/models/index.d.ts
CHANGED
|
@@ -272,6 +272,9 @@ export * from "./videogenerationresponse.js";
|
|
|
272
272
|
export * from "./videogenerationusage.js";
|
|
273
273
|
export * from "./videomodel.js";
|
|
274
274
|
export * from "./videomodelslistresponse.js";
|
|
275
|
+
export * from "./webfetchengineenum.js";
|
|
276
|
+
export * from "./webfetchservertool.js";
|
|
277
|
+
export * from "./webfetchservertoolconfig.js";
|
|
275
278
|
export * from "./websearchcallcompletedevent.js";
|
|
276
279
|
export * from "./websearchcallinprogressevent.js";
|
|
277
280
|
export * from "./websearchcallsearchingevent.js";
|
package/esm/models/index.js
CHANGED
|
@@ -276,6 +276,9 @@ export * from "./videogenerationresponse.js";
|
|
|
276
276
|
export * from "./videogenerationusage.js";
|
|
277
277
|
export * from "./videomodel.js";
|
|
278
278
|
export * from "./videomodelslistresponse.js";
|
|
279
|
+
export * from "./webfetchengineenum.js";
|
|
280
|
+
export * from "./webfetchservertool.js";
|
|
281
|
+
export * from "./webfetchservertoolconfig.js";
|
|
279
282
|
export * from "./websearchcallcompletedevent.js";
|
|
280
283
|
export * from "./websearchcallinprogressevent.js";
|
|
281
284
|
export * from "./websearchcallsearchingevent.js";
|
|
@@ -7,7 +7,7 @@ export declare const OutputModality: {
|
|
|
7
7
|
readonly Audio: "audio";
|
|
8
8
|
readonly Video: "video";
|
|
9
9
|
readonly Rerank: "rerank";
|
|
10
|
-
readonly
|
|
10
|
+
readonly Speech: "speech";
|
|
11
11
|
};
|
|
12
12
|
export type OutputModality = OpenEnum<typeof OutputModality>;
|
|
13
13
|
/** @internal */
|
|
@@ -86,6 +86,7 @@ export declare const ProviderResponseProviderName: {
|
|
|
86
86
|
readonly Morph: "Morph";
|
|
87
87
|
readonly NCompass: "NCompass";
|
|
88
88
|
readonly Nebius: "Nebius";
|
|
89
|
+
readonly NexAGI: "Nex AGI";
|
|
89
90
|
readonly NextBit: "NextBit";
|
|
90
91
|
readonly Novita: "Novita";
|
|
91
92
|
readonly Nvidia: "Nvidia";
|
|
@@ -32,6 +32,7 @@ import { ShellServerTool, ShellServerTool$Outbound } from "./shellservertool.js"
|
|
|
32
32
|
import { StoredPromptTemplate, StoredPromptTemplate$Outbound } from "./storedprompttemplate.js";
|
|
33
33
|
import { TextExtendedConfig, TextExtendedConfig$Outbound } from "./textextendedconfig.js";
|
|
34
34
|
import { TraceConfig, TraceConfig$Outbound } from "./traceconfig.js";
|
|
35
|
+
import { WebFetchServerTool, WebFetchServerTool$Outbound } from "./webfetchservertool.js";
|
|
35
36
|
import { WebSearchPlugin, WebSearchPlugin$Outbound } from "./websearchplugin.js";
|
|
36
37
|
import { WebSearchServerTool, WebSearchServerTool$Outbound } from "./websearchservertool.js";
|
|
37
38
|
import { WebSearchServerToolOpenRouter, WebSearchServerToolOpenRouter$Outbound } from "./websearchservertoolopenrouter.js";
|
|
@@ -62,6 +63,8 @@ export type ResponsesRequestToolUnion = ResponsesRequestToolFunction | PreviewWe
|
|
|
62
63
|
type: "openrouter:image_generation";
|
|
63
64
|
}) | (ChatSearchModelsServerTool & {
|
|
64
65
|
type: "openrouter:experimental__search_models";
|
|
66
|
+
}) | (WebFetchServerTool & {
|
|
67
|
+
type: "openrouter:web_fetch";
|
|
65
68
|
}) | WebSearchServerToolOpenRouter;
|
|
66
69
|
/**
|
|
67
70
|
* Request schema for Responses endpoint
|
|
@@ -132,6 +135,8 @@ export type ResponsesRequest = {
|
|
|
132
135
|
type: "openrouter:image_generation";
|
|
133
136
|
}) | (ChatSearchModelsServerTool & {
|
|
134
137
|
type: "openrouter:experimental__search_models";
|
|
138
|
+
}) | (WebFetchServerTool & {
|
|
139
|
+
type: "openrouter:web_fetch";
|
|
135
140
|
}) | WebSearchServerToolOpenRouter> | undefined;
|
|
136
141
|
topK?: number | undefined;
|
|
137
142
|
topLogprobs?: number | null | undefined;
|
|
@@ -173,6 +178,8 @@ export type ResponsesRequestToolUnion$Outbound = ResponsesRequestToolFunction$Ou
|
|
|
173
178
|
type: "openrouter:image_generation";
|
|
174
179
|
}) | (ChatSearchModelsServerTool$Outbound & {
|
|
175
180
|
type: "openrouter:experimental__search_models";
|
|
181
|
+
}) | (WebFetchServerTool$Outbound & {
|
|
182
|
+
type: "openrouter:web_fetch";
|
|
176
183
|
}) | WebSearchServerToolOpenRouter$Outbound;
|
|
177
184
|
/** @internal */
|
|
178
185
|
export declare const ResponsesRequestToolUnion$outboundSchema: z.ZodType<ResponsesRequestToolUnion$Outbound, ResponsesRequestToolUnion>;
|
|
@@ -217,6 +224,8 @@ export type ResponsesRequest$Outbound = {
|
|
|
217
224
|
type: "openrouter:image_generation";
|
|
218
225
|
}) | (ChatSearchModelsServerTool$Outbound & {
|
|
219
226
|
type: "openrouter:experimental__search_models";
|
|
227
|
+
}) | (WebFetchServerTool$Outbound & {
|
|
228
|
+
type: "openrouter:web_fetch";
|
|
220
229
|
}) | WebSearchServerToolOpenRouter$Outbound> | undefined;
|
|
221
230
|
top_k?: number | undefined;
|
|
222
231
|
top_logprobs?: number | null | undefined;
|
|
@@ -37,6 +37,7 @@ import { ShellServerTool$outboundSchema, } from "./shellservertool.js";
|
|
|
37
37
|
import { StoredPromptTemplate$outboundSchema, } from "./storedprompttemplate.js";
|
|
38
38
|
import { TextExtendedConfig$outboundSchema, } from "./textextendedconfig.js";
|
|
39
39
|
import { TraceConfig$outboundSchema, } from "./traceconfig.js";
|
|
40
|
+
import { WebFetchServerTool$outboundSchema, } from "./webfetchservertool.js";
|
|
40
41
|
import { WebSearchPlugin$outboundSchema, } from "./websearchplugin.js";
|
|
41
42
|
import { WebSearchServerTool$outboundSchema, } from "./websearchservertool.js";
|
|
42
43
|
import { WebSearchServerToolOpenRouter$outboundSchema, } from "./websearchservertoolopenrouter.js";
|
|
@@ -92,6 +93,7 @@ export const ResponsesRequestToolUnion$outboundSchema = z.union([
|
|
|
92
93
|
DatetimeServerTool$outboundSchema.and(z.object({ type: z.literal("openrouter:datetime") })),
|
|
93
94
|
ImageGenerationServerToolOpenRouter$outboundSchema.and(z.object({ type: z.literal("openrouter:image_generation") })),
|
|
94
95
|
ChatSearchModelsServerTool$outboundSchema.and(z.object({ type: z.literal("openrouter:experimental__search_models") })),
|
|
96
|
+
WebFetchServerTool$outboundSchema.and(z.object({ type: z.literal("openrouter:web_fetch") })),
|
|
95
97
|
WebSearchServerToolOpenRouter$outboundSchema,
|
|
96
98
|
]);
|
|
97
99
|
export function responsesRequestToolUnionToJSON(responsesRequestToolUnion) {
|
|
@@ -153,6 +155,7 @@ export const ResponsesRequest$outboundSchema = z.object({
|
|
|
153
155
|
DatetimeServerTool$outboundSchema.and(z.object({ type: z.literal("openrouter:datetime") })),
|
|
154
156
|
ImageGenerationServerToolOpenRouter$outboundSchema.and(z.object({ type: z.literal("openrouter:image_generation") })),
|
|
155
157
|
ChatSearchModelsServerTool$outboundSchema.and(z.object({ type: z.literal("openrouter:experimental__search_models") })),
|
|
158
|
+
WebFetchServerTool$outboundSchema.and(z.object({ type: z.literal("openrouter:web_fetch") })),
|
|
156
159
|
WebSearchServerToolOpenRouter$outboundSchema,
|
|
157
160
|
])).optional(),
|
|
158
161
|
topK: z.int().optional(),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as z from "zod/v4";
|
|
2
2
|
import { OpenEnum } from "../types/enums.js";
|
|
3
3
|
/**
|
|
4
|
-
* How much context to retrieve per result. Defaults to medium (15000 chars).
|
|
4
|
+
* How much context to retrieve per result. Defaults to medium (15000 chars). Applies to Exa and Parallel engines; ignored with native provider search and Firecrawl.
|
|
5
5
|
*/
|
|
6
6
|
export declare const SearchQualityLevel: {
|
|
7
7
|
readonly Low: "low";
|
|
@@ -9,7 +9,7 @@ export declare const SearchQualityLevel: {
|
|
|
9
9
|
readonly High: "high";
|
|
10
10
|
};
|
|
11
11
|
/**
|
|
12
|
-
* How much context to retrieve per result. Defaults to medium (15000 chars).
|
|
12
|
+
* How much context to retrieve per result. Defaults to medium (15000 chars). Applies to Exa and Parallel engines; ignored with native provider search and Firecrawl.
|
|
13
13
|
*/
|
|
14
14
|
export type SearchQualityLevel = OpenEnum<typeof SearchQualityLevel>;
|
|
15
15
|
/** @internal */
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import * as openEnums from "../types/enums.js";
|
|
6
6
|
/**
|
|
7
|
-
* How much context to retrieve per result. Defaults to medium (15000 chars).
|
|
7
|
+
* How much context to retrieve per result. Defaults to medium (15000 chars). Applies to Exa and Parallel engines; ignored with native provider search and Firecrawl.
|
|
8
8
|
*/
|
|
9
9
|
export const SearchQualityLevel = {
|
|
10
10
|
Low: "low",
|
|
@@ -217,6 +217,9 @@ export type SpeechRequestOptions = {
|
|
|
217
217
|
nebius?: {
|
|
218
218
|
[k: string]: any | null;
|
|
219
219
|
} | undefined;
|
|
220
|
+
nexAgi?: {
|
|
221
|
+
[k: string]: any | null;
|
|
222
|
+
} | undefined;
|
|
220
223
|
nextbit?: {
|
|
221
224
|
[k: string]: any | null;
|
|
222
225
|
} | undefined;
|
|
@@ -590,6 +593,9 @@ export type SpeechRequestOptions$Outbound = {
|
|
|
590
593
|
nebius?: {
|
|
591
594
|
[k: string]: any | null;
|
|
592
595
|
} | undefined;
|
|
596
|
+
"nex-agi"?: {
|
|
597
|
+
[k: string]: any | null;
|
|
598
|
+
} | undefined;
|
|
593
599
|
nextbit?: {
|
|
594
600
|
[k: string]: any | null;
|
|
595
601
|
} | undefined;
|
|
@@ -85,6 +85,7 @@ export const SpeechRequestOptions$outboundSchema = z.object({
|
|
|
85
85
|
morph: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
86
86
|
ncompass: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
87
87
|
nebius: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
88
|
+
nexAgi: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
88
89
|
nextbit: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
89
90
|
nineteen: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
90
91
|
novita: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
@@ -138,6 +139,7 @@ export const SpeechRequestOptions$outboundSchema = z.object({
|
|
|
138
139
|
ioNet: "io-net",
|
|
139
140
|
lynnPrivate: "lynn-private",
|
|
140
141
|
mancerOld: "mancer-old",
|
|
142
|
+
nexAgi: "nex-agi",
|
|
141
143
|
openInference: "open-inference",
|
|
142
144
|
sambanovaCloaked: "sambanova-cloaked",
|
|
143
145
|
sfCompute: "sf-compute",
|
|
@@ -235,6 +235,9 @@ export type VideoGenerationRequestOptions = {
|
|
|
235
235
|
nebius?: {
|
|
236
236
|
[k: string]: any | null;
|
|
237
237
|
} | undefined;
|
|
238
|
+
nexAgi?: {
|
|
239
|
+
[k: string]: any | null;
|
|
240
|
+
} | undefined;
|
|
238
241
|
nextbit?: {
|
|
239
242
|
[k: string]: any | null;
|
|
240
243
|
} | undefined;
|
|
@@ -625,6 +628,9 @@ export type VideoGenerationRequestOptions$Outbound = {
|
|
|
625
628
|
nebius?: {
|
|
626
629
|
[k: string]: any | null;
|
|
627
630
|
} | undefined;
|
|
631
|
+
"nex-agi"?: {
|
|
632
|
+
[k: string]: any | null;
|
|
633
|
+
} | undefined;
|
|
628
634
|
nextbit?: {
|
|
629
635
|
[k: string]: any | null;
|
|
630
636
|
} | undefined;
|
|
@@ -105,6 +105,7 @@ export const VideoGenerationRequestOptions$outboundSchema = z.object({
|
|
|
105
105
|
morph: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
106
106
|
ncompass: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
107
107
|
nebius: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
108
|
+
nexAgi: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
108
109
|
nextbit: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
109
110
|
nineteen: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
110
111
|
novita: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
@@ -158,6 +159,7 @@ export const VideoGenerationRequestOptions$outboundSchema = z.object({
|
|
|
158
159
|
ioNet: "io-net",
|
|
159
160
|
lynnPrivate: "lynn-private",
|
|
160
161
|
mancerOld: "mancer-old",
|
|
162
|
+
nexAgi: "nex-agi",
|
|
161
163
|
openInference: "open-inference",
|
|
162
164
|
sambanovaCloaked: "sambanova-cloaked",
|
|
163
165
|
sfCompute: "sf-compute",
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { OpenEnum } from "../types/enums.js";
|
|
3
|
+
/**
|
|
4
|
+
* Which fetch engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in fetch. "exa" uses Exa Contents API (supports BYOK). "openrouter" uses direct HTTP fetch. "firecrawl" uses Firecrawl scrape (requires BYOK).
|
|
5
|
+
*/
|
|
6
|
+
export declare const WebFetchEngineEnum: {
|
|
7
|
+
readonly Auto: "auto";
|
|
8
|
+
readonly Native: "native";
|
|
9
|
+
readonly Openrouter: "openrouter";
|
|
10
|
+
readonly Firecrawl: "firecrawl";
|
|
11
|
+
readonly Exa: "exa";
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Which fetch engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in fetch. "exa" uses Exa Contents API (supports BYOK). "openrouter" uses direct HTTP fetch. "firecrawl" uses Firecrawl scrape (requires BYOK).
|
|
15
|
+
*/
|
|
16
|
+
export type WebFetchEngineEnum = OpenEnum<typeof WebFetchEngineEnum>;
|
|
17
|
+
/** @internal */
|
|
18
|
+
export declare const WebFetchEngineEnum$outboundSchema: z.ZodType<string, WebFetchEngineEnum>;
|
|
19
|
+
//# sourceMappingURL=webfetchengineenum.d.ts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 9cc8d81a8f6c
|
|
4
|
+
*/
|
|
5
|
+
import * as openEnums from "../types/enums.js";
|
|
6
|
+
/**
|
|
7
|
+
* Which fetch engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in fetch. "exa" uses Exa Contents API (supports BYOK). "openrouter" uses direct HTTP fetch. "firecrawl" uses Firecrawl scrape (requires BYOK).
|
|
8
|
+
*/
|
|
9
|
+
export const WebFetchEngineEnum = {
|
|
10
|
+
Auto: "auto",
|
|
11
|
+
Native: "native",
|
|
12
|
+
Openrouter: "openrouter",
|
|
13
|
+
Firecrawl: "firecrawl",
|
|
14
|
+
Exa: "exa",
|
|
15
|
+
};
|
|
16
|
+
/** @internal */
|
|
17
|
+
export const WebFetchEngineEnum$outboundSchema = openEnums.outboundSchema(WebFetchEngineEnum);
|
|
18
|
+
//# sourceMappingURL=webfetchengineenum.js.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { ClosedEnum } from "../types/enums.js";
|
|
3
|
+
import { WebFetchServerToolConfig, WebFetchServerToolConfig$Outbound } from "./webfetchservertoolconfig.js";
|
|
4
|
+
export declare const WebFetchServerToolType: {
|
|
5
|
+
readonly OpenrouterWebFetch: "openrouter:web_fetch";
|
|
6
|
+
};
|
|
7
|
+
export type WebFetchServerToolType = ClosedEnum<typeof WebFetchServerToolType>;
|
|
8
|
+
/**
|
|
9
|
+
* OpenRouter built-in server tool: fetches full content from a URL (web page or PDF)
|
|
10
|
+
*/
|
|
11
|
+
export type WebFetchServerTool = {
|
|
12
|
+
/**
|
|
13
|
+
* Configuration for the openrouter:web_fetch server tool
|
|
14
|
+
*/
|
|
15
|
+
parameters?: WebFetchServerToolConfig | undefined;
|
|
16
|
+
type: WebFetchServerToolType;
|
|
17
|
+
};
|
|
18
|
+
/** @internal */
|
|
19
|
+
export declare const WebFetchServerToolType$outboundSchema: z.ZodEnum<typeof WebFetchServerToolType>;
|
|
20
|
+
/** @internal */
|
|
21
|
+
export type WebFetchServerTool$Outbound = {
|
|
22
|
+
parameters?: WebFetchServerToolConfig$Outbound | undefined;
|
|
23
|
+
type: string;
|
|
24
|
+
};
|
|
25
|
+
/** @internal */
|
|
26
|
+
export declare const WebFetchServerTool$outboundSchema: z.ZodType<WebFetchServerTool$Outbound, WebFetchServerTool>;
|
|
27
|
+
export declare function webFetchServerToolToJSON(webFetchServerTool: WebFetchServerTool): string;
|
|
28
|
+
//# sourceMappingURL=webfetchservertool.d.ts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 6d6cb09da873
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { WebFetchServerToolConfig$outboundSchema, } from "./webfetchservertoolconfig.js";
|
|
7
|
+
export const WebFetchServerToolType = {
|
|
8
|
+
OpenrouterWebFetch: "openrouter:web_fetch",
|
|
9
|
+
};
|
|
10
|
+
/** @internal */
|
|
11
|
+
export const WebFetchServerToolType$outboundSchema = z.enum(WebFetchServerToolType);
|
|
12
|
+
/** @internal */
|
|
13
|
+
export const WebFetchServerTool$outboundSchema = z.object({
|
|
14
|
+
parameters: WebFetchServerToolConfig$outboundSchema.optional(),
|
|
15
|
+
type: WebFetchServerToolType$outboundSchema,
|
|
16
|
+
});
|
|
17
|
+
export function webFetchServerToolToJSON(webFetchServerTool) {
|
|
18
|
+
return JSON.stringify(WebFetchServerTool$outboundSchema.parse(webFetchServerTool));
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=webfetchservertool.js.map
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { WebFetchEngineEnum } from "./webfetchengineenum.js";
|
|
3
|
+
/**
|
|
4
|
+
* Configuration for the openrouter:web_fetch server tool
|
|
5
|
+
*/
|
|
6
|
+
export type WebFetchServerToolConfig = {
|
|
7
|
+
/**
|
|
8
|
+
* Only fetch from these domains.
|
|
9
|
+
*/
|
|
10
|
+
allowedDomains?: Array<string> | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* Never fetch from these domains.
|
|
13
|
+
*/
|
|
14
|
+
blockedDomains?: Array<string> | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* Which fetch engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in fetch. "exa" uses Exa Contents API (supports BYOK). "openrouter" uses direct HTTP fetch. "firecrawl" uses Firecrawl scrape (requires BYOK).
|
|
17
|
+
*/
|
|
18
|
+
engine?: WebFetchEngineEnum | undefined;
|
|
19
|
+
/**
|
|
20
|
+
* Maximum content length in approximate tokens. Content exceeding this limit is truncated.
|
|
21
|
+
*/
|
|
22
|
+
maxContentTokens?: number | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* Maximum number of web fetches per request. Once exceeded, the tool returns an error.
|
|
25
|
+
*/
|
|
26
|
+
maxUses?: number | undefined;
|
|
27
|
+
};
|
|
28
|
+
/** @internal */
|
|
29
|
+
export type WebFetchServerToolConfig$Outbound = {
|
|
30
|
+
allowed_domains?: Array<string> | undefined;
|
|
31
|
+
blocked_domains?: Array<string> | undefined;
|
|
32
|
+
engine?: string | undefined;
|
|
33
|
+
max_content_tokens?: number | undefined;
|
|
34
|
+
max_uses?: number | undefined;
|
|
35
|
+
};
|
|
36
|
+
/** @internal */
|
|
37
|
+
export declare const WebFetchServerToolConfig$outboundSchema: z.ZodType<WebFetchServerToolConfig$Outbound, WebFetchServerToolConfig>;
|
|
38
|
+
export declare function webFetchServerToolConfigToJSON(webFetchServerToolConfig: WebFetchServerToolConfig): string;
|
|
39
|
+
//# sourceMappingURL=webfetchservertoolconfig.d.ts.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: a65999aa9fc4
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
|
+
import { WebFetchEngineEnum$outboundSchema, } from "./webfetchengineenum.js";
|
|
8
|
+
/** @internal */
|
|
9
|
+
export const WebFetchServerToolConfig$outboundSchema = z.object({
|
|
10
|
+
allowedDomains: z.array(z.string()).optional(),
|
|
11
|
+
blockedDomains: z.array(z.string()).optional(),
|
|
12
|
+
engine: WebFetchEngineEnum$outboundSchema.optional(),
|
|
13
|
+
maxContentTokens: z.int().optional(),
|
|
14
|
+
maxUses: z.int().optional(),
|
|
15
|
+
}).transform((v) => {
|
|
16
|
+
return remap$(v, {
|
|
17
|
+
allowedDomains: "allowed_domains",
|
|
18
|
+
blockedDomains: "blocked_domains",
|
|
19
|
+
maxContentTokens: "max_content_tokens",
|
|
20
|
+
maxUses: "max_uses",
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
export function webFetchServerToolConfigToJSON(webFetchServerToolConfig) {
|
|
24
|
+
return JSON.stringify(WebFetchServerToolConfig$outboundSchema.parse(webFetchServerToolConfig));
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=webfetchservertoolconfig.js.map
|
|
@@ -24,7 +24,7 @@ export type WebSearchConfig = {
|
|
|
24
24
|
*/
|
|
25
25
|
maxTotalResults?: number | undefined;
|
|
26
26
|
/**
|
|
27
|
-
* How much context to retrieve per result. Defaults to medium (15000 chars).
|
|
27
|
+
* How much context to retrieve per result. Defaults to medium (15000 chars). Applies to Exa and Parallel engines; ignored with native provider search and Firecrawl.
|
|
28
28
|
*/
|
|
29
29
|
searchContextSize?: SearchQualityLevel | undefined;
|
|
30
30
|
/**
|
package/jsr.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openrouter/sdk",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.20",
|
|
4
4
|
"author": "OpenRouter",
|
|
5
5
|
"description": "The OpenRouter TypeScript SDK is a type-safe toolkit for building AI applications with access to 300+ language models through a unified API.",
|
|
6
6
|
"keywords": [
|
|
@@ -69,15 +69,15 @@
|
|
|
69
69
|
"lint": "eslint --cache --max-warnings=0 src",
|
|
70
70
|
"build": "tsc",
|
|
71
71
|
"prepublishOnly": "npm run build",
|
|
72
|
-
"test:e2e": "vitest --run --project e2e",
|
|
73
72
|
"test:transit": "exit 0",
|
|
74
|
-
"typecheck": "tsc --noEmit",
|
|
75
|
-
"typecheck:transit": "exit 0",
|
|
76
73
|
"compile": "tsc",
|
|
77
74
|
"postinstall": "node scripts/check-types.js || true",
|
|
75
|
+
"prepare": "npm run build",
|
|
78
76
|
"test": "vitest --run --project unit",
|
|
79
77
|
"test:watch": "vitest --watch --project unit",
|
|
80
|
-
"
|
|
78
|
+
"typecheck": "tsc --noEmit",
|
|
79
|
+
"typecheck:transit": "exit 0",
|
|
80
|
+
"test:e2e": "vitest --run --project e2e"
|
|
81
81
|
},
|
|
82
82
|
"peerDependencies": {},
|
|
83
83
|
"devDependencies": {
|