@openrouter/sdk 1.4.5 → 1.4.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/funcs/toolsGetTool.d.ts +18 -0
- package/esm/funcs/toolsGetTool.js +110 -0
- package/esm/funcs/toolsListTools.d.ts +19 -0
- package/esm/funcs/toolsListTools.js +107 -0
- package/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/models/chatrequest.d.ts +4 -3
- package/esm/models/chatrequest.js +2 -1
- package/esm/models/generationresponse.d.ts +4 -4
- package/esm/models/generationresponse.js +3 -3
- package/esm/models/gettoolresponse.d.ts +11 -0
- package/esm/models/gettoolresponse.js +15 -0
- package/esm/models/index.d.ts +11 -0
- package/esm/models/index.js +11 -0
- package/esm/models/listtoolsresponse.d.ts +25 -0
- package/esm/models/listtoolsresponse.js +29 -0
- package/esm/models/modelslistresponse.d.ts +4 -4
- package/esm/models/modelslistresponse.js +4 -4
- package/esm/models/operations/gettool.d.ts +80 -0
- package/esm/models/operations/gettool.js +43 -0
- package/esm/models/operations/index.d.ts +2 -0
- package/esm/models/operations/index.js +2 -0
- package/esm/models/operations/listtools.d.ts +93 -0
- package/esm/models/operations/listtools.js +43 -0
- package/esm/models/providerresponse.d.ts +1 -0
- package/esm/models/providerresponse.js +1 -0
- package/esm/models/responsesrequest.d.ts +4 -3
- package/esm/models/responsesrequest.js +2 -1
- package/esm/models/servertool.d.ts +79 -0
- package/esm/models/servertool.js +59 -0
- package/esm/models/servertooldetails.d.ts +90 -0
- package/esm/models/servertooldetails.js +73 -0
- package/esm/models/servertoolengine.d.ts +82 -0
- package/esm/models/servertoolengine.js +63 -0
- package/esm/models/servertoolexecutedby.d.ts +17 -0
- package/esm/models/servertoolexecutedby.js +16 -0
- package/esm/models/servertoolinputname.d.ts +28 -0
- package/esm/models/servertoolinputname.js +31 -0
- package/esm/models/servertoolnativemodel.d.ts +11 -0
- package/esm/models/servertoolnativemodel.js +15 -0
- package/esm/models/servertoolnativesupport.d.ts +14 -0
- package/esm/models/servertoolnativesupport.js +21 -0
- package/esm/models/servertooloutputname.d.ts +27 -0
- package/esm/models/servertooloutputname.js +29 -0
- package/esm/models/servertoolprice.d.ts +19 -0
- package/esm/models/servertoolprice.js +22 -0
- package/esm/sdk/sdk.d.ts +3 -0
- package/esm/sdk/sdk.js +4 -0
- package/esm/sdk/tools.d.ts +20 -0
- package/esm/sdk/tools.js +29 -0
- package/jsr.json +1 -1
- package/package.json +7 -7
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
3
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
4
|
+
import * as models from "../index.js";
|
|
5
|
+
export type GetToolGlobals = {
|
|
6
|
+
/**
|
|
7
|
+
* The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
|
8
|
+
*
|
|
9
|
+
* @remarks
|
|
10
|
+
* This is used to track API usage per application.
|
|
11
|
+
*/
|
|
12
|
+
httpReferer?: string | undefined;
|
|
13
|
+
/**
|
|
14
|
+
* The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
|
15
|
+
*
|
|
16
|
+
* @remarks
|
|
17
|
+
*/
|
|
18
|
+
appTitle?: string | undefined;
|
|
19
|
+
/**
|
|
20
|
+
* Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
|
|
21
|
+
*
|
|
22
|
+
* @remarks
|
|
23
|
+
*/
|
|
24
|
+
appCategories?: string | undefined;
|
|
25
|
+
};
|
|
26
|
+
export type GetToolSecurity = {
|
|
27
|
+
bearer: string;
|
|
28
|
+
};
|
|
29
|
+
export type GetToolRequest = {
|
|
30
|
+
/**
|
|
31
|
+
* The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
|
32
|
+
*
|
|
33
|
+
* @remarks
|
|
34
|
+
* This is used to track API usage per application.
|
|
35
|
+
*/
|
|
36
|
+
httpReferer?: string | undefined;
|
|
37
|
+
/**
|
|
38
|
+
* The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
|
39
|
+
*
|
|
40
|
+
* @remarks
|
|
41
|
+
*/
|
|
42
|
+
appTitle?: string | undefined;
|
|
43
|
+
/**
|
|
44
|
+
* Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
|
|
45
|
+
*
|
|
46
|
+
* @remarks
|
|
47
|
+
*/
|
|
48
|
+
appCategories?: string | undefined;
|
|
49
|
+
/**
|
|
50
|
+
* Canonical `openrouter:*` name or any accepted `tools[].type` alias
|
|
51
|
+
*/
|
|
52
|
+
name: string;
|
|
53
|
+
};
|
|
54
|
+
export type GetToolResponse = {
|
|
55
|
+
headers: {
|
|
56
|
+
[k: string]: Array<string>;
|
|
57
|
+
};
|
|
58
|
+
result?: models.GetToolResponse | undefined;
|
|
59
|
+
};
|
|
60
|
+
/** @internal */
|
|
61
|
+
export type GetToolSecurity$Outbound = {
|
|
62
|
+
bearer: string;
|
|
63
|
+
};
|
|
64
|
+
/** @internal */
|
|
65
|
+
export declare const GetToolSecurity$outboundSchema: z.ZodType<GetToolSecurity$Outbound, GetToolSecurity>;
|
|
66
|
+
export declare function getToolSecurityToJSON(getToolSecurity: GetToolSecurity): string;
|
|
67
|
+
/** @internal */
|
|
68
|
+
export type GetToolRequest$Outbound = {
|
|
69
|
+
"HTTP-Referer"?: string | undefined;
|
|
70
|
+
appTitle?: string | undefined;
|
|
71
|
+
appCategories?: string | undefined;
|
|
72
|
+
name: string;
|
|
73
|
+
};
|
|
74
|
+
/** @internal */
|
|
75
|
+
export declare const GetToolRequest$outboundSchema: z.ZodType<GetToolRequest$Outbound, GetToolRequest>;
|
|
76
|
+
export declare function getToolRequestToJSON(getToolRequest: GetToolRequest): string;
|
|
77
|
+
/** @internal */
|
|
78
|
+
export declare const GetToolResponse$inboundSchema: z.ZodType<GetToolResponse, unknown>;
|
|
79
|
+
export declare function getToolResponseFromJSON(jsonString: string): SafeParseResult<GetToolResponse, SDKValidationError>;
|
|
80
|
+
//# sourceMappingURL=gettool.d.ts.map
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 643b31a6a57a
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { GetToolResponse$inboundSchema as models_GetToolResponse$inboundSchema } from "../gettoolresponse.js";
|
|
9
|
+
/** @internal */
|
|
10
|
+
export const GetToolSecurity$outboundSchema = z.object({
|
|
11
|
+
bearer: z.string(),
|
|
12
|
+
});
|
|
13
|
+
export function getToolSecurityToJSON(getToolSecurity) {
|
|
14
|
+
return JSON.stringify(GetToolSecurity$outboundSchema.parse(getToolSecurity));
|
|
15
|
+
}
|
|
16
|
+
/** @internal */
|
|
17
|
+
export const GetToolRequest$outboundSchema = z.object({
|
|
18
|
+
httpReferer: z.string().optional(),
|
|
19
|
+
appTitle: z.string().optional(),
|
|
20
|
+
appCategories: z.string().optional(),
|
|
21
|
+
name: z.string(),
|
|
22
|
+
}).transform((v) => {
|
|
23
|
+
return remap$(v, {
|
|
24
|
+
httpReferer: "HTTP-Referer",
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
export function getToolRequestToJSON(getToolRequest) {
|
|
28
|
+
return JSON.stringify(GetToolRequest$outboundSchema.parse(getToolRequest));
|
|
29
|
+
}
|
|
30
|
+
/** @internal */
|
|
31
|
+
export const GetToolResponse$inboundSchema = z.object({
|
|
32
|
+
Headers: z.record(z.string(), z.array(z.string())).default({}),
|
|
33
|
+
Result: models_GetToolResponse$inboundSchema.optional(),
|
|
34
|
+
}).transform((v) => {
|
|
35
|
+
return remap$(v, {
|
|
36
|
+
"Headers": "headers",
|
|
37
|
+
"Result": "result",
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
export function getToolResponseFromJSON(jsonString) {
|
|
41
|
+
return safeParse(jsonString, (x) => GetToolResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetToolResponse' from JSON`);
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=gettool.js.map
|
|
@@ -76,6 +76,7 @@ export * from "./getscimgroupmapping.js";
|
|
|
76
76
|
export * from "./getscimsyncjob.js";
|
|
77
77
|
export * from "./getsessioncost.js";
|
|
78
78
|
export * from "./gettaskclassifications.js";
|
|
79
|
+
export * from "./gettool.js";
|
|
79
80
|
export * from "./getuseractivity.js";
|
|
80
81
|
export * from "./getvideos.js";
|
|
81
82
|
export * from "./getworkspace.js";
|
|
@@ -111,6 +112,7 @@ export * from "./listprivateendpoints.js";
|
|
|
111
112
|
export * from "./listproviders.js";
|
|
112
113
|
export * from "./listscimgroupmappings.js";
|
|
113
114
|
export * from "./listscimgroups.js";
|
|
115
|
+
export * from "./listtools.js";
|
|
114
116
|
export * from "./listvaultsecrets.js";
|
|
115
117
|
export * from "./listvideoscontent.js";
|
|
116
118
|
export * from "./listvideosmodels.js";
|
|
@@ -80,6 +80,7 @@ export * from "./getscimgroupmapping.js";
|
|
|
80
80
|
export * from "./getscimsyncjob.js";
|
|
81
81
|
export * from "./getsessioncost.js";
|
|
82
82
|
export * from "./gettaskclassifications.js";
|
|
83
|
+
export * from "./gettool.js";
|
|
83
84
|
export * from "./getuseractivity.js";
|
|
84
85
|
export * from "./getvideos.js";
|
|
85
86
|
export * from "./getworkspace.js";
|
|
@@ -115,6 +116,7 @@ export * from "./listprivateendpoints.js";
|
|
|
115
116
|
export * from "./listproviders.js";
|
|
116
117
|
export * from "./listscimgroupmappings.js";
|
|
117
118
|
export * from "./listscimgroups.js";
|
|
119
|
+
export * from "./listtools.js";
|
|
118
120
|
export * from "./listvaultsecrets.js";
|
|
119
121
|
export * from "./listvideoscontent.js";
|
|
120
122
|
export * from "./listvideosmodels.js";
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { OpenEnum } from "../../types/enums.js";
|
|
3
|
+
export type ListToolsGlobals = {
|
|
4
|
+
/**
|
|
5
|
+
* The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
|
6
|
+
*
|
|
7
|
+
* @remarks
|
|
8
|
+
* This is used to track API usage per application.
|
|
9
|
+
*/
|
|
10
|
+
httpReferer?: string | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
|
13
|
+
*
|
|
14
|
+
* @remarks
|
|
15
|
+
*/
|
|
16
|
+
appTitle?: string | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
|
|
19
|
+
*
|
|
20
|
+
* @remarks
|
|
21
|
+
*/
|
|
22
|
+
appCategories?: string | undefined;
|
|
23
|
+
};
|
|
24
|
+
export type ListToolsSecurity = {
|
|
25
|
+
bearer: string;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Only tools usable on this API format
|
|
29
|
+
*/
|
|
30
|
+
export declare const ApiFormat: {
|
|
31
|
+
readonly Responses: "responses";
|
|
32
|
+
readonly ChatCompletions: "chat-completions";
|
|
33
|
+
readonly AnthropicMessages: "anthropic-messages";
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Only tools usable on this API format
|
|
37
|
+
*/
|
|
38
|
+
export type ApiFormat = OpenEnum<typeof ApiFormat>;
|
|
39
|
+
export type ListToolsRequest = {
|
|
40
|
+
/**
|
|
41
|
+
* The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
|
42
|
+
*
|
|
43
|
+
* @remarks
|
|
44
|
+
* This is used to track API usage per application.
|
|
45
|
+
*/
|
|
46
|
+
httpReferer?: string | undefined;
|
|
47
|
+
/**
|
|
48
|
+
* The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
|
49
|
+
*
|
|
50
|
+
* @remarks
|
|
51
|
+
*/
|
|
52
|
+
appTitle?: string | undefined;
|
|
53
|
+
/**
|
|
54
|
+
* Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
|
|
55
|
+
*
|
|
56
|
+
* @remarks
|
|
57
|
+
*/
|
|
58
|
+
appCategories?: string | undefined;
|
|
59
|
+
/**
|
|
60
|
+
* Number of records to skip for pagination. When both offset and limit are omitted, the full list is returned
|
|
61
|
+
*/
|
|
62
|
+
offset?: number | null | undefined;
|
|
63
|
+
/**
|
|
64
|
+
* Maximum number of records to return (max 100). When both offset and limit are omitted, the full list is returned
|
|
65
|
+
*/
|
|
66
|
+
limit?: number | undefined;
|
|
67
|
+
/**
|
|
68
|
+
* Only tools usable on this API format
|
|
69
|
+
*/
|
|
70
|
+
apiFormat?: ApiFormat | undefined;
|
|
71
|
+
};
|
|
72
|
+
/** @internal */
|
|
73
|
+
export type ListToolsSecurity$Outbound = {
|
|
74
|
+
bearer: string;
|
|
75
|
+
};
|
|
76
|
+
/** @internal */
|
|
77
|
+
export declare const ListToolsSecurity$outboundSchema: z.ZodType<ListToolsSecurity$Outbound, ListToolsSecurity>;
|
|
78
|
+
export declare function listToolsSecurityToJSON(listToolsSecurity: ListToolsSecurity): string;
|
|
79
|
+
/** @internal */
|
|
80
|
+
export declare const ApiFormat$outboundSchema: z.ZodType<string, ApiFormat>;
|
|
81
|
+
/** @internal */
|
|
82
|
+
export type ListToolsRequest$Outbound = {
|
|
83
|
+
"HTTP-Referer"?: string | undefined;
|
|
84
|
+
appTitle?: string | undefined;
|
|
85
|
+
appCategories?: string | undefined;
|
|
86
|
+
offset: number | null;
|
|
87
|
+
limit: number;
|
|
88
|
+
api_format?: string | undefined;
|
|
89
|
+
};
|
|
90
|
+
/** @internal */
|
|
91
|
+
export declare const ListToolsRequest$outboundSchema: z.ZodType<ListToolsRequest$Outbound, ListToolsRequest>;
|
|
92
|
+
export declare function listToolsRequestToJSON(listToolsRequest: ListToolsRequest): string;
|
|
93
|
+
//# sourceMappingURL=listtools.d.ts.map
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 42a61de0bc0f
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import * as openEnums from "../../types/enums.js";
|
|
8
|
+
/**
|
|
9
|
+
* Only tools usable on this API format
|
|
10
|
+
*/
|
|
11
|
+
export const ApiFormat = {
|
|
12
|
+
Responses: "responses",
|
|
13
|
+
ChatCompletions: "chat-completions",
|
|
14
|
+
AnthropicMessages: "anthropic-messages",
|
|
15
|
+
};
|
|
16
|
+
/** @internal */
|
|
17
|
+
export const ListToolsSecurity$outboundSchema = z.object({
|
|
18
|
+
bearer: z.string(),
|
|
19
|
+
});
|
|
20
|
+
export function listToolsSecurityToJSON(listToolsSecurity) {
|
|
21
|
+
return JSON.stringify(ListToolsSecurity$outboundSchema.parse(listToolsSecurity));
|
|
22
|
+
}
|
|
23
|
+
/** @internal */
|
|
24
|
+
export const ApiFormat$outboundSchema = openEnums
|
|
25
|
+
.outboundSchema(ApiFormat);
|
|
26
|
+
/** @internal */
|
|
27
|
+
export const ListToolsRequest$outboundSchema = z.object({
|
|
28
|
+
httpReferer: z.string().optional(),
|
|
29
|
+
appTitle: z.string().optional(),
|
|
30
|
+
appCategories: z.string().optional(),
|
|
31
|
+
offset: z.nullable(z.int().default(0)),
|
|
32
|
+
limit: z.int().default(50),
|
|
33
|
+
apiFormat: ApiFormat$outboundSchema.optional(),
|
|
34
|
+
}).transform((v) => {
|
|
35
|
+
return remap$(v, {
|
|
36
|
+
httpReferer: "HTTP-Referer",
|
|
37
|
+
apiFormat: "api_format",
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
export function listToolsRequestToJSON(listToolsRequest) {
|
|
41
|
+
return JSON.stringify(ListToolsRequest$outboundSchema.parse(listToolsRequest));
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=listtools.js.map
|
|
@@ -159,6 +159,7 @@ export type ProviderResponseProviderName = OpenEnum<typeof ProviderResponseProvi
|
|
|
159
159
|
export declare const RoutedServiceTier: {
|
|
160
160
|
readonly Flex: "flex";
|
|
161
161
|
readonly Priority: "priority";
|
|
162
|
+
readonly Ultrafast: "ultrafast";
|
|
162
163
|
};
|
|
163
164
|
/**
|
|
164
165
|
* The service tier this request was routed to (e.g. flex, priority). The tier actually applied and billed is determined by the provider response and may differ.
|
|
@@ -159,6 +159,7 @@ export const ProviderResponseProviderName = {
|
|
|
159
159
|
export const RoutedServiceTier = {
|
|
160
160
|
Flex: "flex",
|
|
161
161
|
Priority: "priority",
|
|
162
|
+
Ultrafast: "ultrafast",
|
|
162
163
|
};
|
|
163
164
|
/** @internal */
|
|
164
165
|
export const ProviderResponseProviderName$inboundSchema = openEnums.inboundSchema(ProviderResponseProviderName);
|
|
@@ -73,7 +73,7 @@ export type ReasoningConfig = {
|
|
|
73
73
|
maxTokens?: number | null | undefined;
|
|
74
74
|
};
|
|
75
75
|
/**
|
|
76
|
-
* The service tier to use for processing this request. `fast` is accepted as an alias for `priority`.
|
|
76
|
+
* The service tier to use for processing this request. `fast` is accepted as an alias for `priority`. `ultrafast` prefers ultrafast endpoints and falls back to `priority`, then default endpoints.
|
|
77
77
|
*/
|
|
78
78
|
export declare const ResponsesRequestServiceTier: {
|
|
79
79
|
readonly Auto: "auto";
|
|
@@ -82,9 +82,10 @@ export declare const ResponsesRequestServiceTier: {
|
|
|
82
82
|
readonly Flex: "flex";
|
|
83
83
|
readonly Priority: "priority";
|
|
84
84
|
readonly Scale: "scale";
|
|
85
|
+
readonly Ultrafast: "ultrafast";
|
|
85
86
|
};
|
|
86
87
|
/**
|
|
87
|
-
* The service tier to use for processing this request. `fast` is accepted as an alias for `priority`.
|
|
88
|
+
* The service tier to use for processing this request. `fast` is accepted as an alias for `priority`. `ultrafast` prefers ultrafast endpoints and falls back to `priority`, then default endpoints.
|
|
88
89
|
*/
|
|
89
90
|
export type ResponsesRequestServiceTier = OpenEnum<typeof ResponsesRequestServiceTier>;
|
|
90
91
|
/**
|
|
@@ -234,7 +235,7 @@ export type ResponsesRequest = {
|
|
|
234
235
|
*/
|
|
235
236
|
safetyIdentifier?: string | null | undefined;
|
|
236
237
|
/**
|
|
237
|
-
* The service tier to use for processing this request. `fast` is accepted as an alias for `priority`.
|
|
238
|
+
* The service tier to use for processing this request. `fast` is accepted as an alias for `priority`. `ultrafast` prefers ultrafast endpoints and falls back to `priority`, then default endpoints.
|
|
238
239
|
*/
|
|
239
240
|
serviceTier?: ResponsesRequestServiceTier | null | undefined;
|
|
240
241
|
/**
|
|
@@ -63,7 +63,7 @@ import { WebSearchPlugin$outboundSchema, } from "./websearchplugin.js";
|
|
|
63
63
|
import { WebSearchServerTool$outboundSchema, } from "./websearchservertool.js";
|
|
64
64
|
import { WebSearchServerToolOpenRouter$outboundSchema, } from "./websearchservertoolopenrouter.js";
|
|
65
65
|
/**
|
|
66
|
-
* The service tier to use for processing this request. `fast` is accepted as an alias for `priority`.
|
|
66
|
+
* The service tier to use for processing this request. `fast` is accepted as an alias for `priority`. `ultrafast` prefers ultrafast endpoints and falls back to `priority`, then default endpoints.
|
|
67
67
|
*/
|
|
68
68
|
export const ResponsesRequestServiceTier = {
|
|
69
69
|
Auto: "auto",
|
|
@@ -72,6 +72,7 @@ export const ResponsesRequestServiceTier = {
|
|
|
72
72
|
Flex: "flex",
|
|
73
73
|
Priority: "priority",
|
|
74
74
|
Scale: "scale",
|
|
75
|
+
Ultrafast: "ultrafast",
|
|
75
76
|
};
|
|
76
77
|
/** @internal */
|
|
77
78
|
export const ResponsesRequestPlugin$outboundSchema = z.union([
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { OpenEnum } from "../types/enums.js";
|
|
3
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
4
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
|
+
import { ServerToolEngine } from "./servertoolengine.js";
|
|
6
|
+
import { ServerToolInputName } from "./servertoolinputname.js";
|
|
7
|
+
import { ServerToolNativeSupport } from "./servertoolnativesupport.js";
|
|
8
|
+
export declare const ServerToolStatus: {
|
|
9
|
+
readonly Active: "active";
|
|
10
|
+
readonly Deprecated: "deprecated";
|
|
11
|
+
};
|
|
12
|
+
export type ServerToolStatus = OpenEnum<typeof ServerToolStatus>;
|
|
13
|
+
export declare const ServerToolSupportedApiFormat: {
|
|
14
|
+
readonly Responses: "responses";
|
|
15
|
+
readonly ChatCompletions: "chat-completions";
|
|
16
|
+
readonly AnthropicMessages: "anthropic-messages";
|
|
17
|
+
};
|
|
18
|
+
export type ServerToolSupportedApiFormat = OpenEnum<typeof ServerToolSupportedApiFormat>;
|
|
19
|
+
export type ServerTool = {
|
|
20
|
+
/**
|
|
21
|
+
* Every spelling accepted in `tools[].type` for this tool, including the canonical `id`, and what the call surfaces as under each
|
|
22
|
+
*/
|
|
23
|
+
aliases: Array<ServerToolInputName>;
|
|
24
|
+
/**
|
|
25
|
+
* The engine a request without `parameters.engine` (or with `engine: "auto"`) runs on; `native` applies where the endpoint runs the tool itself, otherwise `fallback_engine`. A request pinned to a data region skips either engine when its `data_regions` does not list that region. Null for a tool without an engine parameter
|
|
26
|
+
*/
|
|
27
|
+
defaultEngine: string | null;
|
|
28
|
+
docsUrl: string;
|
|
29
|
+
engines: Array<ServerToolEngine>;
|
|
30
|
+
/**
|
|
31
|
+
* The engine an unpinned request runs on when `default_engine` is `native` and the endpoint does not run the tool itself; null when there is no fallback
|
|
32
|
+
*/
|
|
33
|
+
fallbackEngine: string | null;
|
|
34
|
+
/**
|
|
35
|
+
* Canonical `openrouter:*` name; the stable `tools[].type` on every API format in `supported_api_formats`
|
|
36
|
+
*/
|
|
37
|
+
id: string;
|
|
38
|
+
/**
|
|
39
|
+
* JSON Schema of the arguments the model emits when calling the tool
|
|
40
|
+
*/
|
|
41
|
+
inputSchema: {
|
|
42
|
+
[k: string]: any;
|
|
43
|
+
};
|
|
44
|
+
name: string;
|
|
45
|
+
/**
|
|
46
|
+
* Endpoints whose provider runs this tool itself during inference. Zero for tools no provider runs natively.
|
|
47
|
+
*/
|
|
48
|
+
nativeSupport: ServerToolNativeSupport;
|
|
49
|
+
/**
|
|
50
|
+
* JSON Schema of the result returned to the model; null when undeclared
|
|
51
|
+
*/
|
|
52
|
+
outputSchema: {
|
|
53
|
+
[k: string]: any;
|
|
54
|
+
} | null;
|
|
55
|
+
/**
|
|
56
|
+
* JSON Schema for the caller-side `tools[].parameters` object
|
|
57
|
+
*/
|
|
58
|
+
parametersSchema: {
|
|
59
|
+
[k: string]: any;
|
|
60
|
+
};
|
|
61
|
+
status: ServerToolStatus;
|
|
62
|
+
/**
|
|
63
|
+
* One sentence for cards and search results; never sent to a model
|
|
64
|
+
*/
|
|
65
|
+
summary: string;
|
|
66
|
+
supportedApiFormats: Array<ServerToolSupportedApiFormat>;
|
|
67
|
+
/**
|
|
68
|
+
* The description sent upstream as the function tool description
|
|
69
|
+
*/
|
|
70
|
+
toolDescription: string;
|
|
71
|
+
};
|
|
72
|
+
/** @internal */
|
|
73
|
+
export declare const ServerToolStatus$inboundSchema: z.ZodType<ServerToolStatus, unknown>;
|
|
74
|
+
/** @internal */
|
|
75
|
+
export declare const ServerToolSupportedApiFormat$inboundSchema: z.ZodType<ServerToolSupportedApiFormat, unknown>;
|
|
76
|
+
/** @internal */
|
|
77
|
+
export declare const ServerTool$inboundSchema: z.ZodType<ServerTool, unknown>;
|
|
78
|
+
export declare function serverToolFromJSON(jsonString: string): SafeParseResult<ServerTool, SDKValidationError>;
|
|
79
|
+
//# sourceMappingURL=servertool.d.ts.map
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 51581c50c8ce
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../lib/schemas.js";
|
|
8
|
+
import * as openEnums from "../types/enums.js";
|
|
9
|
+
import { ServerToolEngine$inboundSchema, } from "./servertoolengine.js";
|
|
10
|
+
import { ServerToolInputName$inboundSchema, } from "./servertoolinputname.js";
|
|
11
|
+
import { ServerToolNativeSupport$inboundSchema, } from "./servertoolnativesupport.js";
|
|
12
|
+
export const ServerToolStatus = {
|
|
13
|
+
Active: "active",
|
|
14
|
+
Deprecated: "deprecated",
|
|
15
|
+
};
|
|
16
|
+
export const ServerToolSupportedApiFormat = {
|
|
17
|
+
Responses: "responses",
|
|
18
|
+
ChatCompletions: "chat-completions",
|
|
19
|
+
AnthropicMessages: "anthropic-messages",
|
|
20
|
+
};
|
|
21
|
+
/** @internal */
|
|
22
|
+
export const ServerToolStatus$inboundSchema = openEnums.inboundSchema(ServerToolStatus);
|
|
23
|
+
/** @internal */
|
|
24
|
+
export const ServerToolSupportedApiFormat$inboundSchema = openEnums.inboundSchema(ServerToolSupportedApiFormat);
|
|
25
|
+
/** @internal */
|
|
26
|
+
export const ServerTool$inboundSchema = z
|
|
27
|
+
.object({
|
|
28
|
+
aliases: z.array(ServerToolInputName$inboundSchema),
|
|
29
|
+
default_engine: z.nullable(z.string()),
|
|
30
|
+
docs_url: z.string(),
|
|
31
|
+
engines: z.array(ServerToolEngine$inboundSchema),
|
|
32
|
+
fallback_engine: z.nullable(z.string()),
|
|
33
|
+
id: z.string(),
|
|
34
|
+
input_schema: z.record(z.string(), z.any()),
|
|
35
|
+
name: z.string(),
|
|
36
|
+
native_support: ServerToolNativeSupport$inboundSchema,
|
|
37
|
+
output_schema: z.nullable(z.record(z.string(), z.any())),
|
|
38
|
+
parameters_schema: z.record(z.string(), z.any()),
|
|
39
|
+
status: ServerToolStatus$inboundSchema,
|
|
40
|
+
summary: z.string(),
|
|
41
|
+
supported_api_formats: z.array(ServerToolSupportedApiFormat$inboundSchema),
|
|
42
|
+
tool_description: z.string(),
|
|
43
|
+
}).transform((v) => {
|
|
44
|
+
return remap$(v, {
|
|
45
|
+
"default_engine": "defaultEngine",
|
|
46
|
+
"docs_url": "docsUrl",
|
|
47
|
+
"fallback_engine": "fallbackEngine",
|
|
48
|
+
"input_schema": "inputSchema",
|
|
49
|
+
"native_support": "nativeSupport",
|
|
50
|
+
"output_schema": "outputSchema",
|
|
51
|
+
"parameters_schema": "parametersSchema",
|
|
52
|
+
"supported_api_formats": "supportedApiFormats",
|
|
53
|
+
"tool_description": "toolDescription",
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
export function serverToolFromJSON(jsonString) {
|
|
57
|
+
return safeParse(jsonString, (x) => ServerTool$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ServerTool' from JSON`);
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=servertool.js.map
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { OpenEnum } from "../types/enums.js";
|
|
3
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
4
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
|
+
import { ServerToolEngine } from "./servertoolengine.js";
|
|
6
|
+
import { ServerToolInputName } from "./servertoolinputname.js";
|
|
7
|
+
import { ServerToolNativeModel } from "./servertoolnativemodel.js";
|
|
8
|
+
/**
|
|
9
|
+
* Endpoints whose provider runs this tool itself during inference. Zero for tools no provider runs natively.
|
|
10
|
+
*/
|
|
11
|
+
export type NativeSupport = {
|
|
12
|
+
endpointCount: number;
|
|
13
|
+
modelCount: number;
|
|
14
|
+
models: Array<ServerToolNativeModel>;
|
|
15
|
+
};
|
|
16
|
+
export declare const ServerToolDetailsStatus: {
|
|
17
|
+
readonly Active: "active";
|
|
18
|
+
readonly Deprecated: "deprecated";
|
|
19
|
+
};
|
|
20
|
+
export type ServerToolDetailsStatus = OpenEnum<typeof ServerToolDetailsStatus>;
|
|
21
|
+
export declare const ServerToolDetailsSupportedApiFormat: {
|
|
22
|
+
readonly Responses: "responses";
|
|
23
|
+
readonly ChatCompletions: "chat-completions";
|
|
24
|
+
readonly AnthropicMessages: "anthropic-messages";
|
|
25
|
+
};
|
|
26
|
+
export type ServerToolDetailsSupportedApiFormat = OpenEnum<typeof ServerToolDetailsSupportedApiFormat>;
|
|
27
|
+
export type ServerToolDetails = {
|
|
28
|
+
/**
|
|
29
|
+
* Every spelling accepted in `tools[].type` for this tool, including the canonical `id`, and what the call surfaces as under each
|
|
30
|
+
*/
|
|
31
|
+
aliases: Array<ServerToolInputName>;
|
|
32
|
+
/**
|
|
33
|
+
* The engine a request without `parameters.engine` (or with `engine: "auto"`) runs on; `native` applies where the endpoint runs the tool itself, otherwise `fallback_engine`. A request pinned to a data region skips either engine when its `data_regions` does not list that region. Null for a tool without an engine parameter
|
|
34
|
+
*/
|
|
35
|
+
defaultEngine: string | null;
|
|
36
|
+
docsUrl: string;
|
|
37
|
+
engines: Array<ServerToolEngine>;
|
|
38
|
+
/**
|
|
39
|
+
* The engine an unpinned request runs on when `default_engine` is `native` and the endpoint does not run the tool itself; null when there is no fallback
|
|
40
|
+
*/
|
|
41
|
+
fallbackEngine: string | null;
|
|
42
|
+
/**
|
|
43
|
+
* Canonical `openrouter:*` name; the stable `tools[].type` on every API format in `supported_api_formats`
|
|
44
|
+
*/
|
|
45
|
+
id: string;
|
|
46
|
+
/**
|
|
47
|
+
* JSON Schema of the arguments the model emits when calling the tool
|
|
48
|
+
*/
|
|
49
|
+
inputSchema: {
|
|
50
|
+
[k: string]: any;
|
|
51
|
+
};
|
|
52
|
+
name: string;
|
|
53
|
+
/**
|
|
54
|
+
* Endpoints whose provider runs this tool itself during inference. Zero for tools no provider runs natively.
|
|
55
|
+
*/
|
|
56
|
+
nativeSupport: NativeSupport;
|
|
57
|
+
/**
|
|
58
|
+
* JSON Schema of the result returned to the model; null when undeclared
|
|
59
|
+
*/
|
|
60
|
+
outputSchema: {
|
|
61
|
+
[k: string]: any;
|
|
62
|
+
} | null;
|
|
63
|
+
/**
|
|
64
|
+
* JSON Schema for the caller-side `tools[].parameters` object
|
|
65
|
+
*/
|
|
66
|
+
parametersSchema: {
|
|
67
|
+
[k: string]: any;
|
|
68
|
+
};
|
|
69
|
+
status: ServerToolDetailsStatus;
|
|
70
|
+
/**
|
|
71
|
+
* One sentence for cards and search results; never sent to a model
|
|
72
|
+
*/
|
|
73
|
+
summary: string;
|
|
74
|
+
supportedApiFormats: Array<ServerToolDetailsSupportedApiFormat>;
|
|
75
|
+
/**
|
|
76
|
+
* The description sent upstream as the function tool description
|
|
77
|
+
*/
|
|
78
|
+
toolDescription: string;
|
|
79
|
+
};
|
|
80
|
+
/** @internal */
|
|
81
|
+
export declare const NativeSupport$inboundSchema: z.ZodType<NativeSupport, unknown>;
|
|
82
|
+
export declare function nativeSupportFromJSON(jsonString: string): SafeParseResult<NativeSupport, SDKValidationError>;
|
|
83
|
+
/** @internal */
|
|
84
|
+
export declare const ServerToolDetailsStatus$inboundSchema: z.ZodType<ServerToolDetailsStatus, unknown>;
|
|
85
|
+
/** @internal */
|
|
86
|
+
export declare const ServerToolDetailsSupportedApiFormat$inboundSchema: z.ZodType<ServerToolDetailsSupportedApiFormat, unknown>;
|
|
87
|
+
/** @internal */
|
|
88
|
+
export declare const ServerToolDetails$inboundSchema: z.ZodType<ServerToolDetails, unknown>;
|
|
89
|
+
export declare function serverToolDetailsFromJSON(jsonString: string): SafeParseResult<ServerToolDetails, SDKValidationError>;
|
|
90
|
+
//# sourceMappingURL=servertooldetails.d.ts.map
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: f94cb5399ef7
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../lib/schemas.js";
|
|
8
|
+
import * as openEnums from "../types/enums.js";
|
|
9
|
+
import { ServerToolEngine$inboundSchema, } from "./servertoolengine.js";
|
|
10
|
+
import { ServerToolInputName$inboundSchema, } from "./servertoolinputname.js";
|
|
11
|
+
import { ServerToolNativeModel$inboundSchema, } from "./servertoolnativemodel.js";
|
|
12
|
+
export const ServerToolDetailsStatus = {
|
|
13
|
+
Active: "active",
|
|
14
|
+
Deprecated: "deprecated",
|
|
15
|
+
};
|
|
16
|
+
export const ServerToolDetailsSupportedApiFormat = {
|
|
17
|
+
Responses: "responses",
|
|
18
|
+
ChatCompletions: "chat-completions",
|
|
19
|
+
AnthropicMessages: "anthropic-messages",
|
|
20
|
+
};
|
|
21
|
+
/** @internal */
|
|
22
|
+
export const NativeSupport$inboundSchema = z
|
|
23
|
+
.object({
|
|
24
|
+
endpoint_count: z.int(),
|
|
25
|
+
model_count: z.int(),
|
|
26
|
+
models: z.array(ServerToolNativeModel$inboundSchema),
|
|
27
|
+
}).transform((v) => {
|
|
28
|
+
return remap$(v, {
|
|
29
|
+
"endpoint_count": "endpointCount",
|
|
30
|
+
"model_count": "modelCount",
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
export function nativeSupportFromJSON(jsonString) {
|
|
34
|
+
return safeParse(jsonString, (x) => NativeSupport$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'NativeSupport' from JSON`);
|
|
35
|
+
}
|
|
36
|
+
/** @internal */
|
|
37
|
+
export const ServerToolDetailsStatus$inboundSchema = openEnums.inboundSchema(ServerToolDetailsStatus);
|
|
38
|
+
/** @internal */
|
|
39
|
+
export const ServerToolDetailsSupportedApiFormat$inboundSchema = openEnums.inboundSchema(ServerToolDetailsSupportedApiFormat);
|
|
40
|
+
/** @internal */
|
|
41
|
+
export const ServerToolDetails$inboundSchema = z.object({
|
|
42
|
+
aliases: z.array(ServerToolInputName$inboundSchema),
|
|
43
|
+
default_engine: z.nullable(z.string()),
|
|
44
|
+
docs_url: z.string(),
|
|
45
|
+
engines: z.array(ServerToolEngine$inboundSchema),
|
|
46
|
+
fallback_engine: z.nullable(z.string()),
|
|
47
|
+
id: z.string(),
|
|
48
|
+
input_schema: z.record(z.string(), z.any()),
|
|
49
|
+
name: z.string(),
|
|
50
|
+
native_support: z.lazy(() => NativeSupport$inboundSchema),
|
|
51
|
+
output_schema: z.nullable(z.record(z.string(), z.any())),
|
|
52
|
+
parameters_schema: z.record(z.string(), z.any()),
|
|
53
|
+
status: ServerToolDetailsStatus$inboundSchema,
|
|
54
|
+
summary: z.string(),
|
|
55
|
+
supported_api_formats: z.array(ServerToolDetailsSupportedApiFormat$inboundSchema),
|
|
56
|
+
tool_description: z.string(),
|
|
57
|
+
}).transform((v) => {
|
|
58
|
+
return remap$(v, {
|
|
59
|
+
"default_engine": "defaultEngine",
|
|
60
|
+
"docs_url": "docsUrl",
|
|
61
|
+
"fallback_engine": "fallbackEngine",
|
|
62
|
+
"input_schema": "inputSchema",
|
|
63
|
+
"native_support": "nativeSupport",
|
|
64
|
+
"output_schema": "outputSchema",
|
|
65
|
+
"parameters_schema": "parametersSchema",
|
|
66
|
+
"supported_api_formats": "supportedApiFormats",
|
|
67
|
+
"tool_description": "toolDescription",
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
export function serverToolDetailsFromJSON(jsonString) {
|
|
71
|
+
return safeParse(jsonString, (x) => ServerToolDetails$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ServerToolDetails' from JSON`);
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=servertooldetails.js.map
|