@openrouter/sdk 1.4.8 → 1.4.10
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/alignment.d.ts +17 -0
- package/esm/models/alignment.js +15 -0
- package/esm/models/alignmentallowedcallrecord.d.ts +19 -0
- package/esm/models/alignmentallowedcallrecord.js +17 -0
- package/esm/models/alignmentblockedcallrecord.d.ts +19 -0
- package/esm/models/alignmentblockedcallrecord.js +17 -0
- package/esm/models/alignmentcallrecord.d.ts +12 -0
- package/esm/models/alignmentcallrecord.js +19 -0
- package/esm/models/alignmentchataudio.d.ts +20 -0
- package/esm/models/alignmentchataudio.js +15 -0
- package/esm/models/alignmentchatimage.d.ts +24 -0
- package/esm/models/alignmentchatimage.js +32 -0
- package/esm/models/alignmentchatrejected.d.ts +31 -0
- package/esm/models/alignmentchatrejected.js +32 -0
- package/esm/models/alignmentchattoolcall.d.ts +26 -0
- package/esm/models/alignmentchattoolcall.js +29 -0
- package/esm/models/alignmentplugin.d.ts +54 -0
- package/esm/models/alignmentplugin.js +33 -0
- package/esm/models/alignmentrejected.d.ts +10 -0
- package/esm/models/alignmentrejected.js +17 -0
- package/esm/models/alignmentresponsesrejected.d.ts +18 -0
- package/esm/models/alignmentresponsesrejected.js +31 -0
- package/esm/models/alignmentrulerecord.d.ts +17 -0
- package/esm/models/alignmentrulerecord.js +15 -0
- package/esm/models/alignmentunavailablecallrecord.d.ts +25 -0
- package/esm/models/alignmentunavailablecallrecord.js +25 -0
- package/esm/models/batchobject.d.ts +5 -0
- package/esm/models/batchobject.js +2 -0
- package/esm/models/chatrequest.d.ts +5 -4
- package/esm/models/chatrequest.js +3 -0
- package/esm/models/index.d.ts +22 -1
- package/esm/models/index.js +22 -1
- package/esm/models/messagesrequest.d.ts +5 -4
- package/esm/models/messagesrequest.js +3 -0
- package/esm/models/{responseserrorfield.d.ts → openresponseserrorfield.d.ts} +10 -5
- package/esm/models/{responseserrorfield.js → openresponseserrorfield.js} +7 -5
- package/esm/models/openresponseserrormetadata.d.ts +31 -0
- package/esm/models/openresponseserrormetadata.js +25 -0
- package/esm/models/openresponsesresult.d.ts +8 -3
- package/esm/models/openresponsesresult.js +4 -2
- package/esm/models/operations/listcontainerfiles.d.ts +1 -1
- package/esm/models/outputitemapplypatchcall.d.ts +31 -0
- package/esm/models/outputitemapplypatchcall.js +49 -0
- package/esm/models/outputitemcodeinterpretercall.d.ts +37 -0
- package/esm/models/outputitemcodeinterpretercall.js +51 -0
- package/esm/models/outputitemcustomtoolcall.d.ts +32 -0
- package/esm/models/outputitemcustomtoolcall.js +34 -0
- package/esm/models/outputitemfilesearchcall.d.ts +14 -0
- package/esm/models/outputitemfilesearchcall.js +18 -0
- package/esm/models/outputitemfunctioncall.d.ts +46 -0
- package/esm/models/outputitemfunctioncall.js +54 -0
- package/esm/models/outputitemimagegenerationcall.d.ts +1 -8
- package/esm/models/outputitemimagegenerationcall.js +1 -6
- package/esm/models/outputitemreasoning.d.ts +40 -0
- package/esm/models/outputitemreasoning.js +54 -0
- package/esm/models/outputitemwebsearchcall.d.ts +47 -0
- package/esm/models/outputitemwebsearchcall.js +60 -0
- package/esm/models/outputmessage.d.ts +1 -7
- package/esm/models/outputmessage.js +1 -6
- package/esm/models/outputwebsearchcallitem.d.ts +25 -25
- package/esm/models/outputwebsearchcallitem.js +31 -32
- package/esm/models/responsesrequest.d.ts +5 -4
- package/esm/models/responsesrequest.js +3 -0
- package/jsr.json +1 -1
- package/package.json +9 -9
|
@@ -5,12 +5,12 @@ import { Result as SafeParseResult } from "../types/fp.js";
|
|
|
5
5
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
6
6
|
import { WebSearchSource, WebSearchSource$Outbound } from "./websearchsource.js";
|
|
7
7
|
import { WebSearchStatus } from "./websearchstatus.js";
|
|
8
|
-
export type
|
|
8
|
+
export type OutputWebSearchCallItemActionFindInPage = {
|
|
9
9
|
pattern: string;
|
|
10
10
|
type: "find_in_page";
|
|
11
11
|
url: string;
|
|
12
12
|
};
|
|
13
|
-
export type
|
|
13
|
+
export type OutputWebSearchCallItemActionOpenPage = {
|
|
14
14
|
type: "open_page";
|
|
15
15
|
url?: string | null | undefined;
|
|
16
16
|
};
|
|
@@ -20,43 +20,43 @@ export type OutputWebSearchCallItemActionSearch = {
|
|
|
20
20
|
sources?: Array<WebSearchSource> | undefined;
|
|
21
21
|
type: "search";
|
|
22
22
|
};
|
|
23
|
-
export type
|
|
24
|
-
export declare const
|
|
23
|
+
export type OutputWebSearchCallItemActionUnion = OutputWebSearchCallItemActionSearch | OutputWebSearchCallItemActionOpenPage | OutputWebSearchCallItemActionFindInPage | discriminatedUnionTypes.Unknown<"type">;
|
|
24
|
+
export declare const OutputWebSearchCallItemTypeWebSearchCall: {
|
|
25
25
|
readonly WebSearchCall: "web_search_call";
|
|
26
26
|
};
|
|
27
|
-
export type
|
|
27
|
+
export type OutputWebSearchCallItemTypeWebSearchCall = ClosedEnum<typeof OutputWebSearchCallItemTypeWebSearchCall>;
|
|
28
28
|
export type OutputWebSearchCallItem = {
|
|
29
|
-
action?: OutputWebSearchCallItemActionSearch |
|
|
29
|
+
action?: OutputWebSearchCallItemActionSearch | OutputWebSearchCallItemActionOpenPage | OutputWebSearchCallItemActionFindInPage | discriminatedUnionTypes.Unknown<"type"> | undefined;
|
|
30
30
|
id: string;
|
|
31
31
|
status: WebSearchStatus;
|
|
32
|
-
type:
|
|
32
|
+
type: OutputWebSearchCallItemTypeWebSearchCall;
|
|
33
33
|
additionalProperties?: {
|
|
34
34
|
[k: string]: any;
|
|
35
35
|
} | undefined;
|
|
36
36
|
};
|
|
37
37
|
/** @internal */
|
|
38
|
-
export declare const
|
|
38
|
+
export declare const OutputWebSearchCallItemActionFindInPage$inboundSchema: z.ZodType<OutputWebSearchCallItemActionFindInPage, unknown>;
|
|
39
39
|
/** @internal */
|
|
40
|
-
export type
|
|
40
|
+
export type OutputWebSearchCallItemActionFindInPage$Outbound = {
|
|
41
41
|
pattern: string;
|
|
42
42
|
type: "find_in_page";
|
|
43
43
|
url: string;
|
|
44
44
|
};
|
|
45
45
|
/** @internal */
|
|
46
|
-
export declare const
|
|
47
|
-
export declare function
|
|
48
|
-
export declare function
|
|
46
|
+
export declare const OutputWebSearchCallItemActionFindInPage$outboundSchema: z.ZodType<OutputWebSearchCallItemActionFindInPage$Outbound, OutputWebSearchCallItemActionFindInPage>;
|
|
47
|
+
export declare function outputWebSearchCallItemActionFindInPageToJSON(outputWebSearchCallItemActionFindInPage: OutputWebSearchCallItemActionFindInPage): string;
|
|
48
|
+
export declare function outputWebSearchCallItemActionFindInPageFromJSON(jsonString: string): SafeParseResult<OutputWebSearchCallItemActionFindInPage, SDKValidationError>;
|
|
49
49
|
/** @internal */
|
|
50
|
-
export declare const
|
|
50
|
+
export declare const OutputWebSearchCallItemActionOpenPage$inboundSchema: z.ZodType<OutputWebSearchCallItemActionOpenPage, unknown>;
|
|
51
51
|
/** @internal */
|
|
52
|
-
export type
|
|
52
|
+
export type OutputWebSearchCallItemActionOpenPage$Outbound = {
|
|
53
53
|
type: "open_page";
|
|
54
54
|
url?: string | null | undefined;
|
|
55
55
|
};
|
|
56
56
|
/** @internal */
|
|
57
|
-
export declare const
|
|
58
|
-
export declare function
|
|
59
|
-
export declare function
|
|
57
|
+
export declare const OutputWebSearchCallItemActionOpenPage$outboundSchema: z.ZodType<OutputWebSearchCallItemActionOpenPage$Outbound, OutputWebSearchCallItemActionOpenPage>;
|
|
58
|
+
export declare function outputWebSearchCallItemActionOpenPageToJSON(outputWebSearchCallItemActionOpenPage: OutputWebSearchCallItemActionOpenPage): string;
|
|
59
|
+
export declare function outputWebSearchCallItemActionOpenPageFromJSON(jsonString: string): SafeParseResult<OutputWebSearchCallItemActionOpenPage, SDKValidationError>;
|
|
60
60
|
/** @internal */
|
|
61
61
|
export declare const OutputWebSearchCallItemActionSearch$inboundSchema: z.ZodType<OutputWebSearchCallItemActionSearch, unknown>;
|
|
62
62
|
/** @internal */
|
|
@@ -71,22 +71,22 @@ export declare const OutputWebSearchCallItemActionSearch$outboundSchema: z.ZodTy
|
|
|
71
71
|
export declare function outputWebSearchCallItemActionSearchToJSON(outputWebSearchCallItemActionSearch: OutputWebSearchCallItemActionSearch): string;
|
|
72
72
|
export declare function outputWebSearchCallItemActionSearchFromJSON(jsonString: string): SafeParseResult<OutputWebSearchCallItemActionSearch, SDKValidationError>;
|
|
73
73
|
/** @internal */
|
|
74
|
-
export declare const
|
|
74
|
+
export declare const OutputWebSearchCallItemActionUnion$inboundSchema: z.ZodType<OutputWebSearchCallItemActionUnion, unknown>;
|
|
75
75
|
/** @internal */
|
|
76
|
-
export type
|
|
76
|
+
export type OutputWebSearchCallItemActionUnion$Outbound = OutputWebSearchCallItemActionSearch$Outbound | OutputWebSearchCallItemActionOpenPage$Outbound | OutputWebSearchCallItemActionFindInPage$Outbound;
|
|
77
77
|
/** @internal */
|
|
78
|
-
export declare const
|
|
79
|
-
export declare function
|
|
80
|
-
export declare function
|
|
78
|
+
export declare const OutputWebSearchCallItemActionUnion$outboundSchema: z.ZodType<OutputWebSearchCallItemActionUnion$Outbound, OutputWebSearchCallItemActionUnion>;
|
|
79
|
+
export declare function outputWebSearchCallItemActionUnionToJSON(outputWebSearchCallItemActionUnion: OutputWebSearchCallItemActionUnion): string;
|
|
80
|
+
export declare function outputWebSearchCallItemActionUnionFromJSON(jsonString: string): SafeParseResult<OutputWebSearchCallItemActionUnion, SDKValidationError>;
|
|
81
81
|
/** @internal */
|
|
82
|
-
export declare const
|
|
82
|
+
export declare const OutputWebSearchCallItemTypeWebSearchCall$inboundSchema: z.ZodEnum<typeof OutputWebSearchCallItemTypeWebSearchCall>;
|
|
83
83
|
/** @internal */
|
|
84
|
-
export declare const
|
|
84
|
+
export declare const OutputWebSearchCallItemTypeWebSearchCall$outboundSchema: z.ZodEnum<typeof OutputWebSearchCallItemTypeWebSearchCall>;
|
|
85
85
|
/** @internal */
|
|
86
86
|
export declare const OutputWebSearchCallItem$inboundSchema: z.ZodType<OutputWebSearchCallItem, unknown>;
|
|
87
87
|
/** @internal */
|
|
88
88
|
export type OutputWebSearchCallItem$Outbound = {
|
|
89
|
-
action?: OutputWebSearchCallItemActionSearch$Outbound |
|
|
89
|
+
action?: OutputWebSearchCallItemActionSearch$Outbound | OutputWebSearchCallItemActionOpenPage$Outbound | OutputWebSearchCallItemActionFindInPage$Outbound | undefined;
|
|
90
90
|
id: string;
|
|
91
91
|
status: string;
|
|
92
92
|
type: string;
|
|
@@ -8,42 +8,42 @@ import { collectExtraKeys as collectExtraKeys$, safeParse, } from "../lib/schema
|
|
|
8
8
|
import { discriminatedUnion } from "../types/discriminatedUnion.js";
|
|
9
9
|
import { WebSearchSource$inboundSchema, WebSearchSource$outboundSchema, } from "./websearchsource.js";
|
|
10
10
|
import { WebSearchStatus$inboundSchema, WebSearchStatus$outboundSchema, } from "./websearchstatus.js";
|
|
11
|
-
export const
|
|
11
|
+
export const OutputWebSearchCallItemTypeWebSearchCall = {
|
|
12
12
|
WebSearchCall: "web_search_call",
|
|
13
13
|
};
|
|
14
14
|
/** @internal */
|
|
15
|
-
export const
|
|
15
|
+
export const OutputWebSearchCallItemActionFindInPage$inboundSchema = z.object({
|
|
16
16
|
pattern: z.string(),
|
|
17
17
|
type: z.literal("find_in_page"),
|
|
18
18
|
url: z.string(),
|
|
19
19
|
});
|
|
20
20
|
/** @internal */
|
|
21
|
-
export const
|
|
21
|
+
export const OutputWebSearchCallItemActionFindInPage$outboundSchema = z.object({
|
|
22
22
|
pattern: z.string(),
|
|
23
23
|
type: z.literal("find_in_page"),
|
|
24
24
|
url: z.string(),
|
|
25
25
|
});
|
|
26
|
-
export function
|
|
27
|
-
return JSON.stringify(
|
|
26
|
+
export function outputWebSearchCallItemActionFindInPageToJSON(outputWebSearchCallItemActionFindInPage) {
|
|
27
|
+
return JSON.stringify(OutputWebSearchCallItemActionFindInPage$outboundSchema.parse(outputWebSearchCallItemActionFindInPage));
|
|
28
28
|
}
|
|
29
|
-
export function
|
|
30
|
-
return safeParse(jsonString, (x) =>
|
|
29
|
+
export function outputWebSearchCallItemActionFindInPageFromJSON(jsonString) {
|
|
30
|
+
return safeParse(jsonString, (x) => OutputWebSearchCallItemActionFindInPage$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'OutputWebSearchCallItemActionFindInPage' from JSON`);
|
|
31
31
|
}
|
|
32
32
|
/** @internal */
|
|
33
|
-
export const
|
|
33
|
+
export const OutputWebSearchCallItemActionOpenPage$inboundSchema = z.object({
|
|
34
34
|
type: z.literal("open_page"),
|
|
35
35
|
url: z.nullable(z.string()).optional(),
|
|
36
36
|
});
|
|
37
37
|
/** @internal */
|
|
38
|
-
export const
|
|
38
|
+
export const OutputWebSearchCallItemActionOpenPage$outboundSchema = z.object({
|
|
39
39
|
type: z.literal("open_page"),
|
|
40
40
|
url: z.nullable(z.string()).optional(),
|
|
41
41
|
});
|
|
42
|
-
export function
|
|
43
|
-
return JSON.stringify(
|
|
42
|
+
export function outputWebSearchCallItemActionOpenPageToJSON(outputWebSearchCallItemActionOpenPage) {
|
|
43
|
+
return JSON.stringify(OutputWebSearchCallItemActionOpenPage$outboundSchema.parse(outputWebSearchCallItemActionOpenPage));
|
|
44
44
|
}
|
|
45
|
-
export function
|
|
46
|
-
return safeParse(jsonString, (x) =>
|
|
45
|
+
export function outputWebSearchCallItemActionOpenPageFromJSON(jsonString) {
|
|
46
|
+
return safeParse(jsonString, (x) => OutputWebSearchCallItemActionOpenPage$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'OutputWebSearchCallItemActionOpenPage' from JSON`);
|
|
47
47
|
}
|
|
48
48
|
/** @internal */
|
|
49
49
|
export const OutputWebSearchCallItemActionSearch$inboundSchema = z.object({
|
|
@@ -66,49 +66,48 @@ export function outputWebSearchCallItemActionSearchFromJSON(jsonString) {
|
|
|
66
66
|
return safeParse(jsonString, (x) => OutputWebSearchCallItemActionSearch$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'OutputWebSearchCallItemActionSearch' from JSON`);
|
|
67
67
|
}
|
|
68
68
|
/** @internal */
|
|
69
|
-
export const
|
|
69
|
+
export const OutputWebSearchCallItemActionUnion$inboundSchema = discriminatedUnion("type", {
|
|
70
70
|
search: z.lazy(() => OutputWebSearchCallItemActionSearch$inboundSchema),
|
|
71
|
-
open_page: z.lazy(() =>
|
|
72
|
-
find_in_page: z.lazy(() =>
|
|
71
|
+
open_page: z.lazy(() => OutputWebSearchCallItemActionOpenPage$inboundSchema),
|
|
72
|
+
find_in_page: z.lazy(() => OutputWebSearchCallItemActionFindInPage$inboundSchema),
|
|
73
73
|
});
|
|
74
74
|
/** @internal */
|
|
75
|
-
export const
|
|
76
|
-
.union([
|
|
75
|
+
export const OutputWebSearchCallItemActionUnion$outboundSchema = z.union([
|
|
77
76
|
z.lazy(() => OutputWebSearchCallItemActionSearch$outboundSchema),
|
|
78
|
-
z.lazy(() =>
|
|
79
|
-
z.lazy(() =>
|
|
77
|
+
z.lazy(() => OutputWebSearchCallItemActionOpenPage$outboundSchema),
|
|
78
|
+
z.lazy(() => OutputWebSearchCallItemActionFindInPage$outboundSchema),
|
|
80
79
|
]);
|
|
81
|
-
export function
|
|
82
|
-
return JSON.stringify(
|
|
80
|
+
export function outputWebSearchCallItemActionUnionToJSON(outputWebSearchCallItemActionUnion) {
|
|
81
|
+
return JSON.stringify(OutputWebSearchCallItemActionUnion$outboundSchema.parse(outputWebSearchCallItemActionUnion));
|
|
83
82
|
}
|
|
84
|
-
export function
|
|
85
|
-
return safeParse(jsonString, (x) =>
|
|
83
|
+
export function outputWebSearchCallItemActionUnionFromJSON(jsonString) {
|
|
84
|
+
return safeParse(jsonString, (x) => OutputWebSearchCallItemActionUnion$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'OutputWebSearchCallItemActionUnion' from JSON`);
|
|
86
85
|
}
|
|
87
86
|
/** @internal */
|
|
88
|
-
export const
|
|
87
|
+
export const OutputWebSearchCallItemTypeWebSearchCall$inboundSchema = z.enum(OutputWebSearchCallItemTypeWebSearchCall);
|
|
89
88
|
/** @internal */
|
|
90
|
-
export const
|
|
89
|
+
export const OutputWebSearchCallItemTypeWebSearchCall$outboundSchema = OutputWebSearchCallItemTypeWebSearchCall$inboundSchema;
|
|
91
90
|
/** @internal */
|
|
92
91
|
export const OutputWebSearchCallItem$inboundSchema = collectExtraKeys$(z.object({
|
|
93
92
|
action: discriminatedUnion("type", {
|
|
94
93
|
search: z.lazy(() => OutputWebSearchCallItemActionSearch$inboundSchema),
|
|
95
|
-
open_page: z.lazy(() =>
|
|
96
|
-
find_in_page: z.lazy(() =>
|
|
94
|
+
open_page: z.lazy(() => OutputWebSearchCallItemActionOpenPage$inboundSchema),
|
|
95
|
+
find_in_page: z.lazy(() => OutputWebSearchCallItemActionFindInPage$inboundSchema),
|
|
97
96
|
}).optional(),
|
|
98
97
|
id: z.string(),
|
|
99
98
|
status: WebSearchStatus$inboundSchema,
|
|
100
|
-
type:
|
|
99
|
+
type: OutputWebSearchCallItemTypeWebSearchCall$inboundSchema,
|
|
101
100
|
}).catchall(z.any()), "additionalProperties", true);
|
|
102
101
|
/** @internal */
|
|
103
102
|
export const OutputWebSearchCallItem$outboundSchema = z.object({
|
|
104
103
|
action: z.union([
|
|
105
104
|
z.lazy(() => OutputWebSearchCallItemActionSearch$outboundSchema),
|
|
106
|
-
z.lazy(() =>
|
|
107
|
-
z.lazy(() =>
|
|
105
|
+
z.lazy(() => OutputWebSearchCallItemActionOpenPage$outboundSchema),
|
|
106
|
+
z.lazy(() => OutputWebSearchCallItemActionFindInPage$outboundSchema),
|
|
108
107
|
]).optional(),
|
|
109
108
|
id: z.string(),
|
|
110
109
|
status: WebSearchStatus$outboundSchema,
|
|
111
|
-
type:
|
|
110
|
+
type: OutputWebSearchCallItemTypeWebSearchCall$outboundSchema,
|
|
112
111
|
additionalProperties: z.record(z.string(), z.any()).optional(),
|
|
113
112
|
}).transform((v) => {
|
|
114
113
|
return {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as z from "zod/v4";
|
|
2
2
|
import { OpenEnum } from "../types/enums.js";
|
|
3
3
|
import { AdvisorServerToolOpenRouter, AdvisorServerToolOpenRouter$Outbound } from "./advisorservertoolopenrouter.js";
|
|
4
|
+
import { AlignmentPlugin, AlignmentPlugin$Outbound } from "./alignmentplugin.js";
|
|
4
5
|
import { AnthropicCacheControlDirective, AnthropicCacheControlDirective$Outbound } from "./anthropiccachecontroldirective.js";
|
|
5
6
|
import { ApplyPatchServerTool, ApplyPatchServerTool$Outbound } from "./applypatchservertool.js";
|
|
6
7
|
import { ApplyPatchServerToolOpenRouter, ApplyPatchServerToolOpenRouter$Outbound } from "./applypatchservertoolopenrouter.js";
|
|
@@ -57,7 +58,7 @@ import { WebFetchServerTool, WebFetchServerTool$Outbound } from "./webfetchserve
|
|
|
57
58
|
import { WebSearchPlugin, WebSearchPlugin$Outbound } from "./websearchplugin.js";
|
|
58
59
|
import { WebSearchServerTool, WebSearchServerTool$Outbound } from "./websearchservertool.js";
|
|
59
60
|
import { WebSearchServerToolOpenRouter, WebSearchServerToolOpenRouter$Outbound } from "./websearchservertoolopenrouter.js";
|
|
60
|
-
export type ResponsesRequestPlugin = AutoBetaRouterPlugin | AutoRouterPlugin | ContextCompressionPlugin | FileParserPlugin | FusionPlugin | JevRouterPlugin | ModerationPlugin | ParetoRouterPlugin | ResponseHealingPlugin | SwitchyardRouterPlugin | WebSearchPlugin | WebFetchPlugin;
|
|
61
|
+
export type ResponsesRequestPlugin = AlignmentPlugin | AutoBetaRouterPlugin | AutoRouterPlugin | ContextCompressionPlugin | FileParserPlugin | FusionPlugin | JevRouterPlugin | ModerationPlugin | ParetoRouterPlugin | ResponseHealingPlugin | SwitchyardRouterPlugin | WebSearchPlugin | WebFetchPlugin;
|
|
61
62
|
export type ReasoningConfig = {
|
|
62
63
|
/**
|
|
63
64
|
* Controls which reasoning is available to the model. `auto` uses the model default (same as omitting); `all_turns` includes reasoning from earlier turns passed in input; `current_turn` limits to the current turn only. Only supported by OpenAI GPT-5.6 and newer.
|
|
@@ -210,7 +211,7 @@ export type ResponsesRequest = {
|
|
|
210
211
|
/**
|
|
211
212
|
* Plugins you want to enable for this request, including their settings.
|
|
212
213
|
*/
|
|
213
|
-
plugins?: Array<AutoBetaRouterPlugin | AutoRouterPlugin | ContextCompressionPlugin | FileParserPlugin | FusionPlugin | JevRouterPlugin | ModerationPlugin | ParetoRouterPlugin | ResponseHealingPlugin | SwitchyardRouterPlugin | WebSearchPlugin | WebFetchPlugin> | undefined;
|
|
214
|
+
plugins?: Array<AlignmentPlugin | AutoBetaRouterPlugin | AutoRouterPlugin | ContextCompressionPlugin | FileParserPlugin | FusionPlugin | JevRouterPlugin | ModerationPlugin | ParetoRouterPlugin | ResponseHealingPlugin | SwitchyardRouterPlugin | WebSearchPlugin | WebFetchPlugin> | undefined;
|
|
214
215
|
presencePenalty?: number | null | undefined;
|
|
215
216
|
/**
|
|
216
217
|
* Not supported on this proxy. Each response request is independent: no responses are stored, so a previous response cannot be referenced. Requests with a non-null value are rejected with a 400 error. Send the full conversation history in `input` instead.
|
|
@@ -323,7 +324,7 @@ export type ResponsesRequest = {
|
|
|
323
324
|
user?: string | undefined;
|
|
324
325
|
};
|
|
325
326
|
/** @internal */
|
|
326
|
-
export type ResponsesRequestPlugin$Outbound = AutoBetaRouterPlugin$Outbound | AutoRouterPlugin$Outbound | ContextCompressionPlugin$Outbound | FileParserPlugin$Outbound | FusionPlugin$Outbound | JevRouterPlugin$Outbound | ModerationPlugin$Outbound | ParetoRouterPlugin$Outbound | ResponseHealingPlugin$Outbound | SwitchyardRouterPlugin$Outbound | WebSearchPlugin$Outbound | WebFetchPlugin$Outbound;
|
|
327
|
+
export type ResponsesRequestPlugin$Outbound = AlignmentPlugin$Outbound | AutoBetaRouterPlugin$Outbound | AutoRouterPlugin$Outbound | ContextCompressionPlugin$Outbound | FileParserPlugin$Outbound | FusionPlugin$Outbound | JevRouterPlugin$Outbound | ModerationPlugin$Outbound | ParetoRouterPlugin$Outbound | ResponseHealingPlugin$Outbound | SwitchyardRouterPlugin$Outbound | WebSearchPlugin$Outbound | WebFetchPlugin$Outbound;
|
|
327
328
|
/** @internal */
|
|
328
329
|
export declare const ResponsesRequestPlugin$outboundSchema: z.ZodType<ResponsesRequestPlugin$Outbound, ResponsesRequestPlugin>;
|
|
329
330
|
export declare function responsesRequestPluginToJSON(responsesRequestPlugin: ResponsesRequestPlugin): string;
|
|
@@ -436,7 +437,7 @@ export type ResponsesRequest$Outbound = {
|
|
|
436
437
|
model?: string | undefined;
|
|
437
438
|
models?: Array<string> | undefined;
|
|
438
439
|
parallel_tool_calls?: boolean | null | undefined;
|
|
439
|
-
plugins?: Array<AutoBetaRouterPlugin$Outbound | AutoRouterPlugin$Outbound | ContextCompressionPlugin$Outbound | FileParserPlugin$Outbound | FusionPlugin$Outbound | JevRouterPlugin$Outbound | ModerationPlugin$Outbound | ParetoRouterPlugin$Outbound | ResponseHealingPlugin$Outbound | SwitchyardRouterPlugin$Outbound | WebSearchPlugin$Outbound | WebFetchPlugin$Outbound> | undefined;
|
|
440
|
+
plugins?: Array<AlignmentPlugin$Outbound | AutoBetaRouterPlugin$Outbound | AutoRouterPlugin$Outbound | ContextCompressionPlugin$Outbound | FileParserPlugin$Outbound | FusionPlugin$Outbound | JevRouterPlugin$Outbound | ModerationPlugin$Outbound | ParetoRouterPlugin$Outbound | ResponseHealingPlugin$Outbound | SwitchyardRouterPlugin$Outbound | WebSearchPlugin$Outbound | WebFetchPlugin$Outbound> | undefined;
|
|
440
441
|
presence_penalty?: number | null | undefined;
|
|
441
442
|
previous_response_id?: any | undefined;
|
|
442
443
|
prompt?: StoredPromptTemplate$Outbound | null | undefined;
|
|
@@ -6,6 +6,7 @@ import * as z from "zod/v4";
|
|
|
6
6
|
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
7
|
import * as openEnums from "../types/enums.js";
|
|
8
8
|
import { AdvisorServerToolOpenRouter$outboundSchema, } from "./advisorservertoolopenrouter.js";
|
|
9
|
+
import { AlignmentPlugin$outboundSchema, } from "./alignmentplugin.js";
|
|
9
10
|
import { AnthropicCacheControlDirective$outboundSchema, } from "./anthropiccachecontroldirective.js";
|
|
10
11
|
import { ApplyPatchServerTool$outboundSchema, } from "./applypatchservertool.js";
|
|
11
12
|
import { ApplyPatchServerToolOpenRouter$outboundSchema, } from "./applypatchservertoolopenrouter.js";
|
|
@@ -76,6 +77,7 @@ export const ResponsesRequestServiceTier = {
|
|
|
76
77
|
};
|
|
77
78
|
/** @internal */
|
|
78
79
|
export const ResponsesRequestPlugin$outboundSchema = z.union([
|
|
80
|
+
AlignmentPlugin$outboundSchema,
|
|
79
81
|
AutoBetaRouterPlugin$outboundSchema,
|
|
80
82
|
AutoRouterPlugin$outboundSchema,
|
|
81
83
|
ContextCompressionPlugin$outboundSchema,
|
|
@@ -179,6 +181,7 @@ export const ResponsesRequest$outboundSchema = z.object({
|
|
|
179
181
|
models: z.array(z.string()).optional(),
|
|
180
182
|
parallelToolCalls: z.nullable(z.boolean()).optional(),
|
|
181
183
|
plugins: z.array(z.union([
|
|
184
|
+
AlignmentPlugin$outboundSchema,
|
|
182
185
|
AutoBetaRouterPlugin$outboundSchema,
|
|
183
186
|
AutoRouterPlugin$outboundSchema,
|
|
184
187
|
ContextCompressionPlugin$outboundSchema,
|
package/jsr.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openrouter/sdk",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.10",
|
|
4
4
|
"author": "OpenRouter",
|
|
5
5
|
"description": "The OpenRouter TypeScript SDK is a type-safe toolkit for building AI applications with access to 400+ language models through a unified API.",
|
|
6
6
|
"keywords": [
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"license": "Apache-2.0",
|
|
22
22
|
"packageManager": "pnpm@10.22.0",
|
|
23
23
|
"publishConfig": {
|
|
24
|
-
"
|
|
25
|
-
"
|
|
24
|
+
"provenance": true,
|
|
25
|
+
"access": "public"
|
|
26
26
|
},
|
|
27
27
|
"type": "module",
|
|
28
28
|
"main": "./esm/index.js",
|
|
@@ -73,15 +73,15 @@
|
|
|
73
73
|
"lint": "eslint --cache --max-warnings=0 src",
|
|
74
74
|
"build": "tsc && node scripts/unbarrel-imports.js",
|
|
75
75
|
"prepublishOnly": "npm run build",
|
|
76
|
-
"
|
|
77
|
-
"test:e2e": "vitest --run --project e2e",
|
|
78
|
-
"test:watch": "vitest --watch --project unit",
|
|
76
|
+
"typecheck": "tsc --noEmit",
|
|
79
77
|
"typecheck:transit": "exit 0",
|
|
80
78
|
"postinstall": "node scripts/check-types.js || true",
|
|
81
|
-
"
|
|
82
|
-
"typecheck": "tsc --noEmit",
|
|
79
|
+
"prepare": "npm run build",
|
|
83
80
|
"compile": "tsc && node scripts/unbarrel-imports.js",
|
|
84
|
-
"
|
|
81
|
+
"test": "vitest --run --project unit",
|
|
82
|
+
"test:e2e": "vitest --run --project e2e",
|
|
83
|
+
"test:transit": "exit 0",
|
|
84
|
+
"test:watch": "vitest --watch --project unit"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {
|
|
87
87
|
|