@openrouter/sdk 0.13.54 → 0.13.55
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/additionaltoolsitem.d.ts +5 -4
- package/esm/models/additionaltoolsitem.js +3 -0
- package/esm/models/index.d.ts +2 -0
- package/esm/models/index.js +2 -0
- package/esm/models/namespacefunctiontool.d.ts +52 -0
- package/esm/models/namespacefunctiontool.js +59 -0
- package/esm/models/namespacetool.d.ts +55 -0
- package/esm/models/namespacetool.js +60 -0
- package/esm/models/openresponsesresult.d.ts +5 -0
- package/esm/models/openresponsesresult.js +3 -0
- package/esm/models/responsesrequest.d.ts +9 -0
- package/esm/models/responsesrequest.js +3 -0
- package/jsr.json +1 -1
- package/package.json +4 -4
package/esm/lib/config.d.ts
CHANGED
|
@@ -49,8 +49,8 @@ export declare function serverURLFromOptions(options: SDKOptions): URL | null;
|
|
|
49
49
|
export declare const SDK_METADATA: {
|
|
50
50
|
readonly language: "typescript";
|
|
51
51
|
readonly openapiDocVersion: "1.0.0";
|
|
52
|
-
readonly sdkVersion: "0.13.
|
|
52
|
+
readonly sdkVersion: "0.13.55";
|
|
53
53
|
readonly genVersion: "2.884.4";
|
|
54
|
-
readonly userAgent: "speakeasy-sdk/typescript 0.13.
|
|
54
|
+
readonly userAgent: "speakeasy-sdk/typescript 0.13.55 2.884.4 1.0.0 @openrouter/sdk";
|
|
55
55
|
};
|
|
56
56
|
//# sourceMappingURL=config.d.ts.map
|
package/esm/lib/config.js
CHANGED
|
@@ -26,8 +26,8 @@ export function serverURLFromOptions(options) {
|
|
|
26
26
|
export const SDK_METADATA = {
|
|
27
27
|
language: "typescript",
|
|
28
28
|
openapiDocVersion: "1.0.0",
|
|
29
|
-
sdkVersion: "0.13.
|
|
29
|
+
sdkVersion: "0.13.55",
|
|
30
30
|
genVersion: "2.884.4",
|
|
31
|
-
userAgent: "speakeasy-sdk/typescript 0.13.
|
|
31
|
+
userAgent: "speakeasy-sdk/typescript 0.13.55 2.884.4 1.0.0 @openrouter/sdk",
|
|
32
32
|
};
|
|
33
33
|
//# sourceMappingURL=config.js.map
|
|
@@ -16,6 +16,7 @@ import { ImageGenerationServerTool, ImageGenerationServerTool$Outbound } from ".
|
|
|
16
16
|
import { ImageGenerationServerToolOpenRouter, ImageGenerationServerToolOpenRouter$Outbound } from "./imagegenerationservertoolopenrouter.js";
|
|
17
17
|
import { LegacyWebSearchServerTool, LegacyWebSearchServerTool$Outbound } from "./legacywebsearchservertool.js";
|
|
18
18
|
import { McpServerTool, McpServerTool$Outbound } from "./mcpservertool.js";
|
|
19
|
+
import { NamespaceTool, NamespaceTool$Outbound } from "./namespacetool.js";
|
|
19
20
|
import { Preview20250311WebSearchServerTool, Preview20250311WebSearchServerTool$Outbound } from "./preview20250311websearchservertool.js";
|
|
20
21
|
import { PreviewWebSearchServerTool, PreviewWebSearchServerTool$Outbound } from "./previewwebsearchservertool.js";
|
|
21
22
|
import { SearchModelsServerToolOpenRouter, SearchModelsServerToolOpenRouter$Outbound } from "./searchmodelsservertoolopenrouter.js";
|
|
@@ -58,7 +59,7 @@ export type AdditionalToolsItemToolFunction = {
|
|
|
58
59
|
strict?: boolean | null | undefined;
|
|
59
60
|
type: AdditionalToolsItemTypeFunction;
|
|
60
61
|
};
|
|
61
|
-
export type AdditionalToolsItemToolUnion = ComputerUseServerTool | AdditionalToolsItemToolFunction | FileSearchServerTool | CodeInterpreterServerTool | McpServerTool | CustomTool | PreviewWebSearchServerTool | Preview20250311WebSearchServerTool | LegacyWebSearchServerTool | WebSearchServerTool | ImageGenerationServerTool | CodexLocalShellTool | ShellServerTool | ApplyPatchServerTool | AdvisorServerToolOpenRouter | SubagentServerToolOpenRouter | DatetimeServerTool | FilesServerTool | FusionServerToolOpenRouter | ImageGenerationServerToolOpenRouter | SearchModelsServerToolOpenRouter | WebFetchServerTool | WebSearchServerToolOpenRouter | ApplyPatchServerToolOpenRouter | BashServerTool | ShellServerToolOpenRouter | AdditionalToolsItemTool;
|
|
62
|
+
export type AdditionalToolsItemToolUnion = ComputerUseServerTool | NamespaceTool | AdditionalToolsItemToolFunction | FileSearchServerTool | CodeInterpreterServerTool | McpServerTool | CustomTool | PreviewWebSearchServerTool | Preview20250311WebSearchServerTool | LegacyWebSearchServerTool | WebSearchServerTool | ImageGenerationServerTool | CodexLocalShellTool | ShellServerTool | ApplyPatchServerTool | AdvisorServerToolOpenRouter | SubagentServerToolOpenRouter | DatetimeServerTool | FilesServerTool | FusionServerToolOpenRouter | ImageGenerationServerToolOpenRouter | SearchModelsServerToolOpenRouter | WebFetchServerTool | WebSearchServerToolOpenRouter | ApplyPatchServerToolOpenRouter | BashServerTool | ShellServerToolOpenRouter | AdditionalToolsItemTool;
|
|
62
63
|
export declare const TypeAdditionalTools: {
|
|
63
64
|
readonly AdditionalTools: "additional_tools";
|
|
64
65
|
};
|
|
@@ -69,7 +70,7 @@ export type TypeAdditionalTools = ClosedEnum<typeof TypeAdditionalTools>;
|
|
|
69
70
|
export type AdditionalToolsItem = {
|
|
70
71
|
id?: string | null | undefined;
|
|
71
72
|
role: AdditionalToolsItemRole;
|
|
72
|
-
tools: Array<ComputerUseServerTool | AdditionalToolsItemToolFunction | FileSearchServerTool | CodeInterpreterServerTool | McpServerTool | CustomTool | PreviewWebSearchServerTool | Preview20250311WebSearchServerTool | LegacyWebSearchServerTool | WebSearchServerTool | ImageGenerationServerTool | CodexLocalShellTool | ShellServerTool | ApplyPatchServerTool | AdvisorServerToolOpenRouter | SubagentServerToolOpenRouter | DatetimeServerTool | FilesServerTool | FusionServerToolOpenRouter | ImageGenerationServerToolOpenRouter | SearchModelsServerToolOpenRouter | WebFetchServerTool | WebSearchServerToolOpenRouter | ApplyPatchServerToolOpenRouter | BashServerTool | ShellServerToolOpenRouter | AdditionalToolsItemTool>;
|
|
73
|
+
tools: Array<ComputerUseServerTool | NamespaceTool | AdditionalToolsItemToolFunction | FileSearchServerTool | CodeInterpreterServerTool | McpServerTool | CustomTool | PreviewWebSearchServerTool | Preview20250311WebSearchServerTool | LegacyWebSearchServerTool | WebSearchServerTool | ImageGenerationServerTool | CodexLocalShellTool | ShellServerTool | ApplyPatchServerTool | AdvisorServerToolOpenRouter | SubagentServerToolOpenRouter | DatetimeServerTool | FilesServerTool | FusionServerToolOpenRouter | ImageGenerationServerToolOpenRouter | SearchModelsServerToolOpenRouter | WebFetchServerTool | WebSearchServerToolOpenRouter | ApplyPatchServerToolOpenRouter | BashServerTool | ShellServerToolOpenRouter | AdditionalToolsItemTool>;
|
|
73
74
|
type: TypeAdditionalTools;
|
|
74
75
|
};
|
|
75
76
|
/** @internal */
|
|
@@ -98,7 +99,7 @@ export type AdditionalToolsItemToolFunction$Outbound = {
|
|
|
98
99
|
export declare const AdditionalToolsItemToolFunction$outboundSchema: z.ZodType<AdditionalToolsItemToolFunction$Outbound, AdditionalToolsItemToolFunction>;
|
|
99
100
|
export declare function additionalToolsItemToolFunctionToJSON(additionalToolsItemToolFunction: AdditionalToolsItemToolFunction): string;
|
|
100
101
|
/** @internal */
|
|
101
|
-
export type AdditionalToolsItemToolUnion$Outbound = ComputerUseServerTool$Outbound | AdditionalToolsItemToolFunction$Outbound | FileSearchServerTool$Outbound | CodeInterpreterServerTool$Outbound | McpServerTool$Outbound | CustomTool$Outbound | PreviewWebSearchServerTool$Outbound | Preview20250311WebSearchServerTool$Outbound | LegacyWebSearchServerTool$Outbound | WebSearchServerTool$Outbound | ImageGenerationServerTool$Outbound | CodexLocalShellTool$Outbound | ShellServerTool$Outbound | ApplyPatchServerTool$Outbound | AdvisorServerToolOpenRouter$Outbound | SubagentServerToolOpenRouter$Outbound | DatetimeServerTool$Outbound | FilesServerTool$Outbound | FusionServerToolOpenRouter$Outbound | ImageGenerationServerToolOpenRouter$Outbound | SearchModelsServerToolOpenRouter$Outbound | WebFetchServerTool$Outbound | WebSearchServerToolOpenRouter$Outbound | ApplyPatchServerToolOpenRouter$Outbound | BashServerTool$Outbound | ShellServerToolOpenRouter$Outbound | AdditionalToolsItemTool$Outbound;
|
|
102
|
+
export type AdditionalToolsItemToolUnion$Outbound = ComputerUseServerTool$Outbound | NamespaceTool$Outbound | AdditionalToolsItemToolFunction$Outbound | FileSearchServerTool$Outbound | CodeInterpreterServerTool$Outbound | McpServerTool$Outbound | CustomTool$Outbound | PreviewWebSearchServerTool$Outbound | Preview20250311WebSearchServerTool$Outbound | LegacyWebSearchServerTool$Outbound | WebSearchServerTool$Outbound | ImageGenerationServerTool$Outbound | CodexLocalShellTool$Outbound | ShellServerTool$Outbound | ApplyPatchServerTool$Outbound | AdvisorServerToolOpenRouter$Outbound | SubagentServerToolOpenRouter$Outbound | DatetimeServerTool$Outbound | FilesServerTool$Outbound | FusionServerToolOpenRouter$Outbound | ImageGenerationServerToolOpenRouter$Outbound | SearchModelsServerToolOpenRouter$Outbound | WebFetchServerTool$Outbound | WebSearchServerToolOpenRouter$Outbound | ApplyPatchServerToolOpenRouter$Outbound | BashServerTool$Outbound | ShellServerToolOpenRouter$Outbound | AdditionalToolsItemTool$Outbound;
|
|
102
103
|
/** @internal */
|
|
103
104
|
export declare const AdditionalToolsItemToolUnion$outboundSchema: z.ZodType<AdditionalToolsItemToolUnion$Outbound, AdditionalToolsItemToolUnion>;
|
|
104
105
|
export declare function additionalToolsItemToolUnionToJSON(additionalToolsItemToolUnion: AdditionalToolsItemToolUnion): string;
|
|
@@ -108,7 +109,7 @@ export declare const TypeAdditionalTools$outboundSchema: z.ZodEnum<typeof TypeAd
|
|
|
108
109
|
export type AdditionalToolsItem$Outbound = {
|
|
109
110
|
id?: string | null | undefined;
|
|
110
111
|
role: string;
|
|
111
|
-
tools: Array<ComputerUseServerTool$Outbound | AdditionalToolsItemToolFunction$Outbound | FileSearchServerTool$Outbound | CodeInterpreterServerTool$Outbound | McpServerTool$Outbound | CustomTool$Outbound | PreviewWebSearchServerTool$Outbound | Preview20250311WebSearchServerTool$Outbound | LegacyWebSearchServerTool$Outbound | WebSearchServerTool$Outbound | ImageGenerationServerTool$Outbound | CodexLocalShellTool$Outbound | ShellServerTool$Outbound | ApplyPatchServerTool$Outbound | AdvisorServerToolOpenRouter$Outbound | SubagentServerToolOpenRouter$Outbound | DatetimeServerTool$Outbound | FilesServerTool$Outbound | FusionServerToolOpenRouter$Outbound | ImageGenerationServerToolOpenRouter$Outbound | SearchModelsServerToolOpenRouter$Outbound | WebFetchServerTool$Outbound | WebSearchServerToolOpenRouter$Outbound | ApplyPatchServerToolOpenRouter$Outbound | BashServerTool$Outbound | ShellServerToolOpenRouter$Outbound | AdditionalToolsItemTool$Outbound>;
|
|
112
|
+
tools: Array<ComputerUseServerTool$Outbound | NamespaceTool$Outbound | AdditionalToolsItemToolFunction$Outbound | FileSearchServerTool$Outbound | CodeInterpreterServerTool$Outbound | McpServerTool$Outbound | CustomTool$Outbound | PreviewWebSearchServerTool$Outbound | Preview20250311WebSearchServerTool$Outbound | LegacyWebSearchServerTool$Outbound | WebSearchServerTool$Outbound | ImageGenerationServerTool$Outbound | CodexLocalShellTool$Outbound | ShellServerTool$Outbound | ApplyPatchServerTool$Outbound | AdvisorServerToolOpenRouter$Outbound | SubagentServerToolOpenRouter$Outbound | DatetimeServerTool$Outbound | FilesServerTool$Outbound | FusionServerToolOpenRouter$Outbound | ImageGenerationServerToolOpenRouter$Outbound | SearchModelsServerToolOpenRouter$Outbound | WebFetchServerTool$Outbound | WebSearchServerToolOpenRouter$Outbound | ApplyPatchServerToolOpenRouter$Outbound | BashServerTool$Outbound | ShellServerToolOpenRouter$Outbound | AdditionalToolsItemTool$Outbound>;
|
|
112
113
|
type: string;
|
|
113
114
|
};
|
|
114
115
|
/** @internal */
|
|
@@ -21,6 +21,7 @@ import { ImageGenerationServerTool$outboundSchema, } from "./imagegenerationserv
|
|
|
21
21
|
import { ImageGenerationServerToolOpenRouter$outboundSchema, } from "./imagegenerationservertoolopenrouter.js";
|
|
22
22
|
import { LegacyWebSearchServerTool$outboundSchema, } from "./legacywebsearchservertool.js";
|
|
23
23
|
import { McpServerTool$outboundSchema, } from "./mcpservertool.js";
|
|
24
|
+
import { NamespaceTool$outboundSchema, } from "./namespacetool.js";
|
|
24
25
|
import { Preview20250311WebSearchServerTool$outboundSchema, } from "./preview20250311websearchservertool.js";
|
|
25
26
|
import { PreviewWebSearchServerTool$outboundSchema, } from "./previewwebsearchservertool.js";
|
|
26
27
|
import { SearchModelsServerToolOpenRouter$outboundSchema, } from "./searchmodelsservertoolopenrouter.js";
|
|
@@ -79,6 +80,7 @@ export function additionalToolsItemToolFunctionToJSON(additionalToolsItemToolFun
|
|
|
79
80
|
/** @internal */
|
|
80
81
|
export const AdditionalToolsItemToolUnion$outboundSchema = z.union([
|
|
81
82
|
ComputerUseServerTool$outboundSchema,
|
|
83
|
+
NamespaceTool$outboundSchema,
|
|
82
84
|
z.lazy(() => AdditionalToolsItemToolFunction$outboundSchema),
|
|
83
85
|
FileSearchServerTool$outboundSchema,
|
|
84
86
|
CodeInterpreterServerTool$outboundSchema,
|
|
@@ -117,6 +119,7 @@ export const AdditionalToolsItem$outboundSchema = z.object({
|
|
|
117
119
|
role: AdditionalToolsItemRole$outboundSchema,
|
|
118
120
|
tools: z.array(z.union([
|
|
119
121
|
ComputerUseServerTool$outboundSchema,
|
|
122
|
+
NamespaceTool$outboundSchema,
|
|
120
123
|
z.lazy(() => AdditionalToolsItemToolFunction$outboundSchema),
|
|
121
124
|
FileSearchServerTool$outboundSchema,
|
|
122
125
|
CodeInterpreterServerTool$outboundSchema,
|
package/esm/models/index.d.ts
CHANGED
|
@@ -310,6 +310,8 @@ export * from "./modelscountresponse.js";
|
|
|
310
310
|
export * from "./modelslistresponse.js";
|
|
311
311
|
export * from "./moderationplugin.js";
|
|
312
312
|
export * from "./multimodalmedia.js";
|
|
313
|
+
export * from "./namespacefunctiontool.js";
|
|
314
|
+
export * from "./namespacetool.js";
|
|
313
315
|
export * from "./notfoundresponseerrordata.js";
|
|
314
316
|
export * from "./observabilityarizedestination.js";
|
|
315
317
|
export * from "./observabilitybraintrustdestination.js";
|
package/esm/models/index.js
CHANGED
|
@@ -314,6 +314,8 @@ export * from "./modelscountresponse.js";
|
|
|
314
314
|
export * from "./modelslistresponse.js";
|
|
315
315
|
export * from "./moderationplugin.js";
|
|
316
316
|
export * from "./multimodalmedia.js";
|
|
317
|
+
export * from "./namespacefunctiontool.js";
|
|
318
|
+
export * from "./namespacetool.js";
|
|
317
319
|
export * from "./notfoundresponseerrordata.js";
|
|
318
320
|
export * from "./observabilityarizedestination.js";
|
|
319
321
|
export * from "./observabilitybraintrustdestination.js";
|
|
@@ -0,0 +1,52 @@
|
|
|
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
|
+
export declare const AllowedCaller: {
|
|
6
|
+
readonly Direct: "direct";
|
|
7
|
+
readonly Programmatic: "programmatic";
|
|
8
|
+
};
|
|
9
|
+
export type AllowedCaller = OpenEnum<typeof AllowedCaller>;
|
|
10
|
+
/**
|
|
11
|
+
* A function tool grouped inside a namespace tool
|
|
12
|
+
*/
|
|
13
|
+
export type NamespaceFunctionTool = {
|
|
14
|
+
allowedCallers?: Array<AllowedCaller> | null | undefined;
|
|
15
|
+
deferLoading?: boolean | undefined;
|
|
16
|
+
description?: string | null | undefined;
|
|
17
|
+
name: string;
|
|
18
|
+
outputSchema?: {
|
|
19
|
+
[k: string]: any | null;
|
|
20
|
+
} | null | undefined;
|
|
21
|
+
parameters?: {
|
|
22
|
+
[k: string]: any | null;
|
|
23
|
+
} | null | undefined;
|
|
24
|
+
strict?: boolean | null | undefined;
|
|
25
|
+
type: "function";
|
|
26
|
+
};
|
|
27
|
+
/** @internal */
|
|
28
|
+
export declare const AllowedCaller$inboundSchema: z.ZodType<AllowedCaller, unknown>;
|
|
29
|
+
/** @internal */
|
|
30
|
+
export declare const AllowedCaller$outboundSchema: z.ZodType<string, AllowedCaller>;
|
|
31
|
+
/** @internal */
|
|
32
|
+
export declare const NamespaceFunctionTool$inboundSchema: z.ZodType<NamespaceFunctionTool, unknown>;
|
|
33
|
+
/** @internal */
|
|
34
|
+
export type NamespaceFunctionTool$Outbound = {
|
|
35
|
+
allowed_callers?: Array<string> | null | undefined;
|
|
36
|
+
defer_loading?: boolean | undefined;
|
|
37
|
+
description?: string | null | undefined;
|
|
38
|
+
name: string;
|
|
39
|
+
output_schema?: {
|
|
40
|
+
[k: string]: any | null;
|
|
41
|
+
} | null | undefined;
|
|
42
|
+
parameters?: {
|
|
43
|
+
[k: string]: any | null;
|
|
44
|
+
} | null | undefined;
|
|
45
|
+
strict?: boolean | null | undefined;
|
|
46
|
+
type: "function";
|
|
47
|
+
};
|
|
48
|
+
/** @internal */
|
|
49
|
+
export declare const NamespaceFunctionTool$outboundSchema: z.ZodType<NamespaceFunctionTool$Outbound, NamespaceFunctionTool>;
|
|
50
|
+
export declare function namespaceFunctionToolToJSON(namespaceFunctionTool: NamespaceFunctionTool): string;
|
|
51
|
+
export declare function namespaceFunctionToolFromJSON(jsonString: string): SafeParseResult<NamespaceFunctionTool, SDKValidationError>;
|
|
52
|
+
//# sourceMappingURL=namespacefunctiontool.d.ts.map
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: ca0cabda8e0a
|
|
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
|
+
export const AllowedCaller = {
|
|
10
|
+
Direct: "direct",
|
|
11
|
+
Programmatic: "programmatic",
|
|
12
|
+
};
|
|
13
|
+
/** @internal */
|
|
14
|
+
export const AllowedCaller$inboundSchema = openEnums.inboundSchema(AllowedCaller);
|
|
15
|
+
/** @internal */
|
|
16
|
+
export const AllowedCaller$outboundSchema = openEnums.outboundSchema(AllowedCaller);
|
|
17
|
+
/** @internal */
|
|
18
|
+
export const NamespaceFunctionTool$inboundSchema = z.object({
|
|
19
|
+
allowed_callers: z.nullable(z.array(AllowedCaller$inboundSchema)).optional(),
|
|
20
|
+
defer_loading: z.boolean().optional(),
|
|
21
|
+
description: z.nullable(z.string()).optional(),
|
|
22
|
+
name: z.string(),
|
|
23
|
+
output_schema: z.nullable(z.record(z.string(), z.nullable(z.any())))
|
|
24
|
+
.optional(),
|
|
25
|
+
parameters: z.nullable(z.record(z.string(), z.nullable(z.any()))).optional(),
|
|
26
|
+
strict: z.nullable(z.boolean()).optional(),
|
|
27
|
+
type: z.literal("function"),
|
|
28
|
+
}).transform((v) => {
|
|
29
|
+
return remap$(v, {
|
|
30
|
+
"allowed_callers": "allowedCallers",
|
|
31
|
+
"defer_loading": "deferLoading",
|
|
32
|
+
"output_schema": "outputSchema",
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
/** @internal */
|
|
36
|
+
export const NamespaceFunctionTool$outboundSchema = z.object({
|
|
37
|
+
allowedCallers: z.nullable(z.array(AllowedCaller$outboundSchema)).optional(),
|
|
38
|
+
deferLoading: z.boolean().optional(),
|
|
39
|
+
description: z.nullable(z.string()).optional(),
|
|
40
|
+
name: z.string(),
|
|
41
|
+
outputSchema: z.nullable(z.record(z.string(), z.nullable(z.any())))
|
|
42
|
+
.optional(),
|
|
43
|
+
parameters: z.nullable(z.record(z.string(), z.nullable(z.any()))).optional(),
|
|
44
|
+
strict: z.nullable(z.boolean()).optional(),
|
|
45
|
+
type: z.literal("function"),
|
|
46
|
+
}).transform((v) => {
|
|
47
|
+
return remap$(v, {
|
|
48
|
+
allowedCallers: "allowed_callers",
|
|
49
|
+
deferLoading: "defer_loading",
|
|
50
|
+
outputSchema: "output_schema",
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
export function namespaceFunctionToolToJSON(namespaceFunctionTool) {
|
|
54
|
+
return JSON.stringify(NamespaceFunctionTool$outboundSchema.parse(namespaceFunctionTool));
|
|
55
|
+
}
|
|
56
|
+
export function namespaceFunctionToolFromJSON(jsonString) {
|
|
57
|
+
return safeParse(jsonString, (x) => NamespaceFunctionTool$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'NamespaceFunctionTool' from JSON`);
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=namespacefunctiontool.js.map
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import * as discriminatedUnionTypes from "../types/discriminatedUnion.js";
|
|
3
|
+
import { ClosedEnum } from "../types/enums.js";
|
|
4
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
5
|
+
import { CustomTool, CustomTool$Outbound } from "./customtool.js";
|
|
6
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
7
|
+
import { NamespaceFunctionTool, NamespaceFunctionTool$Outbound } from "./namespacefunctiontool.js";
|
|
8
|
+
export type NamespaceToolTool = NamespaceFunctionTool | (CustomTool & {
|
|
9
|
+
type: "custom";
|
|
10
|
+
}) | discriminatedUnionTypes.Unknown<"type">;
|
|
11
|
+
export declare const NamespaceToolType: {
|
|
12
|
+
readonly Namespace: "namespace";
|
|
13
|
+
};
|
|
14
|
+
export type NamespaceToolType = ClosedEnum<typeof NamespaceToolType>;
|
|
15
|
+
/**
|
|
16
|
+
* Groups function/custom tools under a shared namespace
|
|
17
|
+
*/
|
|
18
|
+
export type NamespaceTool = {
|
|
19
|
+
description: string;
|
|
20
|
+
name: string;
|
|
21
|
+
tools: Array<NamespaceFunctionTool | (CustomTool & {
|
|
22
|
+
type: "custom";
|
|
23
|
+
}) | discriminatedUnionTypes.Unknown<"type">>;
|
|
24
|
+
type: NamespaceToolType;
|
|
25
|
+
};
|
|
26
|
+
/** @internal */
|
|
27
|
+
export declare const NamespaceToolTool$inboundSchema: z.ZodType<NamespaceToolTool, unknown>;
|
|
28
|
+
/** @internal */
|
|
29
|
+
export type NamespaceToolTool$Outbound = NamespaceFunctionTool$Outbound | (CustomTool$Outbound & {
|
|
30
|
+
type: "custom";
|
|
31
|
+
});
|
|
32
|
+
/** @internal */
|
|
33
|
+
export declare const NamespaceToolTool$outboundSchema: z.ZodType<NamespaceToolTool$Outbound, NamespaceToolTool>;
|
|
34
|
+
export declare function namespaceToolToolToJSON(namespaceToolTool: NamespaceToolTool): string;
|
|
35
|
+
export declare function namespaceToolToolFromJSON(jsonString: string): SafeParseResult<NamespaceToolTool, SDKValidationError>;
|
|
36
|
+
/** @internal */
|
|
37
|
+
export declare const NamespaceToolType$inboundSchema: z.ZodEnum<typeof NamespaceToolType>;
|
|
38
|
+
/** @internal */
|
|
39
|
+
export declare const NamespaceToolType$outboundSchema: z.ZodEnum<typeof NamespaceToolType>;
|
|
40
|
+
/** @internal */
|
|
41
|
+
export declare const NamespaceTool$inboundSchema: z.ZodType<NamespaceTool, unknown>;
|
|
42
|
+
/** @internal */
|
|
43
|
+
export type NamespaceTool$Outbound = {
|
|
44
|
+
description: string;
|
|
45
|
+
name: string;
|
|
46
|
+
tools: Array<NamespaceFunctionTool$Outbound | (CustomTool$Outbound & {
|
|
47
|
+
type: "custom";
|
|
48
|
+
})>;
|
|
49
|
+
type: string;
|
|
50
|
+
};
|
|
51
|
+
/** @internal */
|
|
52
|
+
export declare const NamespaceTool$outboundSchema: z.ZodType<NamespaceTool$Outbound, NamespaceTool>;
|
|
53
|
+
export declare function namespaceToolToJSON(namespaceTool: NamespaceTool): string;
|
|
54
|
+
export declare function namespaceToolFromJSON(jsonString: string): SafeParseResult<NamespaceTool, SDKValidationError>;
|
|
55
|
+
//# sourceMappingURL=namespacetool.d.ts.map
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: b430de21d6c4
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { safeParse } from "../lib/schemas.js";
|
|
7
|
+
import { discriminatedUnion } from "../types/discriminatedUnion.js";
|
|
8
|
+
import { CustomTool$inboundSchema, CustomTool$outboundSchema, } from "./customtool.js";
|
|
9
|
+
import { NamespaceFunctionTool$inboundSchema, NamespaceFunctionTool$outboundSchema, } from "./namespacefunctiontool.js";
|
|
10
|
+
export const NamespaceToolType = {
|
|
11
|
+
Namespace: "namespace",
|
|
12
|
+
};
|
|
13
|
+
/** @internal */
|
|
14
|
+
export const NamespaceToolTool$inboundSchema = discriminatedUnion("type", {
|
|
15
|
+
function: NamespaceFunctionTool$inboundSchema,
|
|
16
|
+
custom: CustomTool$inboundSchema.and(z.object({ type: z.literal("custom") })),
|
|
17
|
+
});
|
|
18
|
+
/** @internal */
|
|
19
|
+
export const NamespaceToolTool$outboundSchema = z.union([
|
|
20
|
+
NamespaceFunctionTool$outboundSchema,
|
|
21
|
+
CustomTool$outboundSchema.and(z.object({ type: z.literal("custom") })),
|
|
22
|
+
]);
|
|
23
|
+
export function namespaceToolToolToJSON(namespaceToolTool) {
|
|
24
|
+
return JSON.stringify(NamespaceToolTool$outboundSchema.parse(namespaceToolTool));
|
|
25
|
+
}
|
|
26
|
+
export function namespaceToolToolFromJSON(jsonString) {
|
|
27
|
+
return safeParse(jsonString, (x) => NamespaceToolTool$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'NamespaceToolTool' from JSON`);
|
|
28
|
+
}
|
|
29
|
+
/** @internal */
|
|
30
|
+
export const NamespaceToolType$inboundSchema = z.enum(NamespaceToolType);
|
|
31
|
+
/** @internal */
|
|
32
|
+
export const NamespaceToolType$outboundSchema = NamespaceToolType$inboundSchema;
|
|
33
|
+
/** @internal */
|
|
34
|
+
export const NamespaceTool$inboundSchema = z
|
|
35
|
+
.object({
|
|
36
|
+
description: z.string(),
|
|
37
|
+
name: z.string(),
|
|
38
|
+
tools: z.array(discriminatedUnion("type", {
|
|
39
|
+
function: NamespaceFunctionTool$inboundSchema,
|
|
40
|
+
custom: CustomTool$inboundSchema.and(z.object({ type: z.literal("custom") })),
|
|
41
|
+
})),
|
|
42
|
+
type: NamespaceToolType$inboundSchema,
|
|
43
|
+
});
|
|
44
|
+
/** @internal */
|
|
45
|
+
export const NamespaceTool$outboundSchema = z.object({
|
|
46
|
+
description: z.string(),
|
|
47
|
+
name: z.string(),
|
|
48
|
+
tools: z.array(z.union([
|
|
49
|
+
NamespaceFunctionTool$outboundSchema,
|
|
50
|
+
CustomTool$outboundSchema.and(z.object({ type: z.literal("custom") })),
|
|
51
|
+
])),
|
|
52
|
+
type: NamespaceToolType$outboundSchema,
|
|
53
|
+
});
|
|
54
|
+
export function namespaceToolToJSON(namespaceTool) {
|
|
55
|
+
return JSON.stringify(NamespaceTool$outboundSchema.parse(namespaceTool));
|
|
56
|
+
}
|
|
57
|
+
export function namespaceToolFromJSON(jsonString) {
|
|
58
|
+
return safeParse(jsonString, (x) => NamespaceTool$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'NamespaceTool' from JSON`);
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=namespacetool.js.map
|
|
@@ -16,6 +16,7 @@ import { ImageGenerationServerTool } from "./imagegenerationservertool.js";
|
|
|
16
16
|
import { IncompleteDetails } from "./incompletedetails.js";
|
|
17
17
|
import { LegacyWebSearchServerTool } from "./legacywebsearchservertool.js";
|
|
18
18
|
import { McpServerTool } from "./mcpservertool.js";
|
|
19
|
+
import { NamespaceTool } from "./namespacetool.js";
|
|
19
20
|
import { OpenAIResponsesResponseStatus } from "./openairesponsesresponsestatus.js";
|
|
20
21
|
import { OpenAIResponsesToolChoiceUnion } from "./openairesponsestoolchoiceunion.js";
|
|
21
22
|
import { OpenRouterMetadata } from "./openroutermetadata.js";
|
|
@@ -71,6 +72,8 @@ export type OpenResponsesResultToolUnion = OpenResponsesResultToolFunction | (Pr
|
|
|
71
72
|
type: "apply_patch";
|
|
72
73
|
}) | (CustomTool & {
|
|
73
74
|
type: "custom";
|
|
75
|
+
}) | (NamespaceTool & {
|
|
76
|
+
type: "namespace";
|
|
74
77
|
}) | discriminatedUnionTypes.Unknown<"type">;
|
|
75
78
|
/**
|
|
76
79
|
* Complete non-streaming response from the Responses API
|
|
@@ -141,6 +144,8 @@ export type OpenResponsesResult = {
|
|
|
141
144
|
type: "apply_patch";
|
|
142
145
|
}) | (CustomTool & {
|
|
143
146
|
type: "custom";
|
|
147
|
+
}) | (NamespaceTool & {
|
|
148
|
+
type: "namespace";
|
|
144
149
|
}) | discriminatedUnionTypes.Unknown<"type">>;
|
|
145
150
|
topLogprobs?: number | null | undefined;
|
|
146
151
|
topP: number | null;
|
|
@@ -19,6 +19,7 @@ import { ImageGenerationServerTool$inboundSchema, } from "./imagegenerationserve
|
|
|
19
19
|
import { IncompleteDetails$inboundSchema, } from "./incompletedetails.js";
|
|
20
20
|
import { LegacyWebSearchServerTool$inboundSchema, } from "./legacywebsearchservertool.js";
|
|
21
21
|
import { McpServerTool$inboundSchema } from "./mcpservertool.js";
|
|
22
|
+
import { NamespaceTool$inboundSchema } from "./namespacetool.js";
|
|
22
23
|
import { OpenAIResponsesResponseStatus$inboundSchema, } from "./openairesponsesresponsestatus.js";
|
|
23
24
|
import { OpenAIResponsesToolChoiceUnion$inboundSchema, } from "./openairesponsestoolchoiceunion.js";
|
|
24
25
|
import { OpenRouterMetadata$inboundSchema, } from "./openroutermetadata.js";
|
|
@@ -64,6 +65,7 @@ export const OpenResponsesResultToolUnion$inboundSchema = discriminatedUnion("ty
|
|
|
64
65
|
shell: ShellServerTool$inboundSchema.and(z.object({ type: z.literal("shell") })),
|
|
65
66
|
apply_patch: ApplyPatchServerTool$inboundSchema.and(z.object({ type: z.literal("apply_patch") })),
|
|
66
67
|
custom: CustomTool$inboundSchema.and(z.object({ type: z.literal("custom") })),
|
|
68
|
+
namespace: NamespaceTool$inboundSchema.and(z.object({ type: z.literal("namespace") })),
|
|
67
69
|
});
|
|
68
70
|
export function openResponsesResultToolUnionFromJSON(jsonString) {
|
|
69
71
|
return safeParse(jsonString, (x) => OpenResponsesResultToolUnion$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'OpenResponsesResultToolUnion' from JSON`);
|
|
@@ -113,6 +115,7 @@ export const OpenResponsesResult$inboundSchema = z.object({
|
|
|
113
115
|
shell: ShellServerTool$inboundSchema.and(z.object({ type: z.literal("shell") })),
|
|
114
116
|
apply_patch: ApplyPatchServerTool$inboundSchema.and(z.object({ type: z.literal("apply_patch") })),
|
|
115
117
|
custom: CustomTool$inboundSchema.and(z.object({ type: z.literal("custom") })),
|
|
118
|
+
namespace: NamespaceTool$inboundSchema.and(z.object({ type: z.literal("namespace") })),
|
|
116
119
|
})),
|
|
117
120
|
top_logprobs: z.nullable(z.int()).optional(),
|
|
118
121
|
top_p: z.nullable(z.number()),
|
|
@@ -25,6 +25,7 @@ import { InputsUnion, InputsUnion$Outbound } from "./inputsunion.js";
|
|
|
25
25
|
import { LegacyWebSearchServerTool, LegacyWebSearchServerTool$Outbound } from "./legacywebsearchservertool.js";
|
|
26
26
|
import { McpServerTool, McpServerTool$Outbound } from "./mcpservertool.js";
|
|
27
27
|
import { ModerationPlugin, ModerationPlugin$Outbound } from "./moderationplugin.js";
|
|
28
|
+
import { NamespaceTool, NamespaceTool$Outbound } from "./namespacetool.js";
|
|
28
29
|
import { OpenAIResponsesToolChoiceUnion, OpenAIResponsesToolChoiceUnion$Outbound } from "./openairesponsestoolchoiceunion.js";
|
|
29
30
|
import { OpenAIResponsesTruncation } from "./openairesponsestruncation.js";
|
|
30
31
|
import { OutputModalityEnum } from "./outputmodalityenum.js";
|
|
@@ -96,6 +97,8 @@ export type ResponsesRequestToolUnion = ResponsesRequestToolFunction | (PreviewW
|
|
|
96
97
|
type: "apply_patch";
|
|
97
98
|
}) | (CustomTool & {
|
|
98
99
|
type: "custom";
|
|
100
|
+
}) | (NamespaceTool & {
|
|
101
|
+
type: "namespace";
|
|
99
102
|
}) | (AdvisorServerToolOpenRouter & {
|
|
100
103
|
type: "openrouter:advisor";
|
|
101
104
|
}) | (SubagentServerToolOpenRouter & {
|
|
@@ -226,6 +229,8 @@ export type ResponsesRequest = {
|
|
|
226
229
|
type: "apply_patch";
|
|
227
230
|
}) | (CustomTool & {
|
|
228
231
|
type: "custom";
|
|
232
|
+
}) | (NamespaceTool & {
|
|
233
|
+
type: "namespace";
|
|
229
234
|
}) | (AdvisorServerToolOpenRouter & {
|
|
230
235
|
type: "openrouter:advisor";
|
|
231
236
|
}) | (SubagentServerToolOpenRouter & {
|
|
@@ -311,6 +316,8 @@ export type ResponsesRequestToolUnion$Outbound = ResponsesRequestToolFunction$Ou
|
|
|
311
316
|
type: "apply_patch";
|
|
312
317
|
}) | (CustomTool$Outbound & {
|
|
313
318
|
type: "custom";
|
|
319
|
+
}) | (NamespaceTool$Outbound & {
|
|
320
|
+
type: "namespace";
|
|
314
321
|
}) | (AdvisorServerToolOpenRouter$Outbound & {
|
|
315
322
|
type: "openrouter:advisor";
|
|
316
323
|
}) | (SubagentServerToolOpenRouter$Outbound & {
|
|
@@ -403,6 +410,8 @@ export type ResponsesRequest$Outbound = {
|
|
|
403
410
|
type: "apply_patch";
|
|
404
411
|
}) | (CustomTool$Outbound & {
|
|
405
412
|
type: "custom";
|
|
413
|
+
}) | (NamespaceTool$Outbound & {
|
|
414
|
+
type: "namespace";
|
|
406
415
|
}) | (AdvisorServerToolOpenRouter$Outbound & {
|
|
407
416
|
type: "openrouter:advisor";
|
|
408
417
|
}) | (SubagentServerToolOpenRouter$Outbound & {
|
|
@@ -30,6 +30,7 @@ import { InputsUnion$outboundSchema, } from "./inputsunion.js";
|
|
|
30
30
|
import { LegacyWebSearchServerTool$outboundSchema, } from "./legacywebsearchservertool.js";
|
|
31
31
|
import { McpServerTool$outboundSchema, } from "./mcpservertool.js";
|
|
32
32
|
import { ModerationPlugin$outboundSchema, } from "./moderationplugin.js";
|
|
33
|
+
import { NamespaceTool$outboundSchema, } from "./namespacetool.js";
|
|
33
34
|
import { OpenAIResponsesToolChoiceUnion$outboundSchema, } from "./openairesponsestoolchoiceunion.js";
|
|
34
35
|
import { OpenAIResponsesTruncation$outboundSchema, } from "./openairesponsestruncation.js";
|
|
35
36
|
import { OutputModalityEnum$outboundSchema, } from "./outputmodalityenum.js";
|
|
@@ -105,6 +106,7 @@ export const ResponsesRequestToolUnion$outboundSchema = z.union([
|
|
|
105
106
|
ShellServerTool$outboundSchema.and(z.object({ type: z.literal("shell") })),
|
|
106
107
|
ApplyPatchServerTool$outboundSchema.and(z.object({ type: z.literal("apply_patch") })),
|
|
107
108
|
CustomTool$outboundSchema.and(z.object({ type: z.literal("custom") })),
|
|
109
|
+
NamespaceTool$outboundSchema.and(z.object({ type: z.literal("namespace") })),
|
|
108
110
|
AdvisorServerToolOpenRouter$outboundSchema.and(z.object({ type: z.literal("openrouter:advisor") })),
|
|
109
111
|
SubagentServerToolOpenRouter$outboundSchema.and(z.object({ type: z.literal("openrouter:subagent") })),
|
|
110
112
|
DatetimeServerTool$outboundSchema.and(z.object({ type: z.literal("openrouter:datetime") })),
|
|
@@ -181,6 +183,7 @@ export const ResponsesRequest$outboundSchema = z.object({
|
|
|
181
183
|
ShellServerTool$outboundSchema.and(z.object({ type: z.literal("shell") })),
|
|
182
184
|
ApplyPatchServerTool$outboundSchema.and(z.object({ type: z.literal("apply_patch") })),
|
|
183
185
|
CustomTool$outboundSchema.and(z.object({ type: z.literal("custom") })),
|
|
186
|
+
NamespaceTool$outboundSchema.and(z.object({ type: z.literal("namespace") })),
|
|
184
187
|
AdvisorServerToolOpenRouter$outboundSchema.and(z.object({ type: z.literal("openrouter:advisor") })),
|
|
185
188
|
SubagentServerToolOpenRouter$outboundSchema.and(z.object({ type: z.literal("openrouter:subagent") })),
|
|
186
189
|
DatetimeServerTool$outboundSchema.and(z.object({ type: z.literal("openrouter:datetime") })),
|
package/jsr.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openrouter/sdk",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.55",
|
|
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": [
|
|
@@ -75,13 +75,13 @@
|
|
|
75
75
|
"prepublishOnly": "npm run build",
|
|
76
76
|
"compile": "tsc",
|
|
77
77
|
"postinstall": "node scripts/check-types.js || true",
|
|
78
|
-
"prepare": "npm run build",
|
|
79
78
|
"test": "vitest --run --project unit",
|
|
80
79
|
"test:e2e": "vitest --run --project e2e",
|
|
81
80
|
"test:transit": "exit 0",
|
|
82
|
-
"typecheck:transit": "exit 0",
|
|
83
81
|
"test:watch": "vitest --watch --project unit",
|
|
84
|
-
"typecheck": "tsc --noEmit"
|
|
82
|
+
"typecheck": "tsc --noEmit",
|
|
83
|
+
"prepare": "npm run build",
|
|
84
|
+
"typecheck:transit": "exit 0"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {},
|
|
87
87
|
"devDependencies": {
|