@openrouter/sdk 1.2.13 → 1.2.14
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/chatwebsearchshorthand.d.ts +6 -0
- package/esm/models/chatwebsearchshorthand.js +2 -0
- package/esm/models/index.d.ts +1 -0
- package/esm/models/index.js +1 -0
- package/esm/models/legacywebsearchservertool.d.ts +6 -0
- package/esm/models/legacywebsearchservertool.js +3 -0
- package/esm/models/preview20250311websearchservertool.d.ts +6 -0
- package/esm/models/preview20250311websearchservertool.js +3 -0
- package/esm/models/previewwebsearchservertool.d.ts +6 -0
- package/esm/models/previewwebsearchservertool.js +3 -0
- package/esm/models/websearchconfig.d.ts +6 -0
- package/esm/models/websearchconfig.js +2 -0
- package/esm/models/websearchmode.d.ts +25 -0
- package/esm/models/websearchmode.js +24 -0
- package/esm/models/websearchplugin.d.ts +6 -0
- package/esm/models/websearchplugin.js +2 -0
- package/esm/models/websearchservertool.d.ts +6 -0
- package/esm/models/websearchservertool.js +3 -0
- package/esm/models/websearchservertoolconfig.d.ts +6 -0
- package/esm/models/websearchservertoolconfig.js +2 -0
- package/jsr.json +1 -1
- package/package.json +8 -8
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: "1.2.
|
|
52
|
+
readonly sdkVersion: "1.2.14";
|
|
53
53
|
readonly genVersion: "2.914.0";
|
|
54
|
-
readonly userAgent: "speakeasy-sdk/typescript 1.2.
|
|
54
|
+
readonly userAgent: "speakeasy-sdk/typescript 1.2.14 2.914.0 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: "1.2.
|
|
29
|
+
sdkVersion: "1.2.14",
|
|
30
30
|
genVersion: "2.914.0",
|
|
31
|
-
userAgent: "speakeasy-sdk/typescript 1.2.
|
|
31
|
+
userAgent: "speakeasy-sdk/typescript 1.2.14 2.914.0 1.0.0 @openrouter/sdk",
|
|
32
32
|
};
|
|
33
33
|
//# sourceMappingURL=config.js.map
|
|
@@ -3,6 +3,7 @@ import { OpenEnum } from "../types/enums.js";
|
|
|
3
3
|
import { SearchQualityLevel } from "./searchqualitylevel.js";
|
|
4
4
|
import { WebSearchConfig, WebSearchConfig$Outbound } from "./websearchconfig.js";
|
|
5
5
|
import { WebSearchEngineEnum } from "./websearchengineenum.js";
|
|
6
|
+
import { WebSearchMode } from "./websearchmode.js";
|
|
6
7
|
import { WebSearchUserLocationServerTool, WebSearchUserLocationServerTool$Outbound } from "./websearchuserlocationservertool.js";
|
|
7
8
|
export declare const ChatWebSearchShorthandType: {
|
|
8
9
|
readonly WebSearch: "web_search";
|
|
@@ -43,6 +44,10 @@ export type ChatWebSearchShorthand = {
|
|
|
43
44
|
* Maximum number of web searches the model may perform in a single request. Once reached, further search calls return an error result instead of executing. Applies to the Exa, Firecrawl, Parallel, and Perplexity engines. With native provider search, forwarded only to Anthropic (as `max_uses`); other native search providers have no equivalent parameter and ignore it.
|
|
44
45
|
*/
|
|
45
46
|
maxUses?: number | undefined;
|
|
47
|
+
/**
|
|
48
|
+
* Engine-native search mode. Exa supports instant, fast, auto (default), deep-lite, deep, and deep-reasoning. Parallel supports turbo (default), basic, and advanced. Modes unsupported by the selected engine are ignored.
|
|
49
|
+
*/
|
|
50
|
+
mode?: WebSearchMode | undefined;
|
|
46
51
|
parameters?: WebSearchConfig | undefined;
|
|
47
52
|
/**
|
|
48
53
|
* How much context to retrieve per result. Applies to Exa, Parallel, and Perplexity engines; ignored with native provider search and Firecrawl. For Exa, pins a fixed per-result character cap (low=5,000, medium=15,000, high=30,000); when omitted, Exa picks an adaptive size per query and document (typically ~2,000–4,000 characters per result). For Parallel, controls the total characters across all results; when omitted, Parallel uses its own default size. For Perplexity, maps directly to the Search API's native search_context_size parameter. Overridden by `max_characters` when both are set.
|
|
@@ -65,6 +70,7 @@ export type ChatWebSearchShorthand$Outbound = {
|
|
|
65
70
|
max_results?: number | undefined;
|
|
66
71
|
max_total_results?: number | undefined;
|
|
67
72
|
max_uses?: number | undefined;
|
|
73
|
+
mode?: string | undefined;
|
|
68
74
|
parameters?: WebSearchConfig$Outbound | undefined;
|
|
69
75
|
search_context_size?: string | undefined;
|
|
70
76
|
type: string;
|
|
@@ -8,6 +8,7 @@ import * as openEnums from "../types/enums.js";
|
|
|
8
8
|
import { SearchQualityLevel$outboundSchema, } from "./searchqualitylevel.js";
|
|
9
9
|
import { WebSearchConfig$outboundSchema, } from "./websearchconfig.js";
|
|
10
10
|
import { WebSearchEngineEnum$outboundSchema, } from "./websearchengineenum.js";
|
|
11
|
+
import { WebSearchMode$outboundSchema, } from "./websearchmode.js";
|
|
11
12
|
import { WebSearchUserLocationServerTool$outboundSchema, } from "./websearchuserlocationservertool.js";
|
|
12
13
|
export const ChatWebSearchShorthandType = {
|
|
13
14
|
WebSearch: "web_search",
|
|
@@ -26,6 +27,7 @@ export const ChatWebSearchShorthand$outboundSchema = z.object({
|
|
|
26
27
|
maxResults: z.int().optional(),
|
|
27
28
|
maxTotalResults: z.int().optional(),
|
|
28
29
|
maxUses: z.int().optional(),
|
|
30
|
+
mode: WebSearchMode$outboundSchema.optional(),
|
|
29
31
|
parameters: WebSearchConfig$outboundSchema.optional(),
|
|
30
32
|
searchContextSize: SearchQualityLevel$outboundSchema.optional(),
|
|
31
33
|
type: ChatWebSearchShorthandType$outboundSchema,
|
package/esm/models/index.d.ts
CHANGED
|
@@ -581,6 +581,7 @@ export * from "./websearchconfig.js";
|
|
|
581
581
|
export * from "./websearchdomainfilter.js";
|
|
582
582
|
export * from "./websearchengine.js";
|
|
583
583
|
export * from "./websearchengineenum.js";
|
|
584
|
+
export * from "./websearchmode.js";
|
|
584
585
|
export * from "./websearchplugin.js";
|
|
585
586
|
export * from "./websearchservertool.js";
|
|
586
587
|
export * from "./websearchservertoolconfig.js";
|
package/esm/models/index.js
CHANGED
|
@@ -585,6 +585,7 @@ export * from "./websearchconfig.js";
|
|
|
585
585
|
export * from "./websearchdomainfilter.js";
|
|
586
586
|
export * from "./websearchengine.js";
|
|
587
587
|
export * from "./websearchengineenum.js";
|
|
588
|
+
export * from "./websearchmode.js";
|
|
588
589
|
export * from "./websearchplugin.js";
|
|
589
590
|
export * from "./websearchservertool.js";
|
|
590
591
|
export * from "./websearchservertoolconfig.js";
|
|
@@ -5,6 +5,7 @@ import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
|
5
5
|
import { SearchContextSizeEnum } from "./searchcontextsizeenum.js";
|
|
6
6
|
import { WebSearchDomainFilter, WebSearchDomainFilter$Outbound } from "./websearchdomainfilter.js";
|
|
7
7
|
import { WebSearchEngineEnum } from "./websearchengineenum.js";
|
|
8
|
+
import { WebSearchMode } from "./websearchmode.js";
|
|
8
9
|
import { WebSearchUserLocation, WebSearchUserLocation$Outbound } from "./websearchuserlocation.js";
|
|
9
10
|
export declare const LegacyWebSearchServerToolType: {
|
|
10
11
|
readonly WebSearch: "web_search";
|
|
@@ -27,6 +28,10 @@ export type LegacyWebSearchServerTool = {
|
|
|
27
28
|
* Maximum number of web searches the model may perform in a single request. Once reached, further search calls return an error result instead of executing. Applies to the Exa, Firecrawl, Parallel, and Perplexity engines. With native provider search, forwarded only to Anthropic (as `max_uses`); other native search providers have no equivalent parameter and ignore it.
|
|
28
29
|
*/
|
|
29
30
|
maxUses?: number | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* Engine-native search mode. Exa supports instant, fast, auto (default), deep-lite, deep, and deep-reasoning. Parallel supports turbo (default), basic, and advanced. Modes unsupported by the selected engine are ignored.
|
|
33
|
+
*/
|
|
34
|
+
mode?: WebSearchMode | undefined;
|
|
30
35
|
/**
|
|
31
36
|
* Size of the search context for web search tools
|
|
32
37
|
*/
|
|
@@ -49,6 +54,7 @@ export type LegacyWebSearchServerTool$Outbound = {
|
|
|
49
54
|
filters?: WebSearchDomainFilter$Outbound | null | undefined;
|
|
50
55
|
max_results?: number | undefined;
|
|
51
56
|
max_uses?: number | undefined;
|
|
57
|
+
mode?: string | undefined;
|
|
52
58
|
search_context_size?: string | undefined;
|
|
53
59
|
type: string;
|
|
54
60
|
user_location?: WebSearchUserLocation$Outbound | null | undefined;
|
|
@@ -8,6 +8,7 @@ import { safeParse } from "../lib/schemas.js";
|
|
|
8
8
|
import { SearchContextSizeEnum$inboundSchema, SearchContextSizeEnum$outboundSchema, } from "./searchcontextsizeenum.js";
|
|
9
9
|
import { WebSearchDomainFilter$inboundSchema, WebSearchDomainFilter$outboundSchema, } from "./websearchdomainfilter.js";
|
|
10
10
|
import { WebSearchEngineEnum$inboundSchema, WebSearchEngineEnum$outboundSchema, } from "./websearchengineenum.js";
|
|
11
|
+
import { WebSearchMode$inboundSchema, WebSearchMode$outboundSchema, } from "./websearchmode.js";
|
|
11
12
|
import { WebSearchUserLocation$inboundSchema, WebSearchUserLocation$outboundSchema, } from "./websearchuserlocation.js";
|
|
12
13
|
export const LegacyWebSearchServerToolType = {
|
|
13
14
|
WebSearch: "web_search",
|
|
@@ -22,6 +23,7 @@ export const LegacyWebSearchServerTool$inboundSchema = z.object({
|
|
|
22
23
|
filters: z.nullable(WebSearchDomainFilter$inboundSchema).optional(),
|
|
23
24
|
max_results: z.int().optional(),
|
|
24
25
|
max_uses: z.int().optional(),
|
|
26
|
+
mode: WebSearchMode$inboundSchema.optional(),
|
|
25
27
|
search_context_size: SearchContextSizeEnum$inboundSchema.optional(),
|
|
26
28
|
type: LegacyWebSearchServerToolType$inboundSchema,
|
|
27
29
|
user_location: z.nullable(WebSearchUserLocation$inboundSchema).optional(),
|
|
@@ -39,6 +41,7 @@ export const LegacyWebSearchServerTool$outboundSchema = z.object({
|
|
|
39
41
|
filters: z.nullable(WebSearchDomainFilter$outboundSchema).optional(),
|
|
40
42
|
maxResults: z.int().optional(),
|
|
41
43
|
maxUses: z.int().optional(),
|
|
44
|
+
mode: WebSearchMode$outboundSchema.optional(),
|
|
42
45
|
searchContextSize: SearchContextSizeEnum$outboundSchema.optional(),
|
|
43
46
|
type: LegacyWebSearchServerToolType$outboundSchema,
|
|
44
47
|
userLocation: z.nullable(WebSearchUserLocation$outboundSchema).optional(),
|
|
@@ -6,6 +6,7 @@ import { PreviewWebSearchUserLocation, PreviewWebSearchUserLocation$Outbound } f
|
|
|
6
6
|
import { SearchContextSizeEnum } from "./searchcontextsizeenum.js";
|
|
7
7
|
import { WebSearchDomainFilter, WebSearchDomainFilter$Outbound } from "./websearchdomainfilter.js";
|
|
8
8
|
import { WebSearchEngineEnum } from "./websearchengineenum.js";
|
|
9
|
+
import { WebSearchMode } from "./websearchmode.js";
|
|
9
10
|
export declare const Preview20250311WebSearchServerToolType: {
|
|
10
11
|
readonly WebSearchPreview20250311: "web_search_preview_2025_03_11";
|
|
11
12
|
};
|
|
@@ -27,6 +28,10 @@ export type Preview20250311WebSearchServerTool = {
|
|
|
27
28
|
* Maximum number of web searches the model may perform in a single request. Once reached, further search calls return an error result instead of executing. Applies to the Exa, Firecrawl, Parallel, and Perplexity engines. With native provider search, forwarded only to Anthropic (as `max_uses`); other native search providers have no equivalent parameter and ignore it.
|
|
28
29
|
*/
|
|
29
30
|
maxUses?: number | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* Engine-native search mode. Exa supports instant, fast, auto (default), deep-lite, deep, and deep-reasoning. Parallel supports turbo (default), basic, and advanced. Modes unsupported by the selected engine are ignored.
|
|
33
|
+
*/
|
|
34
|
+
mode?: WebSearchMode | undefined;
|
|
30
35
|
/**
|
|
31
36
|
* Size of the search context for web search tools
|
|
32
37
|
*/
|
|
@@ -46,6 +51,7 @@ export type Preview20250311WebSearchServerTool$Outbound = {
|
|
|
46
51
|
filters?: WebSearchDomainFilter$Outbound | null | undefined;
|
|
47
52
|
max_results?: number | undefined;
|
|
48
53
|
max_uses?: number | undefined;
|
|
54
|
+
mode?: string | undefined;
|
|
49
55
|
search_context_size?: string | undefined;
|
|
50
56
|
type: string;
|
|
51
57
|
user_location?: PreviewWebSearchUserLocation$Outbound | null | undefined;
|
|
@@ -9,6 +9,7 @@ import { PreviewWebSearchUserLocation$inboundSchema, PreviewWebSearchUserLocatio
|
|
|
9
9
|
import { SearchContextSizeEnum$inboundSchema, SearchContextSizeEnum$outboundSchema, } from "./searchcontextsizeenum.js";
|
|
10
10
|
import { WebSearchDomainFilter$inboundSchema, WebSearchDomainFilter$outboundSchema, } from "./websearchdomainfilter.js";
|
|
11
11
|
import { WebSearchEngineEnum$inboundSchema, WebSearchEngineEnum$outboundSchema, } from "./websearchengineenum.js";
|
|
12
|
+
import { WebSearchMode$inboundSchema, WebSearchMode$outboundSchema, } from "./websearchmode.js";
|
|
12
13
|
export const Preview20250311WebSearchServerToolType = {
|
|
13
14
|
WebSearchPreview20250311: "web_search_preview_2025_03_11",
|
|
14
15
|
};
|
|
@@ -22,6 +23,7 @@ export const Preview20250311WebSearchServerTool$inboundSchema = z.object({
|
|
|
22
23
|
filters: z.nullable(WebSearchDomainFilter$inboundSchema).optional(),
|
|
23
24
|
max_results: z.int().optional(),
|
|
24
25
|
max_uses: z.int().optional(),
|
|
26
|
+
mode: WebSearchMode$inboundSchema.optional(),
|
|
25
27
|
search_context_size: SearchContextSizeEnum$inboundSchema.optional(),
|
|
26
28
|
type: Preview20250311WebSearchServerToolType$inboundSchema,
|
|
27
29
|
user_location: z.nullable(PreviewWebSearchUserLocation$inboundSchema)
|
|
@@ -40,6 +42,7 @@ export const Preview20250311WebSearchServerTool$outboundSchema = z.object({
|
|
|
40
42
|
filters: z.nullable(WebSearchDomainFilter$outboundSchema).optional(),
|
|
41
43
|
maxResults: z.int().optional(),
|
|
42
44
|
maxUses: z.int().optional(),
|
|
45
|
+
mode: WebSearchMode$outboundSchema.optional(),
|
|
43
46
|
searchContextSize: SearchContextSizeEnum$outboundSchema.optional(),
|
|
44
47
|
type: Preview20250311WebSearchServerToolType$outboundSchema,
|
|
45
48
|
userLocation: z.nullable(PreviewWebSearchUserLocation$outboundSchema)
|
|
@@ -6,6 +6,7 @@ import { PreviewWebSearchUserLocation, PreviewWebSearchUserLocation$Outbound } f
|
|
|
6
6
|
import { SearchContextSizeEnum } from "./searchcontextsizeenum.js";
|
|
7
7
|
import { WebSearchDomainFilter, WebSearchDomainFilter$Outbound } from "./websearchdomainfilter.js";
|
|
8
8
|
import { WebSearchEngineEnum } from "./websearchengineenum.js";
|
|
9
|
+
import { WebSearchMode } from "./websearchmode.js";
|
|
9
10
|
export declare const PreviewWebSearchServerToolType: {
|
|
10
11
|
readonly WebSearchPreview: "web_search_preview";
|
|
11
12
|
};
|
|
@@ -27,6 +28,10 @@ export type PreviewWebSearchServerTool = {
|
|
|
27
28
|
* Maximum number of web searches the model may perform in a single request. Once reached, further search calls return an error result instead of executing. Applies to the Exa, Firecrawl, Parallel, and Perplexity engines. With native provider search, forwarded only to Anthropic (as `max_uses`); other native search providers have no equivalent parameter and ignore it.
|
|
28
29
|
*/
|
|
29
30
|
maxUses?: number | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* Engine-native search mode. Exa supports instant, fast, auto (default), deep-lite, deep, and deep-reasoning. Parallel supports turbo (default), basic, and advanced. Modes unsupported by the selected engine are ignored.
|
|
33
|
+
*/
|
|
34
|
+
mode?: WebSearchMode | undefined;
|
|
30
35
|
/**
|
|
31
36
|
* Size of the search context for web search tools
|
|
32
37
|
*/
|
|
@@ -46,6 +51,7 @@ export type PreviewWebSearchServerTool$Outbound = {
|
|
|
46
51
|
filters?: WebSearchDomainFilter$Outbound | null | undefined;
|
|
47
52
|
max_results?: number | undefined;
|
|
48
53
|
max_uses?: number | undefined;
|
|
54
|
+
mode?: string | undefined;
|
|
49
55
|
search_context_size?: string | undefined;
|
|
50
56
|
type: string;
|
|
51
57
|
user_location?: PreviewWebSearchUserLocation$Outbound | null | undefined;
|
|
@@ -9,6 +9,7 @@ import { PreviewWebSearchUserLocation$inboundSchema, PreviewWebSearchUserLocatio
|
|
|
9
9
|
import { SearchContextSizeEnum$inboundSchema, SearchContextSizeEnum$outboundSchema, } from "./searchcontextsizeenum.js";
|
|
10
10
|
import { WebSearchDomainFilter$inboundSchema, WebSearchDomainFilter$outboundSchema, } from "./websearchdomainfilter.js";
|
|
11
11
|
import { WebSearchEngineEnum$inboundSchema, WebSearchEngineEnum$outboundSchema, } from "./websearchengineenum.js";
|
|
12
|
+
import { WebSearchMode$inboundSchema, WebSearchMode$outboundSchema, } from "./websearchmode.js";
|
|
12
13
|
export const PreviewWebSearchServerToolType = {
|
|
13
14
|
WebSearchPreview: "web_search_preview",
|
|
14
15
|
};
|
|
@@ -22,6 +23,7 @@ export const PreviewWebSearchServerTool$inboundSchema = z.object({
|
|
|
22
23
|
filters: z.nullable(WebSearchDomainFilter$inboundSchema).optional(),
|
|
23
24
|
max_results: z.int().optional(),
|
|
24
25
|
max_uses: z.int().optional(),
|
|
26
|
+
mode: WebSearchMode$inboundSchema.optional(),
|
|
25
27
|
search_context_size: SearchContextSizeEnum$inboundSchema.optional(),
|
|
26
28
|
type: PreviewWebSearchServerToolType$inboundSchema,
|
|
27
29
|
user_location: z.nullable(PreviewWebSearchUserLocation$inboundSchema)
|
|
@@ -40,6 +42,7 @@ export const PreviewWebSearchServerTool$outboundSchema = z.object({
|
|
|
40
42
|
filters: z.nullable(WebSearchDomainFilter$outboundSchema).optional(),
|
|
41
43
|
maxResults: z.int().optional(),
|
|
42
44
|
maxUses: z.int().optional(),
|
|
45
|
+
mode: WebSearchMode$outboundSchema.optional(),
|
|
43
46
|
searchContextSize: SearchContextSizeEnum$outboundSchema.optional(),
|
|
44
47
|
type: PreviewWebSearchServerToolType$outboundSchema,
|
|
45
48
|
userLocation: z.nullable(PreviewWebSearchUserLocation$outboundSchema)
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as z from "zod/v4";
|
|
2
2
|
import { SearchQualityLevel } from "./searchqualitylevel.js";
|
|
3
3
|
import { WebSearchEngineEnum } from "./websearchengineenum.js";
|
|
4
|
+
import { WebSearchMode } from "./websearchmode.js";
|
|
4
5
|
import { WebSearchUserLocationServerTool, WebSearchUserLocationServerTool$Outbound } from "./websearchuserlocationservertool.js";
|
|
5
6
|
export type WebSearchConfig = {
|
|
6
7
|
/**
|
|
@@ -31,6 +32,10 @@ export type WebSearchConfig = {
|
|
|
31
32
|
* Maximum number of web searches the model may perform in a single request. Once reached, further search calls return an error result instead of executing. Applies to the Exa, Firecrawl, Parallel, and Perplexity engines. With native provider search, forwarded only to Anthropic (as `max_uses`); other native search providers have no equivalent parameter and ignore it.
|
|
32
33
|
*/
|
|
33
34
|
maxUses?: number | undefined;
|
|
35
|
+
/**
|
|
36
|
+
* Engine-native search mode. Exa supports instant, fast, auto (default), deep-lite, deep, and deep-reasoning. Parallel supports turbo (default), basic, and advanced. Modes unsupported by the selected engine are ignored.
|
|
37
|
+
*/
|
|
38
|
+
mode?: WebSearchMode | undefined;
|
|
34
39
|
/**
|
|
35
40
|
* How much context to retrieve per result. Applies to Exa, Parallel, and Perplexity engines; ignored with native provider search and Firecrawl. For Exa, pins a fixed per-result character cap (low=5,000, medium=15,000, high=30,000); when omitted, Exa picks an adaptive size per query and document (typically ~2,000–4,000 characters per result). For Parallel, controls the total characters across all results; when omitted, Parallel uses its own default size. For Perplexity, maps directly to the Search API's native search_context_size parameter. Overridden by `max_characters` when both are set.
|
|
36
41
|
*/
|
|
@@ -49,6 +54,7 @@ export type WebSearchConfig$Outbound = {
|
|
|
49
54
|
max_results?: number | undefined;
|
|
50
55
|
max_total_results?: number | undefined;
|
|
51
56
|
max_uses?: number | undefined;
|
|
57
|
+
mode?: string | undefined;
|
|
52
58
|
search_context_size?: string | undefined;
|
|
53
59
|
user_location?: WebSearchUserLocationServerTool$Outbound | undefined;
|
|
54
60
|
};
|
|
@@ -6,6 +6,7 @@ import * as z from "zod/v4";
|
|
|
6
6
|
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
7
|
import { SearchQualityLevel$outboundSchema, } from "./searchqualitylevel.js";
|
|
8
8
|
import { WebSearchEngineEnum$outboundSchema, } from "./websearchengineenum.js";
|
|
9
|
+
import { WebSearchMode$outboundSchema, } from "./websearchmode.js";
|
|
9
10
|
import { WebSearchUserLocationServerTool$outboundSchema, } from "./websearchuserlocationservertool.js";
|
|
10
11
|
/** @internal */
|
|
11
12
|
export const WebSearchConfig$outboundSchema = z.object({
|
|
@@ -16,6 +17,7 @@ export const WebSearchConfig$outboundSchema = z.object({
|
|
|
16
17
|
maxResults: z.int().optional(),
|
|
17
18
|
maxTotalResults: z.int().optional(),
|
|
18
19
|
maxUses: z.int().optional(),
|
|
20
|
+
mode: WebSearchMode$outboundSchema.optional(),
|
|
19
21
|
searchContextSize: SearchQualityLevel$outboundSchema.optional(),
|
|
20
22
|
userLocation: WebSearchUserLocationServerTool$outboundSchema.optional(),
|
|
21
23
|
}).transform((v) => {
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { OpenEnum } from "../types/enums.js";
|
|
3
|
+
/**
|
|
4
|
+
* Engine-native search mode. Exa supports instant, fast, auto (default), deep-lite, deep, and deep-reasoning. Parallel supports turbo (default), basic, and advanced. Modes unsupported by the selected engine are ignored.
|
|
5
|
+
*/
|
|
6
|
+
export declare const WebSearchMode: {
|
|
7
|
+
readonly Instant: "instant";
|
|
8
|
+
readonly Fast: "fast";
|
|
9
|
+
readonly Auto: "auto";
|
|
10
|
+
readonly DeepLite: "deep-lite";
|
|
11
|
+
readonly Deep: "deep";
|
|
12
|
+
readonly DeepReasoning: "deep-reasoning";
|
|
13
|
+
readonly Turbo: "turbo";
|
|
14
|
+
readonly Basic: "basic";
|
|
15
|
+
readonly Advanced: "advanced";
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Engine-native search mode. Exa supports instant, fast, auto (default), deep-lite, deep, and deep-reasoning. Parallel supports turbo (default), basic, and advanced. Modes unsupported by the selected engine are ignored.
|
|
19
|
+
*/
|
|
20
|
+
export type WebSearchMode = OpenEnum<typeof WebSearchMode>;
|
|
21
|
+
/** @internal */
|
|
22
|
+
export declare const WebSearchMode$inboundSchema: z.ZodType<WebSearchMode, unknown>;
|
|
23
|
+
/** @internal */
|
|
24
|
+
export declare const WebSearchMode$outboundSchema: z.ZodType<string, WebSearchMode>;
|
|
25
|
+
//# sourceMappingURL=websearchmode.d.ts.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 8aa8c62cf243
|
|
4
|
+
*/
|
|
5
|
+
import * as openEnums from "../types/enums.js";
|
|
6
|
+
/**
|
|
7
|
+
* Engine-native search mode. Exa supports instant, fast, auto (default), deep-lite, deep, and deep-reasoning. Parallel supports turbo (default), basic, and advanced. Modes unsupported by the selected engine are ignored.
|
|
8
|
+
*/
|
|
9
|
+
export const WebSearchMode = {
|
|
10
|
+
Instant: "instant",
|
|
11
|
+
Fast: "fast",
|
|
12
|
+
Auto: "auto",
|
|
13
|
+
DeepLite: "deep-lite",
|
|
14
|
+
Deep: "deep",
|
|
15
|
+
DeepReasoning: "deep-reasoning",
|
|
16
|
+
Turbo: "turbo",
|
|
17
|
+
Basic: "basic",
|
|
18
|
+
Advanced: "advanced",
|
|
19
|
+
};
|
|
20
|
+
/** @internal */
|
|
21
|
+
export const WebSearchMode$inboundSchema = openEnums.inboundSchema(WebSearchMode);
|
|
22
|
+
/** @internal */
|
|
23
|
+
export const WebSearchMode$outboundSchema = openEnums.outboundSchema(WebSearchMode);
|
|
24
|
+
//# sourceMappingURL=websearchmode.js.map
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as z from "zod/v4";
|
|
2
2
|
import { ClosedEnum } from "../types/enums.js";
|
|
3
3
|
import { WebSearchEngine } from "./websearchengine.js";
|
|
4
|
+
import { WebSearchMode } from "./websearchmode.js";
|
|
4
5
|
export declare const WebSearchPluginType: {
|
|
5
6
|
readonly Approximate: "approximate";
|
|
6
7
|
};
|
|
@@ -38,6 +39,10 @@ export type WebSearchPlugin = {
|
|
|
38
39
|
* Maximum number of times the model can invoke web search in a single turn. Passed through to native providers that support it (e.g. Anthropic).
|
|
39
40
|
*/
|
|
40
41
|
maxUses?: number | undefined;
|
|
42
|
+
/**
|
|
43
|
+
* Engine-native search mode. Exa supports instant, fast, auto (default), deep-lite, deep, and deep-reasoning. Parallel supports turbo (default), basic, and advanced. Modes unsupported by the selected engine are ignored.
|
|
44
|
+
*/
|
|
45
|
+
mode?: WebSearchMode | undefined;
|
|
41
46
|
searchPrompt?: string | undefined;
|
|
42
47
|
userLocation?: UserLocation | null | undefined;
|
|
43
48
|
};
|
|
@@ -63,6 +68,7 @@ export type WebSearchPlugin$Outbound = {
|
|
|
63
68
|
include_domains?: Array<string> | undefined;
|
|
64
69
|
max_results?: number | undefined;
|
|
65
70
|
max_uses?: number | undefined;
|
|
71
|
+
mode?: string | undefined;
|
|
66
72
|
search_prompt?: string | undefined;
|
|
67
73
|
user_location?: UserLocation$Outbound | null | undefined;
|
|
68
74
|
};
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import * as z from "zod/v4";
|
|
6
6
|
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
7
|
import { WebSearchEngine$outboundSchema, } from "./websearchengine.js";
|
|
8
|
+
import { WebSearchMode$outboundSchema, } from "./websearchmode.js";
|
|
8
9
|
export const WebSearchPluginType = {
|
|
9
10
|
Approximate: "approximate",
|
|
10
11
|
};
|
|
@@ -30,6 +31,7 @@ export const WebSearchPlugin$outboundSchema = z.object({
|
|
|
30
31
|
includeDomains: z.array(z.string()).optional(),
|
|
31
32
|
maxResults: z.int().optional(),
|
|
32
33
|
maxUses: z.int().optional(),
|
|
34
|
+
mode: WebSearchMode$outboundSchema.optional(),
|
|
33
35
|
searchPrompt: z.string().optional(),
|
|
34
36
|
userLocation: z.nullable(z.lazy(() => UserLocation$outboundSchema))
|
|
35
37
|
.optional(),
|
|
@@ -5,6 +5,7 @@ import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
|
5
5
|
import { SearchContextSizeEnum } from "./searchcontextsizeenum.js";
|
|
6
6
|
import { WebSearchDomainFilter, WebSearchDomainFilter$Outbound } from "./websearchdomainfilter.js";
|
|
7
7
|
import { WebSearchEngineEnum } from "./websearchengineenum.js";
|
|
8
|
+
import { WebSearchMode } from "./websearchmode.js";
|
|
8
9
|
import { WebSearchUserLocation, WebSearchUserLocation$Outbound } from "./websearchuserlocation.js";
|
|
9
10
|
export declare const WebSearchServerToolType: {
|
|
10
11
|
readonly WebSearch20250826: "web_search_2025_08_26";
|
|
@@ -27,6 +28,10 @@ export type WebSearchServerTool = {
|
|
|
27
28
|
* Maximum number of web searches the model may perform in a single request. Once reached, further search calls return an error result instead of executing. Applies to the Exa, Firecrawl, Parallel, and Perplexity engines. With native provider search, forwarded only to Anthropic (as `max_uses`); other native search providers have no equivalent parameter and ignore it.
|
|
28
29
|
*/
|
|
29
30
|
maxUses?: number | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* Engine-native search mode. Exa supports instant, fast, auto (default), deep-lite, deep, and deep-reasoning. Parallel supports turbo (default), basic, and advanced. Modes unsupported by the selected engine are ignored.
|
|
33
|
+
*/
|
|
34
|
+
mode?: WebSearchMode | undefined;
|
|
30
35
|
/**
|
|
31
36
|
* Size of the search context for web search tools
|
|
32
37
|
*/
|
|
@@ -49,6 +54,7 @@ export type WebSearchServerTool$Outbound = {
|
|
|
49
54
|
filters?: WebSearchDomainFilter$Outbound | null | undefined;
|
|
50
55
|
max_results?: number | undefined;
|
|
51
56
|
max_uses?: number | undefined;
|
|
57
|
+
mode?: string | undefined;
|
|
52
58
|
search_context_size?: string | undefined;
|
|
53
59
|
type: string;
|
|
54
60
|
user_location?: WebSearchUserLocation$Outbound | null | undefined;
|
|
@@ -8,6 +8,7 @@ import { safeParse } from "../lib/schemas.js";
|
|
|
8
8
|
import { SearchContextSizeEnum$inboundSchema, SearchContextSizeEnum$outboundSchema, } from "./searchcontextsizeenum.js";
|
|
9
9
|
import { WebSearchDomainFilter$inboundSchema, WebSearchDomainFilter$outboundSchema, } from "./websearchdomainfilter.js";
|
|
10
10
|
import { WebSearchEngineEnum$inboundSchema, WebSearchEngineEnum$outboundSchema, } from "./websearchengineenum.js";
|
|
11
|
+
import { WebSearchMode$inboundSchema, WebSearchMode$outboundSchema, } from "./websearchmode.js";
|
|
11
12
|
import { WebSearchUserLocation$inboundSchema, WebSearchUserLocation$outboundSchema, } from "./websearchuserlocation.js";
|
|
12
13
|
export const WebSearchServerToolType = {
|
|
13
14
|
WebSearch20250826: "web_search_2025_08_26",
|
|
@@ -22,6 +23,7 @@ export const WebSearchServerTool$inboundSchema = z.object({
|
|
|
22
23
|
filters: z.nullable(WebSearchDomainFilter$inboundSchema).optional(),
|
|
23
24
|
max_results: z.int().optional(),
|
|
24
25
|
max_uses: z.int().optional(),
|
|
26
|
+
mode: WebSearchMode$inboundSchema.optional(),
|
|
25
27
|
search_context_size: SearchContextSizeEnum$inboundSchema.optional(),
|
|
26
28
|
type: WebSearchServerToolType$inboundSchema,
|
|
27
29
|
user_location: z.nullable(WebSearchUserLocation$inboundSchema).optional(),
|
|
@@ -39,6 +41,7 @@ export const WebSearchServerTool$outboundSchema = z.object({
|
|
|
39
41
|
filters: z.nullable(WebSearchDomainFilter$outboundSchema).optional(),
|
|
40
42
|
maxResults: z.int().optional(),
|
|
41
43
|
maxUses: z.int().optional(),
|
|
44
|
+
mode: WebSearchMode$outboundSchema.optional(),
|
|
42
45
|
searchContextSize: SearchContextSizeEnum$outboundSchema.optional(),
|
|
43
46
|
type: WebSearchServerToolType$outboundSchema,
|
|
44
47
|
userLocation: z.nullable(WebSearchUserLocation$outboundSchema).optional(),
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as z from "zod/v4";
|
|
2
2
|
import { SearchQualityLevel } from "./searchqualitylevel.js";
|
|
3
3
|
import { WebSearchEngineEnum } from "./websearchengineenum.js";
|
|
4
|
+
import { WebSearchMode } from "./websearchmode.js";
|
|
4
5
|
import { WebSearchUserLocationServerTool, WebSearchUserLocationServerTool$Outbound } from "./websearchuserlocationservertool.js";
|
|
5
6
|
/**
|
|
6
7
|
* Configuration for the openrouter:web_search server tool
|
|
@@ -34,6 +35,10 @@ export type WebSearchServerToolConfig = {
|
|
|
34
35
|
* Maximum number of web searches the model may perform in a single request. Once reached, further search calls return an error result instead of executing. Applies to the Exa, Firecrawl, Parallel, and Perplexity engines. With native provider search, forwarded only to Anthropic (as `max_uses`); other native search providers have no equivalent parameter and ignore it.
|
|
35
36
|
*/
|
|
36
37
|
maxUses?: number | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* Engine-native search mode. Exa supports instant, fast, auto (default), deep-lite, deep, and deep-reasoning. Parallel supports turbo (default), basic, and advanced. Modes unsupported by the selected engine are ignored.
|
|
40
|
+
*/
|
|
41
|
+
mode?: WebSearchMode | undefined;
|
|
37
42
|
/**
|
|
38
43
|
* How much context to retrieve per result. Applies to Exa, Parallel, and Perplexity engines; ignored with native provider search and Firecrawl. For Exa, pins a fixed per-result character cap (low=5,000, medium=15,000, high=30,000); when omitted, Exa picks an adaptive size per query and document (typically ~2,000–4,000 characters per result). For Parallel, controls the total characters across all results; when omitted, Parallel uses its own default size. For Perplexity, maps directly to the Search API's native search_context_size parameter. Overridden by `max_characters` when both are set.
|
|
39
44
|
*/
|
|
@@ -52,6 +57,7 @@ export type WebSearchServerToolConfig$Outbound = {
|
|
|
52
57
|
max_results?: number | undefined;
|
|
53
58
|
max_total_results?: number | undefined;
|
|
54
59
|
max_uses?: number | undefined;
|
|
60
|
+
mode?: string | undefined;
|
|
55
61
|
search_context_size?: string | undefined;
|
|
56
62
|
user_location?: WebSearchUserLocationServerTool$Outbound | undefined;
|
|
57
63
|
};
|
|
@@ -6,6 +6,7 @@ import * as z from "zod/v4";
|
|
|
6
6
|
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
7
|
import { SearchQualityLevel$outboundSchema, } from "./searchqualitylevel.js";
|
|
8
8
|
import { WebSearchEngineEnum$outboundSchema, } from "./websearchengineenum.js";
|
|
9
|
+
import { WebSearchMode$outboundSchema, } from "./websearchmode.js";
|
|
9
10
|
import { WebSearchUserLocationServerTool$outboundSchema, } from "./websearchuserlocationservertool.js";
|
|
10
11
|
/** @internal */
|
|
11
12
|
export const WebSearchServerToolConfig$outboundSchema = z.object({
|
|
@@ -16,6 +17,7 @@ export const WebSearchServerToolConfig$outboundSchema = z.object({
|
|
|
16
17
|
maxResults: z.int().optional(),
|
|
17
18
|
maxTotalResults: z.int().optional(),
|
|
18
19
|
maxUses: z.int().optional(),
|
|
20
|
+
mode: WebSearchMode$outboundSchema.optional(),
|
|
19
21
|
searchContextSize: SearchQualityLevel$outboundSchema.optional(),
|
|
20
22
|
userLocation: WebSearchUserLocationServerTool$outboundSchema.optional(),
|
|
21
23
|
}).transform((v) => {
|
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.14",
|
|
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": [
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"license": "Apache-2.0",
|
|
22
22
|
"packageManager": "pnpm@10.22.0",
|
|
23
23
|
"publishConfig": {
|
|
24
|
-
"
|
|
25
|
-
"
|
|
24
|
+
"provenance": true,
|
|
25
|
+
"access": "public"
|
|
26
26
|
},
|
|
27
27
|
"type": "module",
|
|
28
28
|
"main": "./esm/index.js",
|
|
@@ -74,14 +74,14 @@
|
|
|
74
74
|
"build": "tsc",
|
|
75
75
|
"prepublishOnly": "npm run build",
|
|
76
76
|
"test": "vitest --run --project unit",
|
|
77
|
-
"test:
|
|
78
|
-
"
|
|
79
|
-
"typecheck:transit": "exit 0",
|
|
77
|
+
"test:watch": "vitest --watch --project unit",
|
|
78
|
+
"typecheck": "tsc --noEmit",
|
|
80
79
|
"compile": "tsc",
|
|
81
80
|
"postinstall": "node scripts/check-types.js || true",
|
|
82
81
|
"prepare": "npm run build",
|
|
83
|
-
"test:
|
|
84
|
-
"
|
|
82
|
+
"test:e2e": "vitest --run --project e2e",
|
|
83
|
+
"test:transit": "exit 0",
|
|
84
|
+
"typecheck:transit": "exit 0"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {},
|
|
87
87
|
"devDependencies": {
|