@openrouter/sdk 1.2.79 → 1.2.80
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 +1 -0
- package/esm/models/index.js +1 -0
- package/esm/models/publicendpoint.d.ts +5 -0
- package/esm/models/publicendpoint.js +3 -0
- package/esm/models/toolchoicesupport.d.ts +28 -0
- package/esm/models/toolchoicesupport.js +17 -0
- package/jsr.json +1 -1
- package/package.json +3 -3
package/esm/lib/config.d.ts
CHANGED
|
@@ -50,8 +50,8 @@ export declare function serverURLFromOptions(options: SDKOptions): URL | null;
|
|
|
50
50
|
export declare const SDK_METADATA: {
|
|
51
51
|
readonly language: "typescript";
|
|
52
52
|
readonly openapiDocVersion: "1.0.0";
|
|
53
|
-
readonly sdkVersion: "1.2.
|
|
53
|
+
readonly sdkVersion: "1.2.80";
|
|
54
54
|
readonly genVersion: "2.914.0";
|
|
55
|
-
readonly userAgent: "speakeasy-sdk/typescript 1.2.
|
|
55
|
+
readonly userAgent: "speakeasy-sdk/typescript 1.2.80 2.914.0 1.0.0 @openrouter/sdk";
|
|
56
56
|
};
|
|
57
57
|
//# sourceMappingURL=config.d.ts.map
|
package/esm/lib/config.js
CHANGED
|
@@ -29,8 +29,8 @@ export function serverURLFromOptions(options) {
|
|
|
29
29
|
export const SDK_METADATA = {
|
|
30
30
|
language: "typescript",
|
|
31
31
|
openapiDocVersion: "1.0.0",
|
|
32
|
-
sdkVersion: "1.2.
|
|
32
|
+
sdkVersion: "1.2.80",
|
|
33
33
|
genVersion: "2.914.0",
|
|
34
|
-
userAgent: "speakeasy-sdk/typescript 1.2.
|
|
34
|
+
userAgent: "speakeasy-sdk/typescript 1.2.80 2.914.0 1.0.0 @openrouter/sdk",
|
|
35
35
|
};
|
|
36
36
|
//# sourceMappingURL=config.js.map
|
package/esm/models/index.d.ts
CHANGED
|
@@ -558,6 +558,7 @@ export * from "./textdoneevent.js";
|
|
|
558
558
|
export * from "./textextendedconfig.js";
|
|
559
559
|
export * from "./toolcallstatus.js";
|
|
560
560
|
export * from "./toolchoiceallowed.js";
|
|
561
|
+
export * from "./toolchoicesupport.js";
|
|
561
562
|
export * from "./toolsearchservertool.js";
|
|
562
563
|
export * from "./toolsearchservertoolconfig.js";
|
|
563
564
|
export * from "./toomanyrequestsresponseerrordata.js";
|
package/esm/models/index.js
CHANGED
|
@@ -562,6 +562,7 @@ export * from "./textdoneevent.js";
|
|
|
562
562
|
export * from "./textextendedconfig.js";
|
|
563
563
|
export * from "./toolcallstatus.js";
|
|
564
564
|
export * from "./toolchoiceallowed.js";
|
|
565
|
+
export * from "./toolchoicesupport.js";
|
|
565
566
|
export * from "./toolsearchservertool.js";
|
|
566
567
|
export * from "./toolsearchservertoolconfig.js";
|
|
567
568
|
export * from "./toomanyrequestsresponseerrordata.js";
|
|
@@ -7,6 +7,7 @@ import { PercentileStats } from "./percentilestats.js";
|
|
|
7
7
|
import { PricingOverride } from "./pricingoverride.js";
|
|
8
8
|
import { ProviderName } from "./providername.js";
|
|
9
9
|
import { Quantization } from "./quantization.js";
|
|
10
|
+
import { ToolChoiceSupport } from "./toolchoicesupport.js";
|
|
10
11
|
export type Pricing = {
|
|
11
12
|
/**
|
|
12
13
|
* Price in USD per audio input token
|
|
@@ -99,6 +100,10 @@ export type PublicEndpoint = {
|
|
|
99
100
|
status?: EndpointStatus | undefined;
|
|
100
101
|
supportedParameters: Array<Parameter>;
|
|
101
102
|
supportsImplicitCaching: boolean;
|
|
103
|
+
/**
|
|
104
|
+
* Per-variant `tool_choice` support. `tool_choice` in `supported_parameters` only says the parameter is accepted; these flags say which of its values passed testing.
|
|
105
|
+
*/
|
|
106
|
+
supportsToolChoice: ToolChoiceSupport;
|
|
102
107
|
/**
|
|
103
108
|
* Whether this TTS endpoint accepts inline reference audio (`input_references`) for stateless voice cloning. Requests carrying reference audio are only routed to endpoints where this is true.
|
|
104
109
|
*/
|
|
@@ -11,6 +11,7 @@ import { PercentileStats$inboundSchema, } from "./percentilestats.js";
|
|
|
11
11
|
import { PricingOverride$inboundSchema, } from "./pricingoverride.js";
|
|
12
12
|
import { ProviderName$inboundSchema } from "./providername.js";
|
|
13
13
|
import { Quantization$inboundSchema } from "./quantization.js";
|
|
14
|
+
import { ToolChoiceSupport$inboundSchema, } from "./toolchoicesupport.js";
|
|
14
15
|
/** @internal */
|
|
15
16
|
export const Pricing$inboundSchema = z.object({
|
|
16
17
|
audio: z.string().optional(),
|
|
@@ -60,6 +61,7 @@ export const PublicEndpoint$inboundSchema = z.object({
|
|
|
60
61
|
status: EndpointStatus$inboundSchema.optional(),
|
|
61
62
|
supported_parameters: z.array(Parameter$inboundSchema),
|
|
62
63
|
supports_implicit_caching: z.boolean(),
|
|
64
|
+
supports_tool_choice: ToolChoiceSupport$inboundSchema,
|
|
63
65
|
supports_voice_cloning: z.boolean().default(false),
|
|
64
66
|
tag: z.string(),
|
|
65
67
|
throughput_last_30m: z.nullable(PercentileStats$inboundSchema),
|
|
@@ -77,6 +79,7 @@ export const PublicEndpoint$inboundSchema = z.object({
|
|
|
77
79
|
"provider_name": "providerName",
|
|
78
80
|
"supported_parameters": "supportedParameters",
|
|
79
81
|
"supports_implicit_caching": "supportsImplicitCaching",
|
|
82
|
+
"supports_tool_choice": "supportsToolChoice",
|
|
80
83
|
"supports_voice_cloning": "supportsVoiceCloning",
|
|
81
84
|
"throughput_last_30m": "throughputLast30m",
|
|
82
85
|
"uptime_last_1d": "uptimeLast1d",
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
3
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
4
|
+
/**
|
|
5
|
+
* Per-variant `tool_choice` support. `tool_choice` in `supported_parameters` only says the parameter is accepted; these flags say which of its values passed testing.
|
|
6
|
+
*/
|
|
7
|
+
export type ToolChoiceSupport = {
|
|
8
|
+
/**
|
|
9
|
+
* Whether the endpoint supports `"tool_choice": "auto"`.
|
|
10
|
+
*/
|
|
11
|
+
auto: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Whether the endpoint supports naming a function, `"tool_choice": {"type": "function", ...}`.
|
|
14
|
+
*/
|
|
15
|
+
function: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Whether the endpoint supports `"tool_choice": "none"`.
|
|
18
|
+
*/
|
|
19
|
+
none: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Whether the endpoint supports `"tool_choice": "required"`.
|
|
22
|
+
*/
|
|
23
|
+
required: boolean;
|
|
24
|
+
};
|
|
25
|
+
/** @internal */
|
|
26
|
+
export declare const ToolChoiceSupport$inboundSchema: z.ZodType<ToolChoiceSupport, unknown>;
|
|
27
|
+
export declare function toolChoiceSupportFromJSON(jsonString: string): SafeParseResult<ToolChoiceSupport, SDKValidationError>;
|
|
28
|
+
//# sourceMappingURL=toolchoicesupport.d.ts.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: ccb12dd7321c
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { safeParse } from "../lib/schemas.js";
|
|
7
|
+
/** @internal */
|
|
8
|
+
export const ToolChoiceSupport$inboundSchema = z.object({
|
|
9
|
+
auto: z.boolean(),
|
|
10
|
+
function: z.boolean(),
|
|
11
|
+
none: z.boolean(),
|
|
12
|
+
required: z.boolean(),
|
|
13
|
+
});
|
|
14
|
+
export function toolChoiceSupportFromJSON(jsonString) {
|
|
15
|
+
return safeParse(jsonString, (x) => ToolChoiceSupport$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ToolChoiceSupport' from JSON`);
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=toolchoicesupport.js.map
|
package/jsr.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openrouter/sdk",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.80",
|
|
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": [
|
|
@@ -77,11 +77,11 @@
|
|
|
77
77
|
"prepare": "npm run build",
|
|
78
78
|
"test": "vitest --run --project unit",
|
|
79
79
|
"test:e2e": "vitest --run --project e2e",
|
|
80
|
+
"test:watch": "vitest --watch --project unit",
|
|
80
81
|
"typecheck": "tsc --noEmit",
|
|
81
82
|
"typecheck:transit": "exit 0",
|
|
82
83
|
"compile": "tsc",
|
|
83
|
-
"test:transit": "exit 0"
|
|
84
|
-
"test:watch": "vitest --watch --project unit"
|
|
84
|
+
"test:transit": "exit 0"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {},
|
|
87
87
|
"devDependencies": {
|