@openrouter/sdk 0.12.6 → 0.12.7
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 +2 -3
- package/esm/models/chatfunctiontool.js +0 -2
- package/esm/models/index.d.ts +0 -3
- package/esm/models/index.js +0 -3
- package/esm/models/operations/getgeneration.d.ts +0 -4
- package/esm/models/operations/getgeneration.js +0 -2
- package/esm/models/responsesrequest.d.ts +0 -9
- package/esm/models/responsesrequest.js +0 -3
- package/jsr.json +1 -1
- package/package.json +5 -5
- package/esm/models/webfetchengineenum.d.ts +0 -19
- package/esm/models/webfetchengineenum.js +0 -18
- package/esm/models/webfetchservertool.d.ts +0 -28
- package/esm/models/webfetchservertool.js +0 -20
- package/esm/models/webfetchservertoolconfig.d.ts +0 -39
- package/esm/models/webfetchservertoolconfig.js +0 -26
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.7";
|
|
53
53
|
readonly genVersion: "2.879.1";
|
|
54
|
-
readonly userAgent: "speakeasy-sdk/typescript 0.12.
|
|
54
|
+
readonly userAgent: "speakeasy-sdk/typescript 0.12.7 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.7",
|
|
30
30
|
genVersion: "2.879.1",
|
|
31
|
-
userAgent: "speakeasy-sdk/typescript 0.12.
|
|
31
|
+
userAgent: "speakeasy-sdk/typescript 0.12.7 2.879.1 1.0.0 @openrouter/sdk",
|
|
32
32
|
};
|
|
33
33
|
//# sourceMappingURL=config.js.map
|
|
@@ -6,7 +6,6 @@ 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";
|
|
10
9
|
/**
|
|
11
10
|
* Function definition for tool calling
|
|
12
11
|
*/
|
|
@@ -48,7 +47,7 @@ export type ChatFunctionToolFunction = {
|
|
|
48
47
|
/**
|
|
49
48
|
* Tool definition for function calling (regular function or OpenRouter built-in server tool)
|
|
50
49
|
*/
|
|
51
|
-
export type ChatFunctionTool = ChatFunctionToolFunction | DatetimeServerTool | ImageGenerationServerToolOpenRouter | ChatSearchModelsServerTool |
|
|
50
|
+
export type ChatFunctionTool = ChatFunctionToolFunction | DatetimeServerTool | ImageGenerationServerToolOpenRouter | ChatSearchModelsServerTool | OpenRouterWebSearchServerTool | ChatWebSearchShorthand;
|
|
52
51
|
/** @internal */
|
|
53
52
|
export type ChatFunctionToolFunctionFunction$Outbound = {
|
|
54
53
|
description?: string | undefined;
|
|
@@ -73,7 +72,7 @@ export type ChatFunctionToolFunction$Outbound = {
|
|
|
73
72
|
export declare const ChatFunctionToolFunction$outboundSchema: z.ZodType<ChatFunctionToolFunction$Outbound, ChatFunctionToolFunction>;
|
|
74
73
|
export declare function chatFunctionToolFunctionToJSON(chatFunctionToolFunction: ChatFunctionToolFunction): string;
|
|
75
74
|
/** @internal */
|
|
76
|
-
export type ChatFunctionTool$Outbound = ChatFunctionToolFunction$Outbound | DatetimeServerTool$Outbound | ImageGenerationServerToolOpenRouter$Outbound | ChatSearchModelsServerTool$Outbound |
|
|
75
|
+
export type ChatFunctionTool$Outbound = ChatFunctionToolFunction$Outbound | DatetimeServerTool$Outbound | ImageGenerationServerToolOpenRouter$Outbound | ChatSearchModelsServerTool$Outbound | OpenRouterWebSearchServerTool$Outbound | ChatWebSearchShorthand$Outbound;
|
|
77
76
|
/** @internal */
|
|
78
77
|
export declare const ChatFunctionTool$outboundSchema: z.ZodType<ChatFunctionTool$Outbound, ChatFunctionTool>;
|
|
79
78
|
export declare function chatFunctionToolToJSON(chatFunctionTool: ChatFunctionTool): string;
|
|
@@ -10,7 +10,6 @@ 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";
|
|
14
13
|
export const ChatFunctionToolType = {
|
|
15
14
|
Function: "function",
|
|
16
15
|
};
|
|
@@ -45,7 +44,6 @@ export const ChatFunctionTool$outboundSchema = z.union([
|
|
|
45
44
|
DatetimeServerTool$outboundSchema,
|
|
46
45
|
ImageGenerationServerToolOpenRouter$outboundSchema,
|
|
47
46
|
ChatSearchModelsServerTool$outboundSchema,
|
|
48
|
-
WebFetchServerTool$outboundSchema,
|
|
49
47
|
OpenRouterWebSearchServerTool$outboundSchema,
|
|
50
48
|
ChatWebSearchShorthand$outboundSchema,
|
|
51
49
|
]);
|
package/esm/models/index.d.ts
CHANGED
|
@@ -256,9 +256,6 @@ export * from "./videogenerationresponse.js";
|
|
|
256
256
|
export * from "./videogenerationusage.js";
|
|
257
257
|
export * from "./videomodel.js";
|
|
258
258
|
export * from "./videomodelslistresponse.js";
|
|
259
|
-
export * from "./webfetchengineenum.js";
|
|
260
|
-
export * from "./webfetchservertool.js";
|
|
261
|
-
export * from "./webfetchservertoolconfig.js";
|
|
262
259
|
export * from "./websearchcallcompletedevent.js";
|
|
263
260
|
export * from "./websearchcallinprogressevent.js";
|
|
264
261
|
export * from "./websearchcallsearchingevent.js";
|
package/esm/models/index.js
CHANGED
|
@@ -260,9 +260,6 @@ export * from "./videogenerationresponse.js";
|
|
|
260
260
|
export * from "./videogenerationusage.js";
|
|
261
261
|
export * from "./videomodel.js";
|
|
262
262
|
export * from "./videomodelslistresponse.js";
|
|
263
|
-
export * from "./webfetchengineenum.js";
|
|
264
|
-
export * from "./webfetchservertool.js";
|
|
265
|
-
export * from "./webfetchservertoolconfig.js";
|
|
266
263
|
export * from "./websearchcallcompletedevent.js";
|
|
267
264
|
export * from "./websearchcallinprogressevent.js";
|
|
268
265
|
export * from "./websearchcallsearchingevent.js";
|
|
@@ -146,10 +146,6 @@ export type GetGenerationData = {
|
|
|
146
146
|
* Native reasoning tokens as reported by provider
|
|
147
147
|
*/
|
|
148
148
|
nativeTokensReasoning: number | null;
|
|
149
|
-
/**
|
|
150
|
-
* Number of web fetches performed
|
|
151
|
-
*/
|
|
152
|
-
numFetches: number | null;
|
|
153
149
|
/**
|
|
154
150
|
* Number of audio inputs in the prompt
|
|
155
151
|
*/
|
|
@@ -55,7 +55,6 @@ export const GetGenerationData$inboundSchema = z.object({
|
|
|
55
55
|
native_tokens_completion_images: z.nullable(z.int()),
|
|
56
56
|
native_tokens_prompt: z.nullable(z.int()),
|
|
57
57
|
native_tokens_reasoning: z.nullable(z.int()),
|
|
58
|
-
num_fetches: z.nullable(z.int()),
|
|
59
58
|
num_input_audio_prompt: z.nullable(z.int()),
|
|
60
59
|
num_media_completion: z.nullable(z.int()),
|
|
61
60
|
num_media_prompt: z.nullable(z.int()),
|
|
@@ -92,7 +91,6 @@ export const GetGenerationData$inboundSchema = z.object({
|
|
|
92
91
|
"native_tokens_completion_images": "nativeTokensCompletionImages",
|
|
93
92
|
"native_tokens_prompt": "nativeTokensPrompt",
|
|
94
93
|
"native_tokens_reasoning": "nativeTokensReasoning",
|
|
95
|
-
"num_fetches": "numFetches",
|
|
96
94
|
"num_input_audio_prompt": "numInputAudioPrompt",
|
|
97
95
|
"num_media_completion": "numMediaCompletion",
|
|
98
96
|
"num_media_prompt": "numMediaPrompt",
|
|
@@ -31,7 +31,6 @@ import { ShellServerTool, ShellServerTool$Outbound } from "./shellservertool.js"
|
|
|
31
31
|
import { StoredPromptTemplate, StoredPromptTemplate$Outbound } from "./storedprompttemplate.js";
|
|
32
32
|
import { TextExtendedConfig, TextExtendedConfig$Outbound } from "./textextendedconfig.js";
|
|
33
33
|
import { TraceConfig, TraceConfig$Outbound } from "./traceconfig.js";
|
|
34
|
-
import { WebFetchServerTool, WebFetchServerTool$Outbound } from "./webfetchservertool.js";
|
|
35
34
|
import { WebSearchPlugin, WebSearchPlugin$Outbound } from "./websearchplugin.js";
|
|
36
35
|
import { WebSearchServerTool, WebSearchServerTool$Outbound } from "./websearchservertool.js";
|
|
37
36
|
import { WebSearchServerToolOpenRouter, WebSearchServerToolOpenRouter$Outbound } from "./websearchservertoolopenrouter.js";
|
|
@@ -62,8 +61,6 @@ export type ResponsesRequestToolUnion = ResponsesRequestToolFunction | PreviewWe
|
|
|
62
61
|
type: "openrouter:image_generation";
|
|
63
62
|
}) | (ChatSearchModelsServerTool & {
|
|
64
63
|
type: "openrouter:experimental__search_models";
|
|
65
|
-
}) | (WebFetchServerTool & {
|
|
66
|
-
type: "openrouter:web_fetch";
|
|
67
64
|
}) | WebSearchServerToolOpenRouter;
|
|
68
65
|
/**
|
|
69
66
|
* Request schema for Responses endpoint
|
|
@@ -134,8 +131,6 @@ export type ResponsesRequest = {
|
|
|
134
131
|
type: "openrouter:image_generation";
|
|
135
132
|
}) | (ChatSearchModelsServerTool & {
|
|
136
133
|
type: "openrouter:experimental__search_models";
|
|
137
|
-
}) | (WebFetchServerTool & {
|
|
138
|
-
type: "openrouter:web_fetch";
|
|
139
134
|
}) | WebSearchServerToolOpenRouter> | undefined;
|
|
140
135
|
topK?: number | undefined;
|
|
141
136
|
topLogprobs?: number | null | undefined;
|
|
@@ -177,8 +172,6 @@ export type ResponsesRequestToolUnion$Outbound = ResponsesRequestToolFunction$Ou
|
|
|
177
172
|
type: "openrouter:image_generation";
|
|
178
173
|
}) | (ChatSearchModelsServerTool$Outbound & {
|
|
179
174
|
type: "openrouter:experimental__search_models";
|
|
180
|
-
}) | (WebFetchServerTool$Outbound & {
|
|
181
|
-
type: "openrouter:web_fetch";
|
|
182
175
|
}) | WebSearchServerToolOpenRouter$Outbound;
|
|
183
176
|
/** @internal */
|
|
184
177
|
export declare const ResponsesRequestToolUnion$outboundSchema: z.ZodType<ResponsesRequestToolUnion$Outbound, ResponsesRequestToolUnion>;
|
|
@@ -223,8 +216,6 @@ export type ResponsesRequest$Outbound = {
|
|
|
223
216
|
type: "openrouter:image_generation";
|
|
224
217
|
}) | (ChatSearchModelsServerTool$Outbound & {
|
|
225
218
|
type: "openrouter:experimental__search_models";
|
|
226
|
-
}) | (WebFetchServerTool$Outbound & {
|
|
227
|
-
type: "openrouter:web_fetch";
|
|
228
219
|
}) | WebSearchServerToolOpenRouter$Outbound> | undefined;
|
|
229
220
|
top_k?: number | undefined;
|
|
230
221
|
top_logprobs?: number | null | undefined;
|
|
@@ -36,7 +36,6 @@ import { ShellServerTool$outboundSchema, } from "./shellservertool.js";
|
|
|
36
36
|
import { StoredPromptTemplate$outboundSchema, } from "./storedprompttemplate.js";
|
|
37
37
|
import { TextExtendedConfig$outboundSchema, } from "./textextendedconfig.js";
|
|
38
38
|
import { TraceConfig$outboundSchema, } from "./traceconfig.js";
|
|
39
|
-
import { WebFetchServerTool$outboundSchema, } from "./webfetchservertool.js";
|
|
40
39
|
import { WebSearchPlugin$outboundSchema, } from "./websearchplugin.js";
|
|
41
40
|
import { WebSearchServerTool$outboundSchema, } from "./websearchservertool.js";
|
|
42
41
|
import { WebSearchServerToolOpenRouter$outboundSchema, } from "./websearchservertoolopenrouter.js";
|
|
@@ -91,7 +90,6 @@ export const ResponsesRequestToolUnion$outboundSchema = z.union([
|
|
|
91
90
|
DatetimeServerTool$outboundSchema.and(z.object({ type: z.literal("openrouter:datetime") })),
|
|
92
91
|
ImageGenerationServerToolOpenRouter$outboundSchema.and(z.object({ type: z.literal("openrouter:image_generation") })),
|
|
93
92
|
ChatSearchModelsServerTool$outboundSchema.and(z.object({ type: z.literal("openrouter:experimental__search_models") })),
|
|
94
|
-
WebFetchServerTool$outboundSchema.and(z.object({ type: z.literal("openrouter:web_fetch") })),
|
|
95
93
|
WebSearchServerToolOpenRouter$outboundSchema,
|
|
96
94
|
]);
|
|
97
95
|
export function responsesRequestToolUnionToJSON(responsesRequestToolUnion) {
|
|
@@ -152,7 +150,6 @@ export const ResponsesRequest$outboundSchema = z.object({
|
|
|
152
150
|
DatetimeServerTool$outboundSchema.and(z.object({ type: z.literal("openrouter:datetime") })),
|
|
153
151
|
ImageGenerationServerToolOpenRouter$outboundSchema.and(z.object({ type: z.literal("openrouter:image_generation") })),
|
|
154
152
|
ChatSearchModelsServerTool$outboundSchema.and(z.object({ type: z.literal("openrouter:experimental__search_models") })),
|
|
155
|
-
WebFetchServerTool$outboundSchema.and(z.object({ type: z.literal("openrouter:web_fetch") })),
|
|
156
153
|
WebSearchServerToolOpenRouter$outboundSchema,
|
|
157
154
|
])).optional(),
|
|
158
155
|
topK: z.int().optional(),
|
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.7",
|
|
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": [
|
|
@@ -70,14 +70,14 @@
|
|
|
70
70
|
"build": "tsc",
|
|
71
71
|
"prepublishOnly": "npm run build",
|
|
72
72
|
"compile": "tsc",
|
|
73
|
-
"postinstall": "node scripts/check-types.js || true",
|
|
74
73
|
"prepare": "npm run build",
|
|
74
|
+
"test:watch": "vitest --watch --project unit",
|
|
75
|
+
"postinstall": "node scripts/check-types.js || true",
|
|
75
76
|
"test": "vitest --run --project unit",
|
|
77
|
+
"test:e2e": "vitest --run --project e2e",
|
|
76
78
|
"test:transit": "exit 0",
|
|
77
|
-
"test:watch": "vitest --watch --project unit",
|
|
78
79
|
"typecheck": "tsc --noEmit",
|
|
79
|
-
"typecheck:transit": "exit 0"
|
|
80
|
-
"test:e2e": "vitest --run --project e2e"
|
|
80
|
+
"typecheck:transit": "exit 0"
|
|
81
81
|
},
|
|
82
82
|
"peerDependencies": {},
|
|
83
83
|
"devDependencies": {
|
|
@@ -1,19 +0,0 @@
|
|
|
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
|
|
@@ -1,18 +0,0 @@
|
|
|
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
|
|
@@ -1,28 +0,0 @@
|
|
|
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
|
|
@@ -1,20 +0,0 @@
|
|
|
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
|
|
@@ -1,39 +0,0 @@
|
|
|
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
|
|
@@ -1,26 +0,0 @@
|
|
|
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
|