@openrouter/sdk 0.1.9 → 0.1.11
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 +3 -3
- package/esm/lib/config.js +3 -3
- package/esm/models/chatcompletionfinishreason.js +2 -7
- package/esm/models/chatgenerationparams.d.ts +1 -1
- package/esm/models/chatgenerationparams.js +3 -4
- package/esm/models/chatmessagecontentitemaudio.d.ts +1 -1
- package/esm/models/chatmessagecontentitemaudio.js +3 -10
- package/esm/models/chatmessagecontentitemimage.d.ts +1 -1
- package/esm/models/chatmessagecontentitemimage.js +3 -10
- package/esm/models/completionchoice.js +2 -6
- package/esm/models/createchargerequest.d.ts +1 -1
- package/esm/models/createchargerequest.js +3 -4
- package/esm/models/endpointstatus.js +2 -7
- package/esm/models/imagegenerationstatus.d.ts +1 -1
- package/esm/models/imagegenerationstatus.js +3 -11
- package/esm/models/inputmodality.js +2 -7
- package/esm/models/instructtype.js +2 -7
- package/esm/models/listendpointsresponse.js +3 -6
- package/esm/models/modelarchitecture.js +2 -6
- package/esm/models/modelgroup.js +2 -7
- package/esm/models/openairesponsesincludable.d.ts +1 -1
- package/esm/models/openairesponsesincludable.js +2 -5
- package/esm/models/openairesponsesincompletedetails.js +3 -6
- package/esm/models/openairesponsesinputunion.d.ts +5 -5
- package/esm/models/openairesponsesinputunion.js +5 -5
- package/esm/models/openairesponsesreasoningeffort.d.ts +1 -1
- package/esm/models/openairesponsesreasoningeffort.js +3 -11
- package/esm/models/openairesponsesresponsestatus.js +2 -7
- package/esm/models/openairesponsesservicetier.js +2 -7
- package/esm/models/openairesponsestruncation.js +2 -7
- package/esm/models/openresponsesfunctioncalloutput.d.ts +4 -4
- package/esm/models/openresponsesfunctioncalloutput.js +2 -2
- package/esm/models/openresponsesfunctiontoolcall.d.ts +2 -2
- package/esm/models/openresponsesfunctiontoolcall.js +1 -1
- package/esm/models/openresponsesinput.d.ts +4 -4
- package/esm/models/openresponsesinput.js +4 -4
- package/esm/models/openresponsesreasoning.d.ts +1 -1
- package/esm/models/openresponsesreasoning.js +2 -4
- package/esm/models/openresponsesrequest.d.ts +6 -6
- package/esm/models/openresponsesrequest.js +10 -27
- package/esm/models/openresponsesresponsetext.d.ts +1 -1
- package/esm/models/openresponsesresponsetext.js +2 -4
- package/esm/models/operations/createauthkeyscode.d.ts +1 -1
- package/esm/models/operations/createauthkeyscode.js +2 -4
- package/esm/models/operations/createembeddings.d.ts +2 -2
- package/esm/models/operations/createembeddings.js +4 -8
- package/esm/models/operations/createkeys.d.ts +2 -2
- package/esm/models/operations/createkeys.js +2 -4
- package/esm/models/operations/exchangeauthcodeforapikey.d.ts +1 -1
- package/esm/models/operations/exchangeauthcodeforapikey.js +3 -4
- package/esm/models/operations/getcurrentkey.d.ts +4 -0
- package/esm/models/operations/getcurrentkey.js +2 -0
- package/esm/models/operations/getgeneration.js +3 -6
- package/esm/models/operations/getparameters.d.ts +1 -1
- package/esm/models/operations/getparameters.js +3 -10
- package/esm/models/operations/updatekeys.d.ts +1 -1
- package/esm/models/operations/updatekeys.js +2 -4
- package/esm/models/outputmodality.js +2 -7
- package/esm/models/parameter.js +3 -7
- package/esm/models/providername.d.ts +1 -1
- package/esm/models/providername.js +3 -11
- package/esm/models/publicendpoint.js +2 -6
- package/esm/models/quantization.d.ts +1 -1
- package/esm/models/quantization.js +2 -5
- package/esm/models/reasoningsummaryverbosity.d.ts +1 -1
- package/esm/models/reasoningsummaryverbosity.js +3 -11
- package/esm/models/responseinputaudio.d.ts +1 -1
- package/esm/models/responseinputaudio.js +3 -10
- package/esm/models/responseinputimage.d.ts +1 -1
- package/esm/models/responseinputimage.js +3 -10
- package/esm/models/responseserrorfield.js +3 -6
- package/esm/models/responsesoutputitem.d.ts +1 -1
- package/esm/models/responsesoutputitem.js +1 -1
- package/esm/models/responsesoutputitemreasoning.d.ts +2 -2
- package/esm/models/responsesoutputitemreasoning.js +2 -2
- package/esm/models/responsessearchcontextsize.d.ts +1 -1
- package/esm/models/responsessearchcontextsize.js +3 -11
- package/esm/models/responsetextconfig.js +2 -6
- package/esm/models/toolcallstatus.d.ts +1 -1
- package/esm/models/toolcallstatus.js +3 -11
- package/esm/models/websearchstatus.d.ts +1 -1
- package/esm/models/websearchstatus.js +3 -11
- package/esm/types/enums.d.ts +10 -6
- package/esm/types/enums.js +38 -1
- package/esm/types/index.d.ts +0 -1
- package/esm/types/index.js +0 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
|
-
import * as
|
|
5
|
-
import { catchUnrecognizedEnum, } from "../types/enums.js";
|
|
4
|
+
import * as openEnums from "../types/enums.js";
|
|
6
5
|
export const ProviderName = {
|
|
7
6
|
AnyScale: "AnyScale",
|
|
8
7
|
CentML: "Cent-ML",
|
|
@@ -92,14 +91,7 @@ export const ProviderName = {
|
|
|
92
91
|
FakeProvider: "FakeProvider",
|
|
93
92
|
};
|
|
94
93
|
/** @internal */
|
|
95
|
-
export const ProviderName$inboundSchema =
|
|
96
|
-
.union([
|
|
97
|
-
z.enum(ProviderName),
|
|
98
|
-
z.string().transform(catchUnrecognizedEnum),
|
|
99
|
-
]);
|
|
94
|
+
export const ProviderName$inboundSchema = openEnums.inboundSchema(ProviderName);
|
|
100
95
|
/** @internal */
|
|
101
|
-
export const ProviderName$outboundSchema =
|
|
102
|
-
z.enum(ProviderName),
|
|
103
|
-
z.string().and(z.custom()),
|
|
104
|
-
]);
|
|
96
|
+
export const ProviderName$outboundSchema = openEnums.outboundSchema(ProviderName);
|
|
105
97
|
//# sourceMappingURL=providername.js.map
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import * as z from "zod/v4";
|
|
5
5
|
import { remap as remap$ } from "../lib/primitives.js";
|
|
6
6
|
import { safeParse } from "../lib/schemas.js";
|
|
7
|
-
import
|
|
7
|
+
import * as openEnums from "../types/enums.js";
|
|
8
8
|
import { EndpointStatus$inboundSchema, } from "./endpointstatus.js";
|
|
9
9
|
import { Parameter$inboundSchema } from "./parameter.js";
|
|
10
10
|
import { ProviderName$inboundSchema } from "./providername.js";
|
|
@@ -47,11 +47,7 @@ export function pricingFromJSON(jsonString) {
|
|
|
47
47
|
return safeParse(jsonString, (x) => Pricing$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Pricing' from JSON`);
|
|
48
48
|
}
|
|
49
49
|
/** @internal */
|
|
50
|
-
export const PublicEndpointQuantization$inboundSchema =
|
|
51
|
-
.union([
|
|
52
|
-
z.enum(PublicEndpointQuantization),
|
|
53
|
-
z.string().transform(catchUnrecognizedEnum),
|
|
54
|
-
]);
|
|
50
|
+
export const PublicEndpointQuantization$inboundSchema = openEnums.inboundSchema(PublicEndpointQuantization);
|
|
55
51
|
/** @internal */
|
|
56
52
|
export const PublicEndpoint$inboundSchema = z.object({
|
|
57
53
|
name: z.string(),
|
|
@@ -13,5 +13,5 @@ export declare const Quantization: {
|
|
|
13
13
|
};
|
|
14
14
|
export type Quantization = OpenEnum<typeof Quantization>;
|
|
15
15
|
/** @internal */
|
|
16
|
-
export declare const Quantization$outboundSchema: z.ZodType<
|
|
16
|
+
export declare const Quantization$outboundSchema: z.ZodType<string, Quantization>;
|
|
17
17
|
//# sourceMappingURL=quantization.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
|
-
import * as
|
|
4
|
+
import * as openEnums from "../types/enums.js";
|
|
5
5
|
export const Quantization = {
|
|
6
6
|
Int4: "int4",
|
|
7
7
|
Int8: "int8",
|
|
@@ -14,8 +14,5 @@ export const Quantization = {
|
|
|
14
14
|
Unknown: "unknown",
|
|
15
15
|
};
|
|
16
16
|
/** @internal */
|
|
17
|
-
export const Quantization$outboundSchema =
|
|
18
|
-
z.enum(Quantization),
|
|
19
|
-
z.string().and(z.custom()),
|
|
20
|
-
]);
|
|
17
|
+
export const Quantization$outboundSchema = openEnums.outboundSchema(Quantization);
|
|
21
18
|
//# sourceMappingURL=quantization.js.map
|
|
@@ -9,5 +9,5 @@ export type ReasoningSummaryVerbosity = OpenEnum<typeof ReasoningSummaryVerbosit
|
|
|
9
9
|
/** @internal */
|
|
10
10
|
export declare const ReasoningSummaryVerbosity$inboundSchema: z.ZodType<ReasoningSummaryVerbosity, unknown>;
|
|
11
11
|
/** @internal */
|
|
12
|
-
export declare const ReasoningSummaryVerbosity$outboundSchema: z.ZodType<
|
|
12
|
+
export declare const ReasoningSummaryVerbosity$outboundSchema: z.ZodType<string, ReasoningSummaryVerbosity>;
|
|
13
13
|
//# sourceMappingURL=reasoningsummaryverbosity.d.ts.map
|
|
@@ -1,22 +1,14 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
|
-
import * as
|
|
5
|
-
import { catchUnrecognizedEnum, } from "../types/enums.js";
|
|
4
|
+
import * as openEnums from "../types/enums.js";
|
|
6
5
|
export const ReasoningSummaryVerbosity = {
|
|
7
6
|
Auto: "auto",
|
|
8
7
|
Concise: "concise",
|
|
9
8
|
Detailed: "detailed",
|
|
10
9
|
};
|
|
11
10
|
/** @internal */
|
|
12
|
-
export const ReasoningSummaryVerbosity$inboundSchema =
|
|
13
|
-
.union([
|
|
14
|
-
z.enum(ReasoningSummaryVerbosity),
|
|
15
|
-
z.string().transform(catchUnrecognizedEnum),
|
|
16
|
-
]);
|
|
11
|
+
export const ReasoningSummaryVerbosity$inboundSchema = openEnums.inboundSchema(ReasoningSummaryVerbosity);
|
|
17
12
|
/** @internal */
|
|
18
|
-
export const ReasoningSummaryVerbosity$outboundSchema =
|
|
19
|
-
z.enum(ReasoningSummaryVerbosity),
|
|
20
|
-
z.string().and(z.custom()),
|
|
21
|
-
]);
|
|
13
|
+
export const ReasoningSummaryVerbosity$outboundSchema = openEnums.outboundSchema(ReasoningSummaryVerbosity);
|
|
22
14
|
//# sourceMappingURL=reasoningsummaryverbosity.js.map
|
|
@@ -29,7 +29,7 @@ export declare const ResponseInputAudioType$outboundSchema: z.ZodEnum<typeof Res
|
|
|
29
29
|
/** @internal */
|
|
30
30
|
export declare const ResponseInputAudioFormat$inboundSchema: z.ZodType<ResponseInputAudioFormat, unknown>;
|
|
31
31
|
/** @internal */
|
|
32
|
-
export declare const ResponseInputAudioFormat$outboundSchema: z.ZodType<
|
|
32
|
+
export declare const ResponseInputAudioFormat$outboundSchema: z.ZodType<string, ResponseInputAudioFormat>;
|
|
33
33
|
/** @internal */
|
|
34
34
|
export declare const ResponseInputAudioInputAudio$inboundSchema: z.ZodType<ResponseInputAudioInputAudio, unknown>;
|
|
35
35
|
/** @internal */
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import * as z from "zod/v4";
|
|
5
5
|
import { remap as remap$ } from "../lib/primitives.js";
|
|
6
6
|
import { safeParse } from "../lib/schemas.js";
|
|
7
|
-
import
|
|
7
|
+
import * as openEnums from "../types/enums.js";
|
|
8
8
|
export const ResponseInputAudioType = {
|
|
9
9
|
InputAudio: "input_audio",
|
|
10
10
|
};
|
|
@@ -17,16 +17,9 @@ export const ResponseInputAudioType$inboundSchema = z.enum(ResponseInputAudioTyp
|
|
|
17
17
|
/** @internal */
|
|
18
18
|
export const ResponseInputAudioType$outboundSchema = ResponseInputAudioType$inboundSchema;
|
|
19
19
|
/** @internal */
|
|
20
|
-
export const ResponseInputAudioFormat$inboundSchema =
|
|
21
|
-
.union([
|
|
22
|
-
z.enum(ResponseInputAudioFormat),
|
|
23
|
-
z.string().transform(catchUnrecognizedEnum),
|
|
24
|
-
]);
|
|
20
|
+
export const ResponseInputAudioFormat$inboundSchema = openEnums.inboundSchema(ResponseInputAudioFormat);
|
|
25
21
|
/** @internal */
|
|
26
|
-
export const ResponseInputAudioFormat$outboundSchema =
|
|
27
|
-
z.enum(ResponseInputAudioFormat),
|
|
28
|
-
z.string().and(z.custom()),
|
|
29
|
-
]);
|
|
22
|
+
export const ResponseInputAudioFormat$outboundSchema = openEnums.outboundSchema(ResponseInputAudioFormat);
|
|
30
23
|
/** @internal */
|
|
31
24
|
export const ResponseInputAudioInputAudio$inboundSchema = z.object({
|
|
32
25
|
data: z.string(),
|
|
@@ -27,7 +27,7 @@ export declare const ResponseInputImageType$outboundSchema: z.ZodEnum<typeof Res
|
|
|
27
27
|
/** @internal */
|
|
28
28
|
export declare const ResponseInputImageDetail$inboundSchema: z.ZodType<ResponseInputImageDetail, unknown>;
|
|
29
29
|
/** @internal */
|
|
30
|
-
export declare const ResponseInputImageDetail$outboundSchema: z.ZodType<
|
|
30
|
+
export declare const ResponseInputImageDetail$outboundSchema: z.ZodType<string, ResponseInputImageDetail>;
|
|
31
31
|
/** @internal */
|
|
32
32
|
export declare const ResponseInputImage$inboundSchema: z.ZodType<ResponseInputImage, unknown>;
|
|
33
33
|
/** @internal */
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import * as z from "zod/v4";
|
|
5
5
|
import { remap as remap$ } from "../lib/primitives.js";
|
|
6
6
|
import { safeParse } from "../lib/schemas.js";
|
|
7
|
-
import
|
|
7
|
+
import * as openEnums from "../types/enums.js";
|
|
8
8
|
export const ResponseInputImageType = {
|
|
9
9
|
InputImage: "input_image",
|
|
10
10
|
};
|
|
@@ -18,16 +18,9 @@ export const ResponseInputImageType$inboundSchema = z.enum(ResponseInputImageTyp
|
|
|
18
18
|
/** @internal */
|
|
19
19
|
export const ResponseInputImageType$outboundSchema = ResponseInputImageType$inboundSchema;
|
|
20
20
|
/** @internal */
|
|
21
|
-
export const ResponseInputImageDetail$inboundSchema =
|
|
22
|
-
.union([
|
|
23
|
-
z.enum(ResponseInputImageDetail),
|
|
24
|
-
z.string().transform(catchUnrecognizedEnum),
|
|
25
|
-
]);
|
|
21
|
+
export const ResponseInputImageDetail$inboundSchema = openEnums.inboundSchema(ResponseInputImageDetail);
|
|
26
22
|
/** @internal */
|
|
27
|
-
export const ResponseInputImageDetail$outboundSchema =
|
|
28
|
-
z.enum(ResponseInputImageDetail),
|
|
29
|
-
z.string().and(z.custom()),
|
|
30
|
-
]);
|
|
23
|
+
export const ResponseInputImageDetail$outboundSchema = openEnums.outboundSchema(ResponseInputImageDetail);
|
|
31
24
|
/** @internal */
|
|
32
25
|
export const ResponseInputImage$inboundSchema = z.object({
|
|
33
26
|
type: ResponseInputImageType$inboundSchema,
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import * as z from "zod/v4";
|
|
5
5
|
import { safeParse } from "../lib/schemas.js";
|
|
6
|
-
import
|
|
6
|
+
import * as openEnums from "../types/enums.js";
|
|
7
7
|
export const CodeEnum = {
|
|
8
8
|
ServerError: "server_error",
|
|
9
9
|
RateLimitExceeded: "rate_limit_exceeded",
|
|
@@ -25,11 +25,8 @@ export const CodeEnum = {
|
|
|
25
25
|
ImageFileNotFound: "image_file_not_found",
|
|
26
26
|
};
|
|
27
27
|
/** @internal */
|
|
28
|
-
export const CodeEnum$inboundSchema =
|
|
29
|
-
.
|
|
30
|
-
z.enum(CodeEnum),
|
|
31
|
-
z.string().transform(catchUnrecognizedEnum),
|
|
32
|
-
]);
|
|
28
|
+
export const CodeEnum$inboundSchema = openEnums
|
|
29
|
+
.inboundSchema(CodeEnum);
|
|
33
30
|
/** @internal */
|
|
34
31
|
export const ResponsesErrorField$inboundSchema = z.object({
|
|
35
32
|
code: CodeEnum$inboundSchema,
|
|
@@ -10,7 +10,7 @@ import { ResponsesWebSearchCallOutput } from "./responseswebsearchcalloutput.js"
|
|
|
10
10
|
/**
|
|
11
11
|
* An output item from the response
|
|
12
12
|
*/
|
|
13
|
-
export type ResponsesOutputItem = ResponsesOutputMessage | ResponsesOutputItemFunctionCall | ResponsesOutputItemFileSearchCall |
|
|
13
|
+
export type ResponsesOutputItem = ResponsesOutputMessage | ResponsesOutputItemFunctionCall | ResponsesOutputItemFileSearchCall | ResponsesOutputItemReasoning | ResponsesWebSearchCallOutput | ResponsesImageGenerationCall;
|
|
14
14
|
/** @internal */
|
|
15
15
|
export declare const ResponsesOutputItem$inboundSchema: z.ZodType<ResponsesOutputItem, unknown>;
|
|
16
16
|
export declare function responsesOutputItemFromJSON(jsonString: string): SafeParseResult<ResponsesOutputItem, SDKValidationError>;
|
|
@@ -14,9 +14,9 @@ export const ResponsesOutputItem$inboundSchema = z.union([
|
|
|
14
14
|
ResponsesOutputMessage$inboundSchema,
|
|
15
15
|
ResponsesOutputItemFunctionCall$inboundSchema,
|
|
16
16
|
ResponsesOutputItemFileSearchCall$inboundSchema,
|
|
17
|
+
ResponsesOutputItemReasoning$inboundSchema,
|
|
17
18
|
ResponsesWebSearchCallOutput$inboundSchema,
|
|
18
19
|
ResponsesImageGenerationCall$inboundSchema,
|
|
19
|
-
ResponsesOutputItemReasoning$inboundSchema,
|
|
20
20
|
]);
|
|
21
21
|
export function responsesOutputItemFromJSON(jsonString) {
|
|
22
22
|
return safeParse(jsonString, (x) => ResponsesOutputItem$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ResponsesOutputItem' from JSON`);
|
|
@@ -26,7 +26,7 @@ export type ResponsesOutputItemReasoningStatusUnion = ResponsesOutputItemReasoni
|
|
|
26
26
|
*/
|
|
27
27
|
export type ResponsesOutputItemReasoning = {
|
|
28
28
|
type: ResponsesOutputItemReasoningType;
|
|
29
|
-
id
|
|
29
|
+
id: string;
|
|
30
30
|
content?: Array<ReasoningTextContent> | undefined;
|
|
31
31
|
summary: Array<ReasoningSummaryText>;
|
|
32
32
|
encryptedContent?: string | null | undefined;
|
|
@@ -61,7 +61,7 @@ export declare const ResponsesOutputItemReasoning$inboundSchema: z.ZodType<Respo
|
|
|
61
61
|
/** @internal */
|
|
62
62
|
export type ResponsesOutputItemReasoning$Outbound = {
|
|
63
63
|
type: string;
|
|
64
|
-
id
|
|
64
|
+
id: string;
|
|
65
65
|
content?: Array<ReasoningTextContent$Outbound> | undefined;
|
|
66
66
|
summary: Array<ReasoningSummaryText$Outbound>;
|
|
67
67
|
encrypted_content?: string | null | undefined;
|
|
@@ -55,7 +55,7 @@ export function responsesOutputItemReasoningStatusUnionFromJSON(jsonString) {
|
|
|
55
55
|
/** @internal */
|
|
56
56
|
export const ResponsesOutputItemReasoning$inboundSchema = z.object({
|
|
57
57
|
type: ResponsesOutputItemReasoningType$inboundSchema,
|
|
58
|
-
id: z.string()
|
|
58
|
+
id: z.string(),
|
|
59
59
|
content: z.array(ReasoningTextContent$inboundSchema).optional(),
|
|
60
60
|
summary: z.array(ReasoningSummaryText$inboundSchema),
|
|
61
61
|
encrypted_content: z.nullable(z.string()).optional(),
|
|
@@ -72,7 +72,7 @@ export const ResponsesOutputItemReasoning$inboundSchema = z.object({
|
|
|
72
72
|
/** @internal */
|
|
73
73
|
export const ResponsesOutputItemReasoning$outboundSchema = z.object({
|
|
74
74
|
type: ResponsesOutputItemReasoningType$outboundSchema,
|
|
75
|
-
id: z.string()
|
|
75
|
+
id: z.string(),
|
|
76
76
|
content: z.array(ReasoningTextContent$outboundSchema).optional(),
|
|
77
77
|
summary: z.array(ReasoningSummaryText$outboundSchema),
|
|
78
78
|
encryptedContent: z.nullable(z.string()).optional(),
|
|
@@ -15,5 +15,5 @@ export type ResponsesSearchContextSize = OpenEnum<typeof ResponsesSearchContextS
|
|
|
15
15
|
/** @internal */
|
|
16
16
|
export declare const ResponsesSearchContextSize$inboundSchema: z.ZodType<ResponsesSearchContextSize, unknown>;
|
|
17
17
|
/** @internal */
|
|
18
|
-
export declare const ResponsesSearchContextSize$outboundSchema: z.ZodType<
|
|
18
|
+
export declare const ResponsesSearchContextSize$outboundSchema: z.ZodType<string, ResponsesSearchContextSize>;
|
|
19
19
|
//# sourceMappingURL=responsessearchcontextsize.d.ts.map
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
|
-
import * as
|
|
5
|
-
import { catchUnrecognizedEnum, } from "../types/enums.js";
|
|
4
|
+
import * as openEnums from "../types/enums.js";
|
|
6
5
|
/**
|
|
7
6
|
* Size of the search context for web search tools
|
|
8
7
|
*/
|
|
@@ -12,14 +11,7 @@ export const ResponsesSearchContextSize = {
|
|
|
12
11
|
High: "high",
|
|
13
12
|
};
|
|
14
13
|
/** @internal */
|
|
15
|
-
export const ResponsesSearchContextSize$inboundSchema =
|
|
16
|
-
.union([
|
|
17
|
-
z.enum(ResponsesSearchContextSize),
|
|
18
|
-
z.string().transform(catchUnrecognizedEnum),
|
|
19
|
-
]);
|
|
14
|
+
export const ResponsesSearchContextSize$inboundSchema = openEnums.inboundSchema(ResponsesSearchContextSize);
|
|
20
15
|
/** @internal */
|
|
21
|
-
export const ResponsesSearchContextSize$outboundSchema =
|
|
22
|
-
z.enum(ResponsesSearchContextSize),
|
|
23
|
-
z.string().and(z.custom()),
|
|
24
|
-
]);
|
|
16
|
+
export const ResponsesSearchContextSize$outboundSchema = openEnums.outboundSchema(ResponsesSearchContextSize);
|
|
25
17
|
//# sourceMappingURL=responsessearchcontextsize.js.map
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import * as z from "zod/v4";
|
|
5
5
|
import { safeParse } from "../lib/schemas.js";
|
|
6
|
-
import
|
|
6
|
+
import * as openEnums from "../types/enums.js";
|
|
7
7
|
import { ResponseFormatTextConfig$inboundSchema, } from "./responseformattextconfig.js";
|
|
8
8
|
export const ResponseTextConfigVerbosity = {
|
|
9
9
|
High: "high",
|
|
@@ -11,11 +11,7 @@ export const ResponseTextConfigVerbosity = {
|
|
|
11
11
|
Medium: "medium",
|
|
12
12
|
};
|
|
13
13
|
/** @internal */
|
|
14
|
-
export const ResponseTextConfigVerbosity$inboundSchema =
|
|
15
|
-
.union([
|
|
16
|
-
z.enum(ResponseTextConfigVerbosity),
|
|
17
|
-
z.string().transform(catchUnrecognizedEnum),
|
|
18
|
-
]);
|
|
14
|
+
export const ResponseTextConfigVerbosity$inboundSchema = openEnums.inboundSchema(ResponseTextConfigVerbosity);
|
|
19
15
|
/** @internal */
|
|
20
16
|
export const ResponseTextConfig$inboundSchema = z.object({
|
|
21
17
|
format: ResponseFormatTextConfig$inboundSchema.optional(),
|
|
@@ -9,5 +9,5 @@ export type ToolCallStatus = OpenEnum<typeof ToolCallStatus>;
|
|
|
9
9
|
/** @internal */
|
|
10
10
|
export declare const ToolCallStatus$inboundSchema: z.ZodType<ToolCallStatus, unknown>;
|
|
11
11
|
/** @internal */
|
|
12
|
-
export declare const ToolCallStatus$outboundSchema: z.ZodType<
|
|
12
|
+
export declare const ToolCallStatus$outboundSchema: z.ZodType<string, ToolCallStatus>;
|
|
13
13
|
//# sourceMappingURL=toolcallstatus.d.ts.map
|
|
@@ -1,22 +1,14 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
|
-
import * as
|
|
5
|
-
import { catchUnrecognizedEnum, } from "../types/enums.js";
|
|
4
|
+
import * as openEnums from "../types/enums.js";
|
|
6
5
|
export const ToolCallStatus = {
|
|
7
6
|
InProgress: "in_progress",
|
|
8
7
|
Completed: "completed",
|
|
9
8
|
Incomplete: "incomplete",
|
|
10
9
|
};
|
|
11
10
|
/** @internal */
|
|
12
|
-
export const ToolCallStatus$inboundSchema =
|
|
13
|
-
.union([
|
|
14
|
-
z.enum(ToolCallStatus),
|
|
15
|
-
z.string().transform(catchUnrecognizedEnum),
|
|
16
|
-
]);
|
|
11
|
+
export const ToolCallStatus$inboundSchema = openEnums.inboundSchema(ToolCallStatus);
|
|
17
12
|
/** @internal */
|
|
18
|
-
export const ToolCallStatus$outboundSchema =
|
|
19
|
-
z.enum(ToolCallStatus),
|
|
20
|
-
z.string().and(z.custom()),
|
|
21
|
-
]);
|
|
13
|
+
export const ToolCallStatus$outboundSchema = openEnums.outboundSchema(ToolCallStatus);
|
|
22
14
|
//# sourceMappingURL=toolcallstatus.js.map
|
|
@@ -10,5 +10,5 @@ export type WebSearchStatus = OpenEnum<typeof WebSearchStatus>;
|
|
|
10
10
|
/** @internal */
|
|
11
11
|
export declare const WebSearchStatus$inboundSchema: z.ZodType<WebSearchStatus, unknown>;
|
|
12
12
|
/** @internal */
|
|
13
|
-
export declare const WebSearchStatus$outboundSchema: z.ZodType<
|
|
13
|
+
export declare const WebSearchStatus$outboundSchema: z.ZodType<string, WebSearchStatus>;
|
|
14
14
|
//# sourceMappingURL=websearchstatus.d.ts.map
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
|
-
import * as
|
|
5
|
-
import { catchUnrecognizedEnum, } from "../types/enums.js";
|
|
4
|
+
import * as openEnums from "../types/enums.js";
|
|
6
5
|
export const WebSearchStatus = {
|
|
7
6
|
Completed: "completed",
|
|
8
7
|
Searching: "searching",
|
|
@@ -10,14 +9,7 @@ export const WebSearchStatus = {
|
|
|
10
9
|
Failed: "failed",
|
|
11
10
|
};
|
|
12
11
|
/** @internal */
|
|
13
|
-
export const WebSearchStatus$inboundSchema =
|
|
14
|
-
.union([
|
|
15
|
-
z.enum(WebSearchStatus),
|
|
16
|
-
z.string().transform(catchUnrecognizedEnum),
|
|
17
|
-
]);
|
|
12
|
+
export const WebSearchStatus$inboundSchema = openEnums.inboundSchema(WebSearchStatus);
|
|
18
13
|
/** @internal */
|
|
19
|
-
export const WebSearchStatus$outboundSchema =
|
|
20
|
-
z.enum(WebSearchStatus),
|
|
21
|
-
z.string().and(z.custom()),
|
|
22
|
-
]);
|
|
14
|
+
export const WebSearchStatus$outboundSchema = openEnums.outboundSchema(WebSearchStatus);
|
|
23
15
|
//# sourceMappingURL=websearchstatus.js.map
|
package/esm/types/enums.d.ts
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
1
2
|
declare const __brand: unique symbol;
|
|
2
3
|
export type Unrecognized<T> = T & {
|
|
3
4
|
[__brand]: "unrecognized";
|
|
4
5
|
};
|
|
5
|
-
export
|
|
6
|
-
type
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export
|
|
6
|
+
export type ClosedEnum<T extends Readonly<Record<string, string | number>>> = T[keyof T];
|
|
7
|
+
export type OpenEnum<T extends Readonly<Record<string, string | number>>> = T[keyof T] | Unrecognized<T[keyof T] extends number ? number : string>;
|
|
8
|
+
export declare function unrecognizedCounter(): {
|
|
9
|
+
count: () => number;
|
|
10
|
+
};
|
|
11
|
+
export declare function inboundSchema<T extends Record<string, string>>(enumObj: T): z.ZodType<OpenEnum<T>, unknown>;
|
|
12
|
+
export declare function inboundSchemaInt<T extends Record<string, number | string>>(enumObj: T): z.ZodType<OpenEnum<T>, unknown>;
|
|
13
|
+
export declare function outboundSchema<T extends Record<string, string>>(_: T): z.ZodType<string, OpenEnum<T>>;
|
|
14
|
+
export declare function outboundSchemaInt<T extends Record<string, number | string>>(_: T): z.ZodType<number, OpenEnum<T>>;
|
|
11
15
|
export {};
|
|
12
16
|
//# sourceMappingURL=enums.d.ts.map
|
package/esm/types/enums.js
CHANGED
|
@@ -1,7 +1,44 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
|
-
|
|
4
|
+
import * as z from "zod/v4";
|
|
5
|
+
function unrecognized(value) {
|
|
6
|
+
unrecognizedCount++;
|
|
5
7
|
return value;
|
|
6
8
|
}
|
|
9
|
+
let unrecognizedCount = 0;
|
|
10
|
+
let refCount = 0;
|
|
11
|
+
export function unrecognizedCounter() {
|
|
12
|
+
refCount++;
|
|
13
|
+
const start = unrecognizedCount;
|
|
14
|
+
return {
|
|
15
|
+
count: () => {
|
|
16
|
+
const count = unrecognizedCount - start;
|
|
17
|
+
if (--refCount === 0)
|
|
18
|
+
unrecognizedCount = 0;
|
|
19
|
+
return count;
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export function inboundSchema(enumObj) {
|
|
24
|
+
const options = Object.values(enumObj);
|
|
25
|
+
return z.union([
|
|
26
|
+
...options.map(x => z.literal(x)),
|
|
27
|
+
z.string().transform(x => unrecognized(x)),
|
|
28
|
+
]);
|
|
29
|
+
}
|
|
30
|
+
export function inboundSchemaInt(enumObj) {
|
|
31
|
+
// For numeric enums, Object.values returns both numbers and string keys
|
|
32
|
+
const options = Object.values(enumObj).filter(v => typeof v === "number");
|
|
33
|
+
return z.union([
|
|
34
|
+
...options.map(x => z.literal(x)),
|
|
35
|
+
z.int().transform(x => unrecognized(x)),
|
|
36
|
+
]);
|
|
37
|
+
}
|
|
38
|
+
export function outboundSchema(_) {
|
|
39
|
+
return z.string();
|
|
40
|
+
}
|
|
41
|
+
export function outboundSchemaInt(_) {
|
|
42
|
+
return z.int();
|
|
43
|
+
}
|
|
7
44
|
//# sourceMappingURL=enums.js.map
|
package/esm/types/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export { blobLikeSchema, isBlobLike } from "./blobs.js";
|
|
2
|
-
export { catchUnrecognizedEnum } from "./enums.js";
|
|
3
2
|
export type { ClosedEnum, OpenEnum, Unrecognized } from "./enums.js";
|
|
4
3
|
export type { Result } from "./fp.js";
|
|
5
4
|
export type { PageIterator, Paginator } from "./operations.js";
|
package/esm/types/index.js
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
4
|
export { blobLikeSchema, isBlobLike } from "./blobs.js";
|
|
5
|
-
export { catchUnrecognizedEnum } from "./enums.js";
|
|
6
5
|
export { createPageIterator } from "./operations.js";
|
|
7
6
|
export { RFCDate } from "./rfcdate.js";
|
|
8
7
|
//# sourceMappingURL=index.js.map
|
package/jsr.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openrouter/sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.11",
|
|
4
4
|
"author": "OpenRouter",
|
|
5
5
|
"description": "The OpenRouter TypeScript SDK is a type-safe toolkit for building AI applications with access to 300+ language models through a unified API.",
|
|
6
6
|
"keywords": [
|