@openrouter/sdk 1.2.78 → 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.
@@ -13,7 +13,7 @@ import { Result } from "../types/fp.js";
13
13
  * Promote a container file into workspace documents
14
14
  *
15
15
  * @remarks
16
- * Copies a file from the container's sandbox prefix into the workspace's durable document storage, so it outlives the container. Returns the new document in the Files API shape, with a durable file id in the documents namespace. The copy counts against the workspace's storage quota exactly like an upload.
16
+ * Copies a file from the container's sandbox prefix into the workspace's durable document storage, so it outlives the container. Returns the new document in the Files API shape, with a durable file id in the documents namespace. The copy counts against the workspace's storage quota. Unlike a direct upload, promoted files are downloadable.
17
17
  */
18
18
  export declare function containersPromoteContainerFile(client: OpenRouterCore, request: operations.PromoteContainerFileRequest, options?: RequestOptions): APIPromise<Result<models.FileResponse, errors.BadRequestResponseError | errors.UnauthorizedResponseError | errors.ForbiddenResponseError | errors.NotFoundResponseError | errors.PayloadTooLargeResponseError | errors.TooManyRequestsResponseError | errors.InternalServerResponseError | errors.ServiceUnavailableResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
19
19
  //# sourceMappingURL=containersPromoteContainerFile.d.ts.map
@@ -17,7 +17,7 @@ import { APIPromise } from "../types/async.js";
17
17
  * Promote a container file into workspace documents
18
18
  *
19
19
  * @remarks
20
- * Copies a file from the container's sandbox prefix into the workspace's durable document storage, so it outlives the container. Returns the new document in the Files API shape, with a durable file id in the documents namespace. The copy counts against the workspace's storage quota exactly like an upload.
20
+ * Copies a file from the container's sandbox prefix into the workspace's durable document storage, so it outlives the container. Returns the new document in the Files API shape, with a durable file id in the documents namespace. The copy counts against the workspace's storage quota. Unlike a direct upload, promoted files are downloadable.
21
21
  */
22
22
  export function containersPromoteContainerFile(client, request, options) {
23
23
  return new APIPromise($do(client, request, options));
@@ -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.78";
53
+ readonly sdkVersion: "1.2.80";
54
54
  readonly genVersion: "2.914.0";
55
- readonly userAgent: "speakeasy-sdk/typescript 1.2.78 2.914.0 1.0.0 @openrouter/sdk";
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.78",
32
+ sdkVersion: "1.2.80",
33
33
  genVersion: "2.914.0",
34
- userAgent: "speakeasy-sdk/typescript 1.2.78 2.914.0 1.0.0 @openrouter/sdk",
34
+ userAgent: "speakeasy-sdk/typescript 1.2.80 2.914.0 1.0.0 @openrouter/sdk",
35
35
  };
36
36
  //# sourceMappingURL=config.js.map
@@ -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";
@@ -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
@@ -27,7 +27,7 @@ export declare class Containers extends ClientSDK {
27
27
  * Promote a container file into workspace documents
28
28
  *
29
29
  * @remarks
30
- * Copies a file from the container's sandbox prefix into the workspace's durable document storage, so it outlives the container. Returns the new document in the Files API shape, with a durable file id in the documents namespace. The copy counts against the workspace's storage quota exactly like an upload.
30
+ * Copies a file from the container's sandbox prefix into the workspace's durable document storage, so it outlives the container. Returns the new document in the Files API shape, with a durable file id in the documents namespace. The copy counts against the workspace's storage quota. Unlike a direct upload, promoted files are downloadable.
31
31
  */
32
32
  promoteContainerFile(request: operations.PromoteContainerFileRequest, options?: RequestOptions): Promise<models.FileResponse>;
33
33
  }
@@ -40,7 +40,7 @@ export class Containers extends ClientSDK {
40
40
  * Promote a container file into workspace documents
41
41
  *
42
42
  * @remarks
43
- * Copies a file from the container's sandbox prefix into the workspace's durable document storage, so it outlives the container. Returns the new document in the Files API shape, with a durable file id in the documents namespace. The copy counts against the workspace's storage quota exactly like an upload.
43
+ * Copies a file from the container's sandbox prefix into the workspace's durable document storage, so it outlives the container. Returns the new document in the Files API shape, with a durable file id in the documents namespace. The copy counts against the workspace's storage quota. Unlike a direct upload, promoted files are downloadable.
44
44
  */
45
45
  async promoteContainerFile(request, options) {
46
46
  return unwrapAsync(containersPromoteContainerFile(this, request, options));
package/jsr.json CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  {
4
4
  "name": "@openrouter/sdk",
5
- "version": "1.2.78",
5
+ "version": "1.2.80",
6
6
  "exports": {
7
7
  ".": "./src/index.ts",
8
8
  "./models/errors": "./src/models/errors/index.ts",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openrouter/sdk",
3
- "version": "1.2.78",
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": [
@@ -73,15 +73,15 @@
73
73
  "lint": "eslint --cache --max-warnings=0 src",
74
74
  "build": "tsc",
75
75
  "prepublishOnly": "npm run build",
76
+ "postinstall": "node scripts/check-types.js || true",
76
77
  "prepare": "npm run build",
78
+ "test": "vitest --run --project unit",
77
79
  "test:e2e": "vitest --run --project e2e",
78
80
  "test:watch": "vitest --watch --project unit",
79
- "compile": "tsc",
80
- "postinstall": "node scripts/check-types.js || true",
81
- "test": "vitest --run --project unit",
82
- "test:transit": "exit 0",
83
81
  "typecheck": "tsc --noEmit",
84
- "typecheck:transit": "exit 0"
82
+ "typecheck:transit": "exit 0",
83
+ "compile": "tsc",
84
+ "test:transit": "exit 0"
85
85
  },
86
86
  "peerDependencies": {},
87
87
  "devDependencies": {