@openrouter/sdk 0.13.37 → 0.13.39

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.
Files changed (70) hide show
  1. package/esm/funcs/generationsSubmitFeedback.d.ts +19 -0
  2. package/esm/funcs/generationsSubmitFeedback.js +100 -0
  3. package/esm/lib/config.d.ts +2 -2
  4. package/esm/lib/config.js +2 -2
  5. package/esm/lib/conversation-state.d.ts +1 -1
  6. package/esm/lib/turn-context.d.ts +1 -1
  7. package/esm/models/additionaltoolsitem.d.ts +117 -0
  8. package/esm/models/additionaltoolsitem.js +152 -0
  9. package/esm/models/applypatchservertool.d.ts +11 -2
  10. package/esm/models/applypatchservertool.js +9 -2
  11. package/esm/models/applypatchservertoolopenrouter.d.ts +9 -2
  12. package/esm/models/applypatchservertoolopenrouter.js +6 -1
  13. package/esm/models/byokproviderslug.d.ts +1 -1
  14. package/esm/models/byokproviderslug.js +1 -1
  15. package/esm/models/codeinterpreterservertool.d.ts +10 -2
  16. package/esm/models/codeinterpreterservertool.js +9 -2
  17. package/esm/models/codexlocalshelltool.d.ts +11 -2
  18. package/esm/models/codexlocalshelltool.js +9 -2
  19. package/esm/models/computeruseservertool.d.ts +11 -3
  20. package/esm/models/computeruseservertool.js +9 -2
  21. package/esm/models/customtool.d.ts +11 -3
  22. package/esm/models/customtool.js +9 -2
  23. package/esm/models/filesearchservertool.d.ts +11 -3
  24. package/esm/models/filesearchservertool.js +10 -2
  25. package/esm/models/imagegenerationrequest.d.ts +2 -2
  26. package/esm/models/imagegenerationrequest.js +1 -2
  27. package/esm/models/imagegenerationservertool.d.ts +11 -3
  28. package/esm/models/imagegenerationservertool.js +9 -2
  29. package/esm/models/index.d.ts +3 -0
  30. package/esm/models/index.js +3 -0
  31. package/esm/models/inputsunion.d.ts +5 -4
  32. package/esm/models/inputsunion.js +3 -0
  33. package/esm/models/legacywebsearchservertool.d.ts +11 -2
  34. package/esm/models/legacywebsearchservertool.js +9 -2
  35. package/esm/models/mcpservertool.d.ts +10 -2
  36. package/esm/models/mcpservertool.js +9 -2
  37. package/esm/models/openresponsesresult.d.ts +54 -2
  38. package/esm/models/openresponsesresult.js +26 -26
  39. package/esm/models/operations/index.d.ts +1 -0
  40. package/esm/models/operations/index.js +1 -0
  41. package/esm/models/operations/listbyokkeys.d.ts +1 -1
  42. package/esm/models/operations/listbyokkeys.js +1 -1
  43. package/esm/models/operations/submitgenerationfeedback.d.ts +56 -0
  44. package/esm/models/operations/submitgenerationfeedback.js +23 -0
  45. package/esm/models/preview20250311websearchservertool.d.ts +11 -2
  46. package/esm/models/preview20250311websearchservertool.js +9 -2
  47. package/esm/models/previewwebsearchservertool.d.ts +11 -2
  48. package/esm/models/previewwebsearchservertool.js +9 -2
  49. package/esm/models/provideroptions.d.ts +2 -2
  50. package/esm/models/provideroptions.js +1 -2
  51. package/esm/models/responsesrequest.d.ts +140 -12
  52. package/esm/models/responsesrequest.js +32 -32
  53. package/esm/models/shellservertool.d.ts +11 -2
  54. package/esm/models/shellservertool.js +9 -2
  55. package/esm/models/shellservertoolopenrouter.d.ts +9 -2
  56. package/esm/models/shellservertoolopenrouter.js +6 -1
  57. package/esm/models/submitgenerationfeedbackrequest.d.ts +47 -0
  58. package/esm/models/submitgenerationfeedbackrequest.js +36 -0
  59. package/esm/models/submitgenerationfeedbackresponse.d.ts +22 -0
  60. package/esm/models/submitgenerationfeedbackresponse.js +21 -0
  61. package/esm/models/videogenerationrequest.d.ts +2 -2
  62. package/esm/models/videogenerationrequest.js +1 -2
  63. package/esm/models/websearchservertool.d.ts +11 -2
  64. package/esm/models/websearchservertool.js +9 -2
  65. package/esm/models/websearchservertoolopenrouter.d.ts +9 -2
  66. package/esm/models/websearchservertoolopenrouter.js +6 -1
  67. package/esm/sdk/generations.d.ts +7 -0
  68. package/esm/sdk/generations.js +10 -0
  69. package/jsr.json +1 -1
  70. package/package.json +5 -5
