@openrouter/sdk 0.12.11 → 0.12.13
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/index.d.ts +0 -1
- package/esm/models/index.js +0 -1
- package/esm/models/openresponsesresult.d.ts +2 -2
- package/esm/models/openresponsesresult.js +2 -2
- package/esm/models/textextendedconfig.d.ts +14 -5
- package/esm/models/textextendedconfig.js +20 -5
- package/jsr.json +1 -1
- package/package.json +6 -6
- package/esm/models/textconfig.d.ts +0 -27
- package/esm/models/textconfig.js +0 -25
package/esm/lib/config.d.ts
CHANGED
|
@@ -49,8 +49,8 @@ export declare function serverURLFromOptions(options: SDKOptions): URL | null;
|
|
|
49
49
|
export declare const SDK_METADATA: {
|
|
50
50
|
readonly language: "typescript";
|
|
51
51
|
readonly openapiDocVersion: "1.0.0";
|
|
52
|
-
readonly sdkVersion: "0.12.
|
|
52
|
+
readonly sdkVersion: "0.12.13";
|
|
53
53
|
readonly genVersion: "2.879.1";
|
|
54
|
-
readonly userAgent: "speakeasy-sdk/typescript 0.12.
|
|
54
|
+
readonly userAgent: "speakeasy-sdk/typescript 0.12.13 2.879.1 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.12.
|
|
29
|
+
sdkVersion: "0.12.13",
|
|
30
30
|
genVersion: "2.879.1",
|
|
31
|
-
userAgent: "speakeasy-sdk/typescript 0.12.
|
|
31
|
+
userAgent: "speakeasy-sdk/typescript 0.12.13 2.879.1 1.0.0 @openrouter/sdk",
|
|
32
32
|
};
|
|
33
33
|
//# sourceMappingURL=config.js.map
|
package/esm/models/index.d.ts
CHANGED
|
@@ -236,7 +236,6 @@ export * from "./streameventsresponseoutputitemadded.js";
|
|
|
236
236
|
export * from "./streameventsresponseoutputitemdone.js";
|
|
237
237
|
export * from "./streamlogprob.js";
|
|
238
238
|
export * from "./streamlogprobtoplogprob.js";
|
|
239
|
-
export * from "./textconfig.js";
|
|
240
239
|
export * from "./textdeltaevent.js";
|
|
241
240
|
export * from "./textdoneevent.js";
|
|
242
241
|
export * from "./textextendedconfig.js";
|
package/esm/models/index.js
CHANGED
|
@@ -240,7 +240,6 @@ export * from "./streameventsresponseoutputitemadded.js";
|
|
|
240
240
|
export * from "./streameventsresponseoutputitemdone.js";
|
|
241
241
|
export * from "./streamlogprob.js";
|
|
242
242
|
export * from "./streamlogprobtoplogprob.js";
|
|
243
|
-
export * from "./textconfig.js";
|
|
244
243
|
export * from "./textdeltaevent.js";
|
|
245
244
|
export * from "./textdoneevent.js";
|
|
246
245
|
export * from "./textextendedconfig.js";
|
|
@@ -23,7 +23,7 @@ import { PreviewWebSearchServerTool } from "./previewwebsearchservertool.js";
|
|
|
23
23
|
import { ResponsesErrorField } from "./responseserrorfield.js";
|
|
24
24
|
import { ShellServerTool } from "./shellservertool.js";
|
|
25
25
|
import { StoredPromptTemplate } from "./storedprompttemplate.js";
|
|
26
|
-
import {
|
|
26
|
+
import { TextExtendedConfig } from "./textextendedconfig.js";
|
|
27
27
|
import { Truncation } from "./truncation.js";
|
|
28
28
|
import { Usage } from "./usage.js";
|
|
29
29
|
import { WebSearchServerTool } from "./websearchservertool.js";
|
|
@@ -85,7 +85,7 @@ export type OpenResponsesResult = {
|
|
|
85
85
|
/**
|
|
86
86
|
* Text output configuration including format and verbosity
|
|
87
87
|
*/
|
|
88
|
-
text?:
|
|
88
|
+
text?: TextExtendedConfig | undefined;
|
|
89
89
|
toolChoice: OpenAIResponsesToolChoiceUnion;
|
|
90
90
|
tools: Array<OpenResponsesResultToolFunction | PreviewWebSearchServerTool | Preview20250311WebSearchServerTool | LegacyWebSearchServerTool | WebSearchServerTool | FileSearchServerTool | ComputerUseServerTool | CodeInterpreterServerTool | McpServerTool | ImageGenerationServerTool | CodexLocalShellTool | ShellServerTool | ApplyPatchServerTool | CustomTool | discriminatedUnionTypes.Unknown<"type">>;
|
|
91
91
|
topLogprobs?: number | null | undefined;
|
|
@@ -26,7 +26,7 @@ import { PreviewWebSearchServerTool$inboundSchema, } from "./previewwebsearchser
|
|
|
26
26
|
import { ResponsesErrorField$inboundSchema, } from "./responseserrorfield.js";
|
|
27
27
|
import { ShellServerTool$inboundSchema, } from "./shellservertool.js";
|
|
28
28
|
import { StoredPromptTemplate$inboundSchema, } from "./storedprompttemplate.js";
|
|
29
|
-
import {
|
|
29
|
+
import { TextExtendedConfig$inboundSchema, } from "./textextendedconfig.js";
|
|
30
30
|
import { Truncation$inboundSchema } from "./truncation.js";
|
|
31
31
|
import { Usage$inboundSchema } from "./usage.js";
|
|
32
32
|
import { WebSearchServerTool$inboundSchema, } from "./websearchservertool.js";
|
|
@@ -94,7 +94,7 @@ export const OpenResponsesResult$inboundSchema = z.object({
|
|
|
94
94
|
status: OpenAIResponsesResponseStatus$inboundSchema,
|
|
95
95
|
store: z.boolean().optional(),
|
|
96
96
|
temperature: z.nullable(z.number()),
|
|
97
|
-
text:
|
|
97
|
+
text: TextExtendedConfig$inboundSchema.optional(),
|
|
98
98
|
tool_choice: OpenAIResponsesToolChoiceUnion$inboundSchema,
|
|
99
99
|
tools: z.array(discriminatedUnion("type", {
|
|
100
100
|
function: z.lazy(() => OpenResponsesResultToolFunction$inboundSchema),
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import * as z from "zod/v4";
|
|
2
2
|
import { OpenEnum } from "../types/enums.js";
|
|
3
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
4
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
3
5
|
import { Formats, Formats$Outbound } from "./formats.js";
|
|
4
|
-
export declare const
|
|
5
|
-
readonly High: "high";
|
|
6
|
+
export declare const Verbosity: {
|
|
6
7
|
readonly Low: "low";
|
|
7
8
|
readonly Medium: "medium";
|
|
9
|
+
readonly High: "high";
|
|
10
|
+
readonly Xhigh: "xhigh";
|
|
11
|
+
readonly Max: "max";
|
|
8
12
|
};
|
|
9
|
-
export type
|
|
13
|
+
export type Verbosity = OpenEnum<typeof Verbosity>;
|
|
10
14
|
/**
|
|
11
15
|
* Text output configuration including format and verbosity
|
|
12
16
|
*/
|
|
@@ -15,10 +19,14 @@ export type TextExtendedConfig = {
|
|
|
15
19
|
* Text response format configuration
|
|
16
20
|
*/
|
|
17
21
|
format?: Formats | undefined;
|
|
18
|
-
verbosity?:
|
|
22
|
+
verbosity?: Verbosity | null | undefined;
|
|
19
23
|
};
|
|
20
24
|
/** @internal */
|
|
21
|
-
export declare const
|
|
25
|
+
export declare const Verbosity$inboundSchema: z.ZodType<Verbosity, unknown>;
|
|
26
|
+
/** @internal */
|
|
27
|
+
export declare const Verbosity$outboundSchema: z.ZodType<string, Verbosity>;
|
|
28
|
+
/** @internal */
|
|
29
|
+
export declare const TextExtendedConfig$inboundSchema: z.ZodType<TextExtendedConfig, unknown>;
|
|
22
30
|
/** @internal */
|
|
23
31
|
export type TextExtendedConfig$Outbound = {
|
|
24
32
|
format?: Formats$Outbound | undefined;
|
|
@@ -27,4 +35,5 @@ export type TextExtendedConfig$Outbound = {
|
|
|
27
35
|
/** @internal */
|
|
28
36
|
export declare const TextExtendedConfig$outboundSchema: z.ZodType<TextExtendedConfig$Outbound, TextExtendedConfig>;
|
|
29
37
|
export declare function textExtendedConfigToJSON(textExtendedConfig: TextExtendedConfig): string;
|
|
38
|
+
export declare function textExtendedConfigFromJSON(jsonString: string): SafeParseResult<TextExtendedConfig, SDKValidationError>;
|
|
30
39
|
//# sourceMappingURL=textextendedconfig.d.ts.map
|
|
@@ -3,21 +3,36 @@
|
|
|
3
3
|
* @generated-id: e264e7981200
|
|
4
4
|
*/
|
|
5
5
|
import * as z from "zod/v4";
|
|
6
|
+
import { safeParse } from "../lib/schemas.js";
|
|
6
7
|
import * as openEnums from "../types/enums.js";
|
|
7
|
-
import { Formats$outboundSchema, } from "./formats.js";
|
|
8
|
-
export const
|
|
9
|
-
High: "high",
|
|
8
|
+
import { Formats$inboundSchema, Formats$outboundSchema, } from "./formats.js";
|
|
9
|
+
export const Verbosity = {
|
|
10
10
|
Low: "low",
|
|
11
11
|
Medium: "medium",
|
|
12
|
+
High: "high",
|
|
13
|
+
Xhigh: "xhigh",
|
|
14
|
+
Max: "max",
|
|
12
15
|
};
|
|
13
16
|
/** @internal */
|
|
14
|
-
export const
|
|
17
|
+
export const Verbosity$inboundSchema = openEnums
|
|
18
|
+
.inboundSchema(Verbosity);
|
|
19
|
+
/** @internal */
|
|
20
|
+
export const Verbosity$outboundSchema = openEnums
|
|
21
|
+
.outboundSchema(Verbosity);
|
|
22
|
+
/** @internal */
|
|
23
|
+
export const TextExtendedConfig$inboundSchema = z.object({
|
|
24
|
+
format: Formats$inboundSchema.optional(),
|
|
25
|
+
verbosity: z.nullable(Verbosity$inboundSchema).optional(),
|
|
26
|
+
});
|
|
15
27
|
/** @internal */
|
|
16
28
|
export const TextExtendedConfig$outboundSchema = z.object({
|
|
17
29
|
format: Formats$outboundSchema.optional(),
|
|
18
|
-
verbosity: z.nullable(
|
|
30
|
+
verbosity: z.nullable(Verbosity$outboundSchema).optional(),
|
|
19
31
|
});
|
|
20
32
|
export function textExtendedConfigToJSON(textExtendedConfig) {
|
|
21
33
|
return JSON.stringify(TextExtendedConfig$outboundSchema.parse(textExtendedConfig));
|
|
22
34
|
}
|
|
35
|
+
export function textExtendedConfigFromJSON(jsonString) {
|
|
36
|
+
return safeParse(jsonString, (x) => TextExtendedConfig$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TextExtendedConfig' from JSON`);
|
|
37
|
+
}
|
|
23
38
|
//# sourceMappingURL=textextendedconfig.js.map
|
package/jsr.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openrouter/sdk",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.13",
|
|
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": [
|
|
@@ -69,15 +69,15 @@
|
|
|
69
69
|
"lint": "eslint --cache --max-warnings=0 src",
|
|
70
70
|
"build": "tsc",
|
|
71
71
|
"prepublishOnly": "npm run build",
|
|
72
|
-
"compile": "tsc",
|
|
73
72
|
"test": "vitest --run --project unit",
|
|
74
73
|
"test:e2e": "vitest --run --project e2e",
|
|
74
|
+
"test:transit": "exit 0",
|
|
75
|
+
"typecheck:transit": "exit 0",
|
|
76
|
+
"postinstall": "node scripts/check-types.js || true",
|
|
75
77
|
"test:watch": "vitest --watch --project unit",
|
|
76
78
|
"typecheck": "tsc --noEmit",
|
|
77
|
-
"
|
|
78
|
-
"prepare": "npm run build"
|
|
79
|
-
"test:transit": "exit 0",
|
|
80
|
-
"typecheck:transit": "exit 0"
|
|
79
|
+
"compile": "tsc",
|
|
80
|
+
"prepare": "npm run build"
|
|
81
81
|
},
|
|
82
82
|
"peerDependencies": {},
|
|
83
83
|
"devDependencies": {
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import * as z from "zod/v4";
|
|
2
|
-
import { OpenEnum } from "../types/enums.js";
|
|
3
|
-
import { Result as SafeParseResult } from "../types/fp.js";
|
|
4
|
-
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
|
-
import { Formats } from "./formats.js";
|
|
6
|
-
export declare const TextConfigVerbosity: {
|
|
7
|
-
readonly High: "high";
|
|
8
|
-
readonly Low: "low";
|
|
9
|
-
readonly Medium: "medium";
|
|
10
|
-
};
|
|
11
|
-
export type TextConfigVerbosity = OpenEnum<typeof TextConfigVerbosity>;
|
|
12
|
-
/**
|
|
13
|
-
* Text output configuration including format and verbosity
|
|
14
|
-
*/
|
|
15
|
-
export type TextConfig = {
|
|
16
|
-
/**
|
|
17
|
-
* Text response format configuration
|
|
18
|
-
*/
|
|
19
|
-
format?: Formats | undefined;
|
|
20
|
-
verbosity?: TextConfigVerbosity | null | undefined;
|
|
21
|
-
};
|
|
22
|
-
/** @internal */
|
|
23
|
-
export declare const TextConfigVerbosity$inboundSchema: z.ZodType<TextConfigVerbosity, unknown>;
|
|
24
|
-
/** @internal */
|
|
25
|
-
export declare const TextConfig$inboundSchema: z.ZodType<TextConfig, unknown>;
|
|
26
|
-
export declare function textConfigFromJSON(jsonString: string): SafeParseResult<TextConfig, SDKValidationError>;
|
|
27
|
-
//# sourceMappingURL=textconfig.d.ts.map
|
package/esm/models/textconfig.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
* @generated-id: 1a4d7bc40860
|
|
4
|
-
*/
|
|
5
|
-
import * as z from "zod/v4";
|
|
6
|
-
import { safeParse } from "../lib/schemas.js";
|
|
7
|
-
import * as openEnums from "../types/enums.js";
|
|
8
|
-
import { Formats$inboundSchema } from "./formats.js";
|
|
9
|
-
export const TextConfigVerbosity = {
|
|
10
|
-
High: "high",
|
|
11
|
-
Low: "low",
|
|
12
|
-
Medium: "medium",
|
|
13
|
-
};
|
|
14
|
-
/** @internal */
|
|
15
|
-
export const TextConfigVerbosity$inboundSchema = openEnums.inboundSchema(TextConfigVerbosity);
|
|
16
|
-
/** @internal */
|
|
17
|
-
export const TextConfig$inboundSchema = z
|
|
18
|
-
.object({
|
|
19
|
-
format: Formats$inboundSchema.optional(),
|
|
20
|
-
verbosity: z.nullable(TextConfigVerbosity$inboundSchema).optional(),
|
|
21
|
-
});
|
|
22
|
-
export function textConfigFromJSON(jsonString) {
|
|
23
|
-
return safeParse(jsonString, (x) => TextConfig$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TextConfig' from JSON`);
|
|
24
|
-
}
|
|
25
|
-
//# sourceMappingURL=textconfig.js.map
|