@openrouter/sdk 0.13.33 → 0.13.34
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/reasoningdetailservertoolcall.d.ts +35 -0
- package/esm/models/reasoningdetailservertoolcall.js +47 -0
- package/esm/models/reasoningdetailunion.d.ts +3 -2
- package/esm/models/reasoningdetailunion.js +3 -0
- package/jsr.json +1 -1
- package/package.json +6 -6
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.13.
|
|
52
|
+
readonly sdkVersion: "0.13.34";
|
|
53
53
|
readonly genVersion: "2.884.4";
|
|
54
|
-
readonly userAgent: "speakeasy-sdk/typescript 0.13.
|
|
54
|
+
readonly userAgent: "speakeasy-sdk/typescript 0.13.34 2.884.4 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.13.
|
|
29
|
+
sdkVersion: "0.13.34",
|
|
30
30
|
genVersion: "2.884.4",
|
|
31
|
-
userAgent: "speakeasy-sdk/typescript 0.13.
|
|
31
|
+
userAgent: "speakeasy-sdk/typescript 0.13.34 2.884.4 1.0.0 @openrouter/sdk",
|
|
32
32
|
};
|
|
33
33
|
//# sourceMappingURL=config.js.map
|
package/esm/models/index.d.ts
CHANGED
|
@@ -410,6 +410,7 @@ export * from "./rankingsdailyresponse.js";
|
|
|
410
410
|
export * from "./reasoningconfig.js";
|
|
411
411
|
export * from "./reasoningdeltaevent.js";
|
|
412
412
|
export * from "./reasoningdetailencrypted.js";
|
|
413
|
+
export * from "./reasoningdetailservertoolcall.js";
|
|
413
414
|
export * from "./reasoningdetailsummary.js";
|
|
414
415
|
export * from "./reasoningdetailtext.js";
|
|
415
416
|
export * from "./reasoningdetailunion.js";
|
package/esm/models/index.js
CHANGED
|
@@ -414,6 +414,7 @@ export * from "./rankingsdailyresponse.js";
|
|
|
414
414
|
export * from "./reasoningconfig.js";
|
|
415
415
|
export * from "./reasoningdeltaevent.js";
|
|
416
416
|
export * from "./reasoningdetailencrypted.js";
|
|
417
|
+
export * from "./reasoningdetailservertoolcall.js";
|
|
417
418
|
export * from "./reasoningdetailsummary.js";
|
|
418
419
|
export * from "./reasoningdetailtext.js";
|
|
419
420
|
export * from "./reasoningdetailunion.js";
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
3
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
4
|
+
import { ReasoningFormat } from "./reasoningformat.js";
|
|
5
|
+
/**
|
|
6
|
+
* Record of an OpenRouter server-tool invocation (e.g. openrouter:fusion), carried in reasoning_details so a prior tool call can be rehydrated into a later turn of the same conversation.
|
|
7
|
+
*/
|
|
8
|
+
export type ReasoningDetailServerToolCall = {
|
|
9
|
+
arguments: string;
|
|
10
|
+
format?: ReasoningFormat | null | undefined;
|
|
11
|
+
id?: string | null | undefined;
|
|
12
|
+
index?: number | undefined;
|
|
13
|
+
result: string;
|
|
14
|
+
toolCallId?: string | null | undefined;
|
|
15
|
+
toolName: string;
|
|
16
|
+
type: "reasoning.server_tool_call";
|
|
17
|
+
};
|
|
18
|
+
/** @internal */
|
|
19
|
+
export declare const ReasoningDetailServerToolCall$inboundSchema: z.ZodType<ReasoningDetailServerToolCall, unknown>;
|
|
20
|
+
/** @internal */
|
|
21
|
+
export type ReasoningDetailServerToolCall$Outbound = {
|
|
22
|
+
arguments: string;
|
|
23
|
+
format?: string | null | undefined;
|
|
24
|
+
id?: string | null | undefined;
|
|
25
|
+
index?: number | undefined;
|
|
26
|
+
result: string;
|
|
27
|
+
tool_call_id?: string | null | undefined;
|
|
28
|
+
tool_name: string;
|
|
29
|
+
type: "reasoning.server_tool_call";
|
|
30
|
+
};
|
|
31
|
+
/** @internal */
|
|
32
|
+
export declare const ReasoningDetailServerToolCall$outboundSchema: z.ZodType<ReasoningDetailServerToolCall$Outbound, ReasoningDetailServerToolCall>;
|
|
33
|
+
export declare function reasoningDetailServerToolCallToJSON(reasoningDetailServerToolCall: ReasoningDetailServerToolCall): string;
|
|
34
|
+
export declare function reasoningDetailServerToolCallFromJSON(jsonString: string): SafeParseResult<ReasoningDetailServerToolCall, SDKValidationError>;
|
|
35
|
+
//# sourceMappingURL=reasoningdetailservertoolcall.d.ts.map
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: e2bb1917981b
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../lib/schemas.js";
|
|
8
|
+
import { ReasoningFormat$inboundSchema, ReasoningFormat$outboundSchema, } from "./reasoningformat.js";
|
|
9
|
+
/** @internal */
|
|
10
|
+
export const ReasoningDetailServerToolCall$inboundSchema = z.object({
|
|
11
|
+
arguments: z.string(),
|
|
12
|
+
format: z.nullable(ReasoningFormat$inboundSchema).optional(),
|
|
13
|
+
id: z.nullable(z.string()).optional(),
|
|
14
|
+
index: z.int().optional(),
|
|
15
|
+
result: z.string(),
|
|
16
|
+
tool_call_id: z.nullable(z.string()).optional(),
|
|
17
|
+
tool_name: z.string(),
|
|
18
|
+
type: z.literal("reasoning.server_tool_call"),
|
|
19
|
+
}).transform((v) => {
|
|
20
|
+
return remap$(v, {
|
|
21
|
+
"tool_call_id": "toolCallId",
|
|
22
|
+
"tool_name": "toolName",
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
/** @internal */
|
|
26
|
+
export const ReasoningDetailServerToolCall$outboundSchema = z.object({
|
|
27
|
+
arguments: z.string(),
|
|
28
|
+
format: z.nullable(ReasoningFormat$outboundSchema).optional(),
|
|
29
|
+
id: z.nullable(z.string()).optional(),
|
|
30
|
+
index: z.int().optional(),
|
|
31
|
+
result: z.string(),
|
|
32
|
+
toolCallId: z.nullable(z.string()).optional(),
|
|
33
|
+
toolName: z.string(),
|
|
34
|
+
type: z.literal("reasoning.server_tool_call"),
|
|
35
|
+
}).transform((v) => {
|
|
36
|
+
return remap$(v, {
|
|
37
|
+
toolCallId: "tool_call_id",
|
|
38
|
+
toolName: "tool_name",
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
export function reasoningDetailServerToolCallToJSON(reasoningDetailServerToolCall) {
|
|
42
|
+
return JSON.stringify(ReasoningDetailServerToolCall$outboundSchema.parse(reasoningDetailServerToolCall));
|
|
43
|
+
}
|
|
44
|
+
export function reasoningDetailServerToolCallFromJSON(jsonString) {
|
|
45
|
+
return safeParse(jsonString, (x) => ReasoningDetailServerToolCall$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ReasoningDetailServerToolCall' from JSON`);
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=reasoningdetailservertoolcall.js.map
|
|
@@ -3,16 +3,17 @@ import * as discriminatedUnionTypes from "../types/discriminatedUnion.js";
|
|
|
3
3
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
4
4
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
5
|
import { ReasoningDetailEncrypted, ReasoningDetailEncrypted$Outbound } from "./reasoningdetailencrypted.js";
|
|
6
|
+
import { ReasoningDetailServerToolCall, ReasoningDetailServerToolCall$Outbound } from "./reasoningdetailservertoolcall.js";
|
|
6
7
|
import { ReasoningDetailSummary, ReasoningDetailSummary$Outbound } from "./reasoningdetailsummary.js";
|
|
7
8
|
import { ReasoningDetailText, ReasoningDetailText$Outbound } from "./reasoningdetailtext.js";
|
|
8
9
|
/**
|
|
9
10
|
* Reasoning detail union schema
|
|
10
11
|
*/
|
|
11
|
-
export type ReasoningDetailUnion = ReasoningDetailEncrypted | ReasoningDetailSummary | ReasoningDetailText | discriminatedUnionTypes.Unknown<"type">;
|
|
12
|
+
export type ReasoningDetailUnion = ReasoningDetailEncrypted | ReasoningDetailServerToolCall | ReasoningDetailSummary | ReasoningDetailText | discriminatedUnionTypes.Unknown<"type">;
|
|
12
13
|
/** @internal */
|
|
13
14
|
export declare const ReasoningDetailUnion$inboundSchema: z.ZodType<ReasoningDetailUnion, unknown>;
|
|
14
15
|
/** @internal */
|
|
15
|
-
export type ReasoningDetailUnion$Outbound = ReasoningDetailEncrypted$Outbound | ReasoningDetailSummary$Outbound | ReasoningDetailText$Outbound;
|
|
16
|
+
export type ReasoningDetailUnion$Outbound = ReasoningDetailEncrypted$Outbound | ReasoningDetailServerToolCall$Outbound | ReasoningDetailSummary$Outbound | ReasoningDetailText$Outbound;
|
|
16
17
|
/** @internal */
|
|
17
18
|
export declare const ReasoningDetailUnion$outboundSchema: z.ZodType<ReasoningDetailUnion$Outbound, ReasoningDetailUnion>;
|
|
18
19
|
export declare function reasoningDetailUnionToJSON(reasoningDetailUnion: ReasoningDetailUnion): string;
|
|
@@ -6,17 +6,20 @@ import * as z from "zod/v4";
|
|
|
6
6
|
import { safeParse } from "../lib/schemas.js";
|
|
7
7
|
import { discriminatedUnion } from "../types/discriminatedUnion.js";
|
|
8
8
|
import { ReasoningDetailEncrypted$inboundSchema, ReasoningDetailEncrypted$outboundSchema, } from "./reasoningdetailencrypted.js";
|
|
9
|
+
import { ReasoningDetailServerToolCall$inboundSchema, ReasoningDetailServerToolCall$outboundSchema, } from "./reasoningdetailservertoolcall.js";
|
|
9
10
|
import { ReasoningDetailSummary$inboundSchema, ReasoningDetailSummary$outboundSchema, } from "./reasoningdetailsummary.js";
|
|
10
11
|
import { ReasoningDetailText$inboundSchema, ReasoningDetailText$outboundSchema, } from "./reasoningdetailtext.js";
|
|
11
12
|
/** @internal */
|
|
12
13
|
export const ReasoningDetailUnion$inboundSchema = discriminatedUnion("type", {
|
|
13
14
|
["reasoning.encrypted"]: ReasoningDetailEncrypted$inboundSchema,
|
|
15
|
+
["reasoning.server_tool_call"]: ReasoningDetailServerToolCall$inboundSchema,
|
|
14
16
|
["reasoning.summary"]: ReasoningDetailSummary$inboundSchema,
|
|
15
17
|
["reasoning.text"]: ReasoningDetailText$inboundSchema,
|
|
16
18
|
});
|
|
17
19
|
/** @internal */
|
|
18
20
|
export const ReasoningDetailUnion$outboundSchema = z.union([
|
|
19
21
|
ReasoningDetailEncrypted$outboundSchema,
|
|
22
|
+
ReasoningDetailServerToolCall$outboundSchema,
|
|
20
23
|
ReasoningDetailSummary$outboundSchema,
|
|
21
24
|
ReasoningDetailText$outboundSchema,
|
|
22
25
|
]);
|
package/jsr.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openrouter/sdk",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.34",
|
|
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
|
+
"test:transit": "exit 0",
|
|
77
|
+
"test:watch": "vitest --watch --project unit",
|
|
78
|
+
"typecheck:transit": "exit 0",
|
|
76
79
|
"compile": "tsc",
|
|
77
80
|
"postinstall": "node scripts/check-types.js || true",
|
|
78
|
-
"test": "vitest --run --project unit",
|
|
79
|
-
"test:watch": "vitest --watch --project unit",
|
|
80
81
|
"prepare": "npm run build",
|
|
82
|
+
"test": "vitest --run --project unit",
|
|
81
83
|
"test:e2e": "vitest --run --project e2e",
|
|
82
|
-
"
|
|
83
|
-
"typecheck": "tsc --noEmit",
|
|
84
|
-
"typecheck:transit": "exit 0"
|
|
84
|
+
"typecheck": "tsc --noEmit"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {},
|
|
87
87
|
"devDependencies": {
|