@@ -0,0 +1,19 @@
1
+ import { OpenRouterCore } from "../core.js";
2
+ import { RequestOptions } from "../lib/sdks.js";
3
+ import { ConnectionError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, UnexpectedClientError } from "../models/errors/httpclienterrors.js";
4
+ import * as errors from "../models/errors/index.js";
5
+ import { OpenRouterError } from "../models/errors/openroutererror.js";
6
+ import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
7
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
8
+ import * as models from "../models/index.js";
9
+ import * as operations from "../models/operations/index.js";
10
+ import { APIPromise } from "../types/async.js";
11
+ import { Result } from "../types/fp.js";
12
+ /**
13
+ * Submit feedback for a generation
14
+ *
15
+ * @remarks
16
+ * Submit structured feedback on a generation the authenticated user made. [Management key](/docs/guides/overview/auth/management-api-keys) required.
17
+ */
18
+ export declare function generationsSubmitFeedback(client: OpenRouterCore, request: operations.SubmitGenerationFeedbackRequest, options?: RequestOptions): APIPromise<Result<models.SubmitGenerationFeedbackResponse, errors.BadRequestResponseError | errors.UnauthorizedResponseError | errors.NotFoundResponseError | errors.TooManyRequestsResponseError | errors.InternalServerResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
19
+ //# sourceMappingURL=generationsSubmitFeedback.d.ts.map
@@ -0,0 +1,100 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 7164852deaac
4
+ */
5
+ import { encodeJSON, encodeSimple } from "../lib/encodings.js";
6
+ import { matchStatusCode } from "../lib/http.js";
7
+ import * as M from "../lib/matchers.js";
8
+ import { compactMap } from "../lib/primitives.js";
9
+ import { safeParse } from "../lib/schemas.js";
10
+ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
11
+ import { pathToFunc } from "../lib/url.js";
12
+ import * as errors from "../models/errors/index.js";
13
+ import * as models from "../models/index.js";
14
+ import * as operations from "../models/operations/index.js";
15
+ import { APIPromise } from "../types/async.js";
16
+ /**
17
+ * Submit feedback for a generation
18
+ *
19
+ * @remarks
20
+ * Submit structured feedback on a generation the authenticated user made. [Management key](/docs/guides/overview/auth/management-api-keys) required.
21
+ */
22
+ export function generationsSubmitFeedback(client, request, options) {
23
+ return new APIPromise($do(client, request, options));
24
+ }
25
+ async function $do(client, request, options) {
26
+ const parsed = safeParse(request, (value) => operations.SubmitGenerationFeedbackRequest$outboundSchema.parse(value), "Input validation failed");
27
+ if (!parsed.ok) {
28
+ return [parsed, { status: "invalid" }];
29
+ }
30
+ const payload = parsed.value;
31
+ const body = encodeJSON("body", payload.SubmitGenerationFeedbackRequest, {
32
+ explode: true,
33
+ });
34
+ const path = pathToFunc("/generation/feedback")();
35
+ const headers = new Headers(compactMap({
36
+ "Content-Type": "application/json",
37
+ Accept: "application/json",
38
+ "HTTP-Referer": encodeSimple("HTTP-Referer", payload["HTTP-Referer"] ?? client._options.httpReferer, { explode: false, charEncoding: "none" }),
39
+ "X-OpenRouter-Categories": encodeSimple("X-OpenRouter-Categories", payload.appCategories ?? client._options.appCategories, { explode: false, charEncoding: "none" }),
40
+ "X-OpenRouter-Title": encodeSimple("X-OpenRouter-Title", payload.appTitle ?? client._options.appTitle, { explode: false, charEncoding: "none" }),
41
+ }));
42
+ const secConfig = await extractSecurity(client._options.apiKey);
43
+ const securityInput = secConfig == null ? {} : { apiKey: secConfig };
44
+ const requestSecurity = resolveGlobalSecurity(securityInput);
45
+ const context = {
46
+ options: client._options,
47
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
48
+ operationID: "submitGenerationFeedback",
49
+ oAuth2Scopes: null,
50
+ resolvedSecurity: requestSecurity,
51
+ securitySource: client._options.apiKey,
52
+ retryConfig: options?.retries
53
+ || client._options.retryConfig
54
+ || {
55
+ strategy: "backoff",
56
+ backoff: {
57
+ initialInterval: 500,
58
+ maxInterval: 60000,
59
+ exponent: 1.5,
60
+ maxElapsedTime: 3600000,
61
+ },
62
+ retryConnectionErrors: true,
63
+ }
64
+ || { strategy: "none" },
65
+ retryCodes: options?.retryCodes || ["5XX"],
66
+ };
67
+ const requestRes = client._createRequest(context, {
68
+ security: requestSecurity,
69
+ method: "POST",
70
+ baseURL: options?.serverURL,
71
+ path: path,
72
+ headers: headers,
73
+ body: body,
74
+ userAgent: client._options.userAgent,
75
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
76
+ }, options);
77
+ if (!requestRes.ok) {
78
+ return [requestRes, { status: "invalid" }];
79
+ }
80
+ const req = requestRes.value;
81
+ const doResult = await client._do(req, {
82
+ context,
83
+ isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
84
+ retryConfig: context.retryConfig,
85
+ retryCodes: context.retryCodes,
86
+ });
87
+ if (!doResult.ok) {
88
+ return [doResult, { status: "request-error", request: req }];
89
+ }
90
+ const response = doResult.value;
91
+ const responseFields = {
92
+ HttpMeta: { Response: response, Request: req },
93
+ };
94
+ const [result] = await M.match(M.json(200, models.SubmitGenerationFeedbackResponse$inboundSchema), M.jsonErr(400, errors.BadRequestResponseError$inboundSchema), M.jsonErr(401, errors.UnauthorizedResponseError$inboundSchema), M.jsonErr(404, errors.NotFoundResponseError$inboundSchema), M.jsonErr(429, errors.TooManyRequestsResponseError$inboundSchema), M.jsonErr(500, errors.InternalServerResponseError$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
95
+ if (!result.ok) {
96
+ return [result, { status: "complete", request: req, response }];
97
+ }
98
+ return [result, { status: "complete", request: req, response }];
99
+ }
100
+ //# sourceMappingURL=generationsSubmitFeedback.js.map
@@ -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.37";
52
+ readonly sdkVersion: "0.13.39";
53
53
  readonly genVersion: "2.884.4";
54
- readonly userAgent: "speakeasy-sdk/typescript 0.13.37 2.884.4 1.0.0 @openrouter/sdk";
54
+ readonly userAgent: "speakeasy-sdk/typescript 0.13.39 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.37",
29
+ sdkVersion: "0.13.39",
30
30
  genVersion: "2.884.4",
31
- userAgent: "speakeasy-sdk/typescript 0.13.37 2.884.4 1.0.0 @openrouter/sdk",
31
+ userAgent: "speakeasy-sdk/typescript 0.13.39 2.884.4 1.0.0 @openrouter/sdk",
32
32
  };
33
33
  //# sourceMappingURL=config.js.map
@@ -18,7 +18,7 @@ export declare function updateState<TTools extends readonly Tool[] = readonly To
18
18
  /**
19
19
  * Append new items to the message history
20
20
  */
21
- export declare function appendToMessages(current: models.InputsUnion, newItems: models.BaseInputsUnion[]): models.InputsUnion;
21
+ export declare function appendToMessages(current: models.InputsUnion, newItems: models.InputsUnion1[]): models.InputsUnion;
22
22
  /**
23
23
  * Check if a tool call requires approval
24
24
  * @param toolCall - The tool call to check
@@ -46,5 +46,5 @@ export declare function buildTurnContext(options: BuildTurnContextOptions): Turn
46
46
  * // Returns: [{ role: "user", content: "Hello!" }]
47
47
  * ```
48
48
  */
49
- export declare function normalizeInputToArray(input: models.InputsUnion): Array<models.BaseInputsUnion>;
49
+ export declare function normalizeInputToArray(input: models.InputsUnion): Array<models.InputsUnion1>;
50
50
  //# sourceMappingURL=turn-context.d.ts.map
@@ -0,0 +1,117 @@
1
+ import * as z from "zod/v4";
2
+ import { ClosedEnum, OpenEnum } from "../types/enums.js";
3
+ import { AdvisorServerToolOpenRouter, AdvisorServerToolOpenRouter$Outbound } from "./advisorservertoolopenrouter.js";
4
+ import { ApplyPatchServerTool, ApplyPatchServerTool$Outbound } from "./applypatchservertool.js";
5
+ import { ApplyPatchServerToolOpenRouter, ApplyPatchServerToolOpenRouter$Outbound } from "./applypatchservertoolopenrouter.js";
6
+ import { BashServerTool, BashServerTool$Outbound } from "./bashservertool.js";
7
+ import { ChatSearchModelsServerTool, ChatSearchModelsServerTool$Outbound } from "./chatsearchmodelsservertool.js";
8
+ import { CodeInterpreterServerTool, CodeInterpreterServerTool$Outbound } from "./codeinterpreterservertool.js";
9
+ import { CodexLocalShellTool, CodexLocalShellTool$Outbound } from "./codexlocalshelltool.js";
10
+ import { ComputerUseServerTool, ComputerUseServerTool$Outbound } from "./computeruseservertool.js";
11
+ import { CustomTool, CustomTool$Outbound } from "./customtool.js";
12
+ import { DatetimeServerTool, DatetimeServerTool$Outbound } from "./datetimeservertool.js";
13
+ import { FileSearchServerTool, FileSearchServerTool$Outbound } from "./filesearchservertool.js";
14
+ import { FilesServerTool, FilesServerTool$Outbound } from "./filesservertool.js";
15
+ import { FusionServerToolOpenRouter, FusionServerToolOpenRouter$Outbound } from "./fusionservertoolopenrouter.js";
16
+ import { ImageGenerationServerTool, ImageGenerationServerTool$Outbound } from "./imagegenerationservertool.js";
17
+ import { ImageGenerationServerToolOpenRouter, ImageGenerationServerToolOpenRouter$Outbound } from "./imagegenerationservertoolopenrouter.js";
18
+ import { LegacyWebSearchServerTool, LegacyWebSearchServerTool$Outbound } from "./legacywebsearchservertool.js";
19
+ import { McpServerTool, McpServerTool$Outbound } from "./mcpservertool.js";
20
+ import { Preview20250311WebSearchServerTool, Preview20250311WebSearchServerTool$Outbound } from "./preview20250311websearchservertool.js";
21
+ import { PreviewWebSearchServerTool, PreviewWebSearchServerTool$Outbound } from "./previewwebsearchservertool.js";
22
+ import { ShellServerTool, ShellServerTool$Outbound } from "./shellservertool.js";
23
+ import { ShellServerToolOpenRouter, ShellServerToolOpenRouter$Outbound } from "./shellservertoolopenrouter.js";
24
+ import { SubagentServerToolOpenRouter, SubagentServerToolOpenRouter$Outbound } from "./subagentservertoolopenrouter.js";
25
+ import { WebFetchServerTool, WebFetchServerTool$Outbound } from "./webfetchservertool.js";
26
+ import { WebSearchServerTool, WebSearchServerTool$Outbound } from "./websearchservertool.js";
27
+ import { WebSearchServerToolOpenRouter, WebSearchServerToolOpenRouter$Outbound } from "./websearchservertoolopenrouter.js";
28
+ export declare const AdditionalToolsItemRole: {
29
+ readonly Unknown: "unknown";
30
+ readonly User: "user";
31
+ readonly Assistant: "assistant";
32
+ readonly System: "system";
33
+ readonly Critic: "critic";
34
+ readonly Discriminator: "discriminator";
35
+ readonly Developer: "developer";
36
+ readonly Tool: "tool";
37
+ };
38
+ export type AdditionalToolsItemRole = OpenEnum<typeof AdditionalToolsItemRole>;
39
+ export type AdditionalToolsItemTool = {
40
+ type: string;
41
+ additionalProperties?: {
42
+ [k: string]: any | null;
43
+ } | undefined;
44
+ };
45
+ export declare const AdditionalToolsItemTypeFunction: {
46
+ readonly Function: "function";
47
+ };
48
+ export type AdditionalToolsItemTypeFunction = ClosedEnum<typeof AdditionalToolsItemTypeFunction>;
49
+ /**
50
+ * Function tool definition
51
+ */
52
+ export type AdditionalToolsItemToolFunction = {
53
+ description?: string | null | undefined;
54
+ name: string;
55
+ parameters: {
56
+ [k: string]: any | null;
57
+ } | null;
58
+ strict?: boolean | null | undefined;
59
+ type: AdditionalToolsItemTypeFunction;
60
+ };
61
+ export type AdditionalToolsItemToolUnion = ComputerUseServerTool | AdditionalToolsItemToolFunction | FileSearchServerTool | CodeInterpreterServerTool | McpServerTool | CustomTool | PreviewWebSearchServerTool | Preview20250311WebSearchServerTool | LegacyWebSearchServerTool | WebSearchServerTool | ImageGenerationServerTool | CodexLocalShellTool | ShellServerTool | ApplyPatchServerTool | AdvisorServerToolOpenRouter | SubagentServerToolOpenRouter | DatetimeServerTool | FilesServerTool | FusionServerToolOpenRouter | ImageGenerationServerToolOpenRouter | ChatSearchModelsServerTool | WebFetchServerTool | WebSearchServerToolOpenRouter | ApplyPatchServerToolOpenRouter | BashServerTool | ShellServerToolOpenRouter | AdditionalToolsItemTool;
62
+ export declare const TypeAdditionalTools: {
63
+ readonly AdditionalTools: "additional_tools";
64
+ };
65
+ export type TypeAdditionalTools = ClosedEnum<typeof TypeAdditionalTools>;
66
+ /**
67
+ * Additional tools made available to the model at this point in the input
68
+ */
69
+ export type AdditionalToolsItem = {
70
+ id?: string | null | undefined;
71
+ 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 | ChatSearchModelsServerTool | WebFetchServerTool | WebSearchServerToolOpenRouter | ApplyPatchServerToolOpenRouter | BashServerTool | ShellServerToolOpenRouter | AdditionalToolsItemTool>;
73
+ type: TypeAdditionalTools;
74
+ };
75
+ /** @internal */
76
+ export declare const AdditionalToolsItemRole$outboundSchema: z.ZodType<string, AdditionalToolsItemRole>;
77
+ /** @internal */
78
+ export type AdditionalToolsItemTool$Outbound = {
79
+ type: string;
80
+ [additionalProperties: string]: unknown;
81
+ };
82
+ /** @internal */
83
+ export declare const AdditionalToolsItemTool$outboundSchema: z.ZodType<AdditionalToolsItemTool$Outbound, AdditionalToolsItemTool>;
84
+ export declare function additionalToolsItemToolToJSON(additionalToolsItemTool: AdditionalToolsItemTool): string;
85
+ /** @internal */
86
+ export declare const AdditionalToolsItemTypeFunction$outboundSchema: z.ZodEnum<typeof AdditionalToolsItemTypeFunction>;
87
+ /** @internal */
88
+ export type AdditionalToolsItemToolFunction$Outbound = {
89
+ description?: string | null | undefined;
90
+ name: string;
91
+ parameters: {
92
+ [k: string]: any | null;
93
+ } | null;
94
+ strict?: boolean | null | undefined;
95
+ type: string;
96
+ };
97
+ /** @internal */
98
+ export declare const AdditionalToolsItemToolFunction$outboundSchema: z.ZodType<AdditionalToolsItemToolFunction$Outbound, AdditionalToolsItemToolFunction>;
99
+ export declare function additionalToolsItemToolFunctionToJSON(additionalToolsItemToolFunction: AdditionalToolsItemToolFunction): string;
100
+ /** @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 | ChatSearchModelsServerTool$Outbound | WebFetchServerTool$Outbound | WebSearchServerToolOpenRouter$Outbound | ApplyPatchServerToolOpenRouter$Outbound | BashServerTool$Outbound | ShellServerToolOpenRouter$Outbound | AdditionalToolsItemTool$Outbound;
102
+ /** @internal */
103
+ export declare const AdditionalToolsItemToolUnion$outboundSchema: z.ZodType<AdditionalToolsItemToolUnion$Outbound, AdditionalToolsItemToolUnion>;
104
+ export declare function additionalToolsItemToolUnionToJSON(additionalToolsItemToolUnion: AdditionalToolsItemToolUnion): string;
105
+ /** @internal */
106
+ export declare const TypeAdditionalTools$outboundSchema: z.ZodEnum<typeof TypeAdditionalTools>;
107
+ /** @internal */
108
+ export type AdditionalToolsItem$Outbound = {
109
+ id?: string | null | undefined;
110
+ 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 | ChatSearchModelsServerTool$Outbound | WebFetchServerTool$Outbound | WebSearchServerToolOpenRouter$Outbound | ApplyPatchServerToolOpenRouter$Outbound | BashServerTool$Outbound | ShellServerToolOpenRouter$Outbound | AdditionalToolsItemTool$Outbound>;
112
+ type: string;
113
+ };
114
+ /** @internal */
115
+ export declare const AdditionalToolsItem$outboundSchema: z.ZodType<AdditionalToolsItem$Outbound, AdditionalToolsItem>;
116
+ export declare function additionalToolsItemToJSON(additionalToolsItem: AdditionalToolsItem): string;
117
+ //# sourceMappingURL=additionaltoolsitem.d.ts.map
@@ -0,0 +1,152 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: d33059f81c21
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
+ import { AdvisorServerToolOpenRouter$outboundSchema, } from "./advisorservertoolopenrouter.js";
9
+ import { ApplyPatchServerTool$outboundSchema, } from "./applypatchservertool.js";
10
+ import { ApplyPatchServerToolOpenRouter$outboundSchema, } from "./applypatchservertoolopenrouter.js";
11
+ import { BashServerTool$outboundSchema, } from "./bashservertool.js";
12
+ import { ChatSearchModelsServerTool$outboundSchema, } from "./chatsearchmodelsservertool.js";
13
+ import { CodeInterpreterServerTool$outboundSchema, } from "./codeinterpreterservertool.js";
14
+ import { CodexLocalShellTool$outboundSchema, } from "./codexlocalshelltool.js";
15
+ import { ComputerUseServerTool$outboundSchema, } from "./computeruseservertool.js";
16
+ import { CustomTool$outboundSchema, } from "./customtool.js";
17
+ import { DatetimeServerTool$outboundSchema, } from "./datetimeservertool.js";
18
+ import { FileSearchServerTool$outboundSchema, } from "./filesearchservertool.js";
19
+ import { FilesServerTool$outboundSchema, } from "./filesservertool.js";
20
+ import { FusionServerToolOpenRouter$outboundSchema, } from "./fusionservertoolopenrouter.js";
21
+ import { ImageGenerationServerTool$outboundSchema, } from "./imagegenerationservertool.js";
22
+ import { ImageGenerationServerToolOpenRouter$outboundSchema, } from "./imagegenerationservertoolopenrouter.js";
23
+ import { LegacyWebSearchServerTool$outboundSchema, } from "./legacywebsearchservertool.js";
24
+ import { McpServerTool$outboundSchema, } from "./mcpservertool.js";
25
+ import { Preview20250311WebSearchServerTool$outboundSchema, } from "./preview20250311websearchservertool.js";
26
+ import { PreviewWebSearchServerTool$outboundSchema, } from "./previewwebsearchservertool.js";
27
+ import { ShellServerTool$outboundSchema, } from "./shellservertool.js";
28
+ import { ShellServerToolOpenRouter$outboundSchema, } from "./shellservertoolopenrouter.js";
29
+ import { SubagentServerToolOpenRouter$outboundSchema, } from "./subagentservertoolopenrouter.js";
30
+ import { WebFetchServerTool$outboundSchema, } from "./webfetchservertool.js";
31
+ import { WebSearchServerTool$outboundSchema, } from "./websearchservertool.js";
32
+ import { WebSearchServerToolOpenRouter$outboundSchema, } from "./websearchservertoolopenrouter.js";
33
+ export const AdditionalToolsItemRole = {
34
+ Unknown: "unknown",
35
+ User: "user",
36
+ Assistant: "assistant",
37
+ System: "system",
38
+ Critic: "critic",
39
+ Discriminator: "discriminator",
40
+ Developer: "developer",
41
+ Tool: "tool",
42
+ };
43
+ export const AdditionalToolsItemTypeFunction = {
44
+ Function: "function",
45
+ };
46
+ export const TypeAdditionalTools = {
47
+ AdditionalTools: "additional_tools",
48
+ };
49
+ /** @internal */
50
+ export const AdditionalToolsItemRole$outboundSchema = openEnums.outboundSchema(AdditionalToolsItemRole);
51
+ /** @internal */
52
+ export const AdditionalToolsItemTool$outboundSchema = z.object({
53
+ type: z.string(),
54
+ additionalProperties: z.record(z.string(), z.nullable(z.any())).optional(),
55
+ }).transform((v) => {
56
+ return {
57
+ ...v.additionalProperties,
58
+ ...remap$(v, {
59
+ additionalProperties: null,
60
+ }),
61
+ };
62
+ });
63
+ export function additionalToolsItemToolToJSON(additionalToolsItemTool) {
64
+ return JSON.stringify(AdditionalToolsItemTool$outboundSchema.parse(additionalToolsItemTool));
65
+ }
66
+ /** @internal */
67
+ export const AdditionalToolsItemTypeFunction$outboundSchema = z.enum(AdditionalToolsItemTypeFunction);
68
+ /** @internal */
69
+ export const AdditionalToolsItemToolFunction$outboundSchema = z.object({
70
+ description: z.nullable(z.string()).optional(),
71
+ name: z.string(),
72
+ parameters: z.nullable(z.record(z.string(), z.nullable(z.any()))),
73
+ strict: z.nullable(z.boolean()).optional(),
74
+ type: AdditionalToolsItemTypeFunction$outboundSchema,
75
+ });
76
+ export function additionalToolsItemToolFunctionToJSON(additionalToolsItemToolFunction) {
77
+ return JSON.stringify(AdditionalToolsItemToolFunction$outboundSchema.parse(additionalToolsItemToolFunction));
78
+ }
79
+ /** @internal */
80
+ export const AdditionalToolsItemToolUnion$outboundSchema = z.union([
81
+ ComputerUseServerTool$outboundSchema,
82
+ z.lazy(() => AdditionalToolsItemToolFunction$outboundSchema),
83
+ FileSearchServerTool$outboundSchema,
84
+ CodeInterpreterServerTool$outboundSchema,
85
+ McpServerTool$outboundSchema,
86
+ CustomTool$outboundSchema,
87
+ PreviewWebSearchServerTool$outboundSchema,
88
+ Preview20250311WebSearchServerTool$outboundSchema,
89
+ LegacyWebSearchServerTool$outboundSchema,
90
+ WebSearchServerTool$outboundSchema,
91
+ ImageGenerationServerTool$outboundSchema,
92
+ CodexLocalShellTool$outboundSchema,
93
+ ShellServerTool$outboundSchema,
94
+ ApplyPatchServerTool$outboundSchema,
95
+ AdvisorServerToolOpenRouter$outboundSchema,
96
+ SubagentServerToolOpenRouter$outboundSchema,
97
+ DatetimeServerTool$outboundSchema,
98
+ FilesServerTool$outboundSchema,
99
+ FusionServerToolOpenRouter$outboundSchema,
100
+ ImageGenerationServerToolOpenRouter$outboundSchema,
101
+ ChatSearchModelsServerTool$outboundSchema,
102
+ WebFetchServerTool$outboundSchema,
103
+ WebSearchServerToolOpenRouter$outboundSchema,
104
+ ApplyPatchServerToolOpenRouter$outboundSchema,
105
+ BashServerTool$outboundSchema,
106
+ ShellServerToolOpenRouter$outboundSchema,
107
+ z.lazy(() => AdditionalToolsItemTool$outboundSchema),
108
+ ]);
109
+ export function additionalToolsItemToolUnionToJSON(additionalToolsItemToolUnion) {
110
+ return JSON.stringify(AdditionalToolsItemToolUnion$outboundSchema.parse(additionalToolsItemToolUnion));
111
+ }
112
+ /** @internal */
113
+ export const TypeAdditionalTools$outboundSchema = z.enum(TypeAdditionalTools);
114
+ /** @internal */
115
+ export const AdditionalToolsItem$outboundSchema = z.object({
116
+ id: z.nullable(z.string()).optional(),
117
+ role: AdditionalToolsItemRole$outboundSchema,
118
+ tools: z.array(z.union([
119
+ ComputerUseServerTool$outboundSchema,
120
+ z.lazy(() => AdditionalToolsItemToolFunction$outboundSchema),
121
+ FileSearchServerTool$outboundSchema,
122
+ CodeInterpreterServerTool$outboundSchema,
123
+ McpServerTool$outboundSchema,
124
+ CustomTool$outboundSchema,
125
+ PreviewWebSearchServerTool$outboundSchema,
126
+ Preview20250311WebSearchServerTool$outboundSchema,
127
+ LegacyWebSearchServerTool$outboundSchema,
128
+ WebSearchServerTool$outboundSchema,
129
+ ImageGenerationServerTool$outboundSchema,
130
+ CodexLocalShellTool$outboundSchema,
131
+ ShellServerTool$outboundSchema,
132
+ ApplyPatchServerTool$outboundSchema,
133
+ AdvisorServerToolOpenRouter$outboundSchema,
134
+ SubagentServerToolOpenRouter$outboundSchema,
135
+ DatetimeServerTool$outboundSchema,
136
+ FilesServerTool$outboundSchema,
137
+ FusionServerToolOpenRouter$outboundSchema,
138
+ ImageGenerationServerToolOpenRouter$outboundSchema,
139
+ ChatSearchModelsServerTool$outboundSchema,
140
+ WebFetchServerTool$outboundSchema,
141
+ WebSearchServerToolOpenRouter$outboundSchema,
142
+ ApplyPatchServerToolOpenRouter$outboundSchema,
143
+ BashServerTool$outboundSchema,
144
+ ShellServerToolOpenRouter$outboundSchema,
145
+ z.lazy(() => AdditionalToolsItemTool$outboundSchema),
146
+ ])),
147
+ type: TypeAdditionalTools$outboundSchema,
148
+ });
149
+ export function additionalToolsItemToJSON(additionalToolsItem) {
150
+ return JSON.stringify(AdditionalToolsItem$outboundSchema.parse(additionalToolsItem));
151
+ }
152
+ //# sourceMappingURL=additionaltoolsitem.js.map
@@ -1,17 +1,26 @@
1
1
  import * as z from "zod/v4";
2
+ import { ClosedEnum } from "../types/enums.js";
2
3
  import { Result as SafeParseResult } from "../types/fp.js";
3
4
  import { SDKValidationError } from "./errors/sdkvalidationerror.js";
5
+ export declare const ApplyPatchServerToolType: {
6
+ readonly ApplyPatch: "apply_patch";
7
+ };
8
+ export type ApplyPatchServerToolType = ClosedEnum<typeof ApplyPatchServerToolType>;
4
9
  /**
5
10
  * Apply patch tool configuration
6
11
  */
7
12
  export type ApplyPatchServerTool = {
8
- type: "apply_patch";
13
+ type: ApplyPatchServerToolType;
9
14
  };
10
15
  /** @internal */
16
+ export declare const ApplyPatchServerToolType$inboundSchema: z.ZodEnum<typeof ApplyPatchServerToolType>;
17
+ /** @internal */
18
+ export declare const ApplyPatchServerToolType$outboundSchema: z.ZodEnum<typeof ApplyPatchServerToolType>;
19
+ /** @internal */
11
20
  export declare const ApplyPatchServerTool$inboundSchema: z.ZodType<ApplyPatchServerTool, unknown>;
12
21
  /** @internal */
13
22
  export type ApplyPatchServerTool$Outbound = {
14
- type: "apply_patch";
23
+ type: string;
15
24
  };
16
25
  /** @internal */
17
26
  export declare const ApplyPatchServerTool$outboundSchema: z.ZodType<ApplyPatchServerTool$Outbound, ApplyPatchServerTool>;
@@ -4,13 +4,20 @@
4
4
  */
5
5
  import * as z from "zod/v4";
6
6
  import { safeParse } from "../lib/schemas.js";
7
+ export const ApplyPatchServerToolType = {
8
+ ApplyPatch: "apply_patch",
9
+ };
10
+ /** @internal */
11
+ export const ApplyPatchServerToolType$inboundSchema = z.enum(ApplyPatchServerToolType);
12
+ /** @internal */
13
+ export const ApplyPatchServerToolType$outboundSchema = ApplyPatchServerToolType$inboundSchema;
7
14
  /** @internal */
8
15
  export const ApplyPatchServerTool$inboundSchema = z.object({
9
- type: z.literal("apply_patch"),
16
+ type: ApplyPatchServerToolType$inboundSchema,
10
17
  });
11
18
  /** @internal */
12
19
  export const ApplyPatchServerTool$outboundSchema = z.object({
13
- type: z.literal("apply_patch"),
20
+ type: ApplyPatchServerToolType$outboundSchema,
14
21
  });
15
22
  export function applyPatchServerToolToJSON(applyPatchServerTool) {
16
23
  return JSON.stringify(ApplyPatchServerTool$outboundSchema.parse(applyPatchServerTool));
@@ -1,5 +1,10 @@
1
1
  import * as z from "zod/v4";
2
+ import { ClosedEnum } from "../types/enums.js";
2
3
  import { ApplyPatchServerToolConfig, ApplyPatchServerToolConfig$Outbound } from "./applypatchservertoolconfig.js";
4
+ export declare const ApplyPatchServerToolOpenRouterType: {
5
+ readonly OpenrouterApplyPatch: "openrouter:apply_patch";
6
+ };
7
+ export type ApplyPatchServerToolOpenRouterType = ClosedEnum<typeof ApplyPatchServerToolOpenRouterType>;
3
8
  /**
4
9
  * OpenRouter built-in server tool: validates V4A diff patches for file operations (create, update, delete). Restricted to the Responses API.
5
10
  */
@@ -8,12 +13,14 @@ export type ApplyPatchServerToolOpenRouter = {
8
13
  * Configuration for the openrouter:apply_patch server tool
9
14
  */
10
15
  parameters?: ApplyPatchServerToolConfig | undefined;
11
- type: "openrouter:apply_patch";
16
+ type: ApplyPatchServerToolOpenRouterType;
12
17
  };
13
18
  /** @internal */
19
+ export declare const ApplyPatchServerToolOpenRouterType$outboundSchema: z.ZodEnum<typeof ApplyPatchServerToolOpenRouterType>;
20
+ /** @internal */
14
21
  export type ApplyPatchServerToolOpenRouter$Outbound = {
15
22
  parameters?: ApplyPatchServerToolConfig$Outbound | undefined;
16
- type: "openrouter:apply_patch";
23
+ type: string;
17
24
  };
18
25
  /** @internal */
19
26
  export declare const ApplyPatchServerToolOpenRouter$outboundSchema: z.ZodType<ApplyPatchServerToolOpenRouter$Outbound, ApplyPatchServerToolOpenRouter>;
@@ -4,10 +4,15 @@
4
4
  */
5
5
  import * as z from "zod/v4";
6
6
  import { ApplyPatchServerToolConfig$outboundSchema, } from "./applypatchservertoolconfig.js";
7
+ export const ApplyPatchServerToolOpenRouterType = {
8
+ OpenrouterApplyPatch: "openrouter:apply_patch",
9
+ };
10
+ /** @internal */
11
+ export const ApplyPatchServerToolOpenRouterType$outboundSchema = z.enum(ApplyPatchServerToolOpenRouterType);
7
12
  /** @internal */
8
13
  export const ApplyPatchServerToolOpenRouter$outboundSchema = z.object({
9
14
  parameters: ApplyPatchServerToolConfig$outboundSchema.optional(),
10
- type: z.literal("openrouter:apply_patch"),
15
+ type: ApplyPatchServerToolOpenRouterType$outboundSchema,
11
16
  });
12
17
  export function applyPatchServerToolOpenRouterToJSON(applyPatchServerToolOpenRouter) {
13
18
  return JSON.stringify(ApplyPatchServerToolOpenRouter$outboundSchema.parse(applyPatchServerToolOpenRouter));
@@ -75,7 +75,7 @@ export declare const BYOKProviderSlug: {
75
75
  readonly Recraft: "recraft";
76
76
  readonly Reka: "reka";
77
77
  readonly Relace: "relace";
78
- readonly SakanaAi: "sakana-ai";
78
+ readonly Sakana: "sakana";
79
79
  readonly Sambanova: "sambanova";
80
80
  readonly Seed: "seed";
81
81
  readonly Siliconflow: "siliconflow";
@@ -78,7 +78,7 @@ export const BYOKProviderSlug = {
78
78
  Recraft: "recraft",
79
79
  Reka: "reka",
80
80
  Relace: "relace",
81
- SakanaAi: "sakana-ai",
81
+ Sakana: "sakana",
82
82
  Sambanova: "sambanova",
83
83
  Seed: "seed",
84
84
  Siliconflow: "siliconflow",
@@ -19,12 +19,16 @@ export type ContainerAuto = {
19
19
  type: ContainerType;
20
20
  };
21
21
  export type Container = ContainerAuto | string;
22
+ export declare const TypeCodeInterpreter: {
23
+ readonly CodeInterpreter: "code_interpreter";
24
+ };
25
+ export type TypeCodeInterpreter = ClosedEnum<typeof TypeCodeInterpreter>;
22
26
  /**
23
27
  * Code interpreter tool configuration
24
28
  */
25
29
  export type CodeInterpreterServerTool = {
26
30
  container: ContainerAuto | string;
27
- type: "code_interpreter";
31
+ type: TypeCodeInterpreter;
28
32
  };
29
33
  /** @internal */
30
34
  export declare const MemoryLimit$inboundSchema: z.ZodType<MemoryLimit, unknown>;
@@ -55,11 +59,15 @@ export declare const Container$outboundSchema: z.ZodType<Container$Outbound, Con
55
59
  export declare function containerToJSON(container: Container): string;
56
60
  export declare function containerFromJSON(jsonString: string): SafeParseResult<Container, SDKValidationError>;
57
61
  /** @internal */
62
+ export declare const TypeCodeInterpreter$inboundSchema: z.ZodEnum<typeof TypeCodeInterpreter>;
63
+ /** @internal */
64
+ export declare const TypeCodeInterpreter$outboundSchema: z.ZodEnum<typeof TypeCodeInterpreter>;
65
+ /** @internal */
58
66
  export declare const CodeInterpreterServerTool$inboundSchema: z.ZodType<CodeInterpreterServerTool, unknown>;
59
67
  /** @internal */
60
68
  export type CodeInterpreterServerTool$Outbound = {
61
69
  container: ContainerAuto$Outbound | string;
62
- type: "code_interpreter";
70
+ type: string;
63
71
  };
64
72
  /** @internal */
65
73
  export declare const CodeInterpreterServerTool$outboundSchema: z.ZodType<CodeInterpreterServerTool$Outbound, CodeInterpreterServerTool>;
@@ -15,6 +15,9 @@ export const MemoryLimit = {
15
15
  export const ContainerType = {
16
16
  Auto: "auto",
17
17
  };
18
+ export const TypeCodeInterpreter = {
19
+ CodeInterpreter: "code_interpreter",
20
+ };
18
21
  /** @internal */
19
22
  export const MemoryLimit$inboundSchema = openEnums.inboundSchema(MemoryLimit);
20
23
  /** @internal */
@@ -67,14 +70,18 @@ export function containerFromJSON(jsonString) {
67
70
  return safeParse(jsonString, (x) => Container$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Container' from JSON`);
68
71
  }
69
72
  /** @internal */
73
+ export const TypeCodeInterpreter$inboundSchema = z.enum(TypeCodeInterpreter);
74
+ /** @internal */
75
+ export const TypeCodeInterpreter$outboundSchema = TypeCodeInterpreter$inboundSchema;
76
+ /** @internal */
70
77
  export const CodeInterpreterServerTool$inboundSchema = z.object({
71
78
  container: z.union([z.lazy(() => ContainerAuto$inboundSchema), z.string()]),
72
- type: z.literal("code_interpreter"),
79
+ type: TypeCodeInterpreter$inboundSchema,
73
80
  });
74
81
  /** @internal */
75
82
  export const CodeInterpreterServerTool$outboundSchema = z.object({
76
83
  container: z.union([z.lazy(() => ContainerAuto$outboundSchema), z.string()]),
77
- type: z.literal("code_interpreter"),
84
+ type: TypeCodeInterpreter$outboundSchema,
78
85
  });
79
86
  export function codeInterpreterServerToolToJSON(codeInterpreterServerTool) {
80
87
  return JSON.stringify(CodeInterpreterServerTool$outboundSchema.parse(codeInterpreterServerTool));