@openrouter/sdk 1.5.50 → 1.5.51
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/chatusage.d.ts +5 -0
- package/esm/models/chatusage.js +3 -0
- package/esm/models/deferredtoolscontrol.d.ts +7 -6
- package/esm/models/deferredtoolscontrol.js +5 -2
- package/esm/models/deferredtoolsdetails.d.ts +28 -0
- package/esm/models/deferredtoolsdetails.js +24 -0
- package/esm/models/index.d.ts +1 -0
- package/esm/models/index.js +1 -0
- package/esm/models/openresponsesresult.d.ts +5 -0
- package/esm/models/openresponsesresult.js +3 -0
- package/esm/models/operations/listorganizationmembers.d.ts +4 -3
- package/esm/models/operations/listorganizationmembers.js +2 -1
- package/esm/models/outputtoolsearchservertoolitem.d.ts +44 -0
- package/esm/models/outputtoolsearchservertoolitem.js +34 -0
- package/jsr.json +1 -1
- package/package.json +7 -7
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.5.
|
|
53
|
+
readonly sdkVersion: "1.5.51";
|
|
54
54
|
readonly genVersion: "2.950.13";
|
|
55
|
-
readonly userAgent: "speakeasy-sdk/typescript 1.5.
|
|
55
|
+
readonly userAgent: "speakeasy-sdk/typescript 1.5.51 2.950.13 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.5.
|
|
32
|
+
sdkVersion: "1.5.51",
|
|
33
33
|
genVersion: "2.950.13",
|
|
34
|
-
userAgent: "speakeasy-sdk/typescript 1.5.
|
|
34
|
+
userAgent: "speakeasy-sdk/typescript 1.5.51 2.950.13 1.0.0 @openrouter/sdk",
|
|
35
35
|
};
|
|
36
36
|
//# sourceMappingURL=config.js.map
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as z from "zod/v4";
|
|
2
2
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
3
3
|
import { CostDetails } from "./costdetails.js";
|
|
4
|
+
import { DeferredToolsDetails } from "./deferredtoolsdetails.js";
|
|
4
5
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
6
|
import { ServerToolUseDetails } from "./servertoolusedetails.js";
|
|
6
7
|
/**
|
|
@@ -65,6 +66,10 @@ export type ChatUsage = {
|
|
|
65
66
|
* Breakdown of upstream inference costs
|
|
66
67
|
*/
|
|
67
68
|
costDetails?: CostDetails | null | undefined;
|
|
69
|
+
/**
|
|
70
|
+
* Totals across every upstream model call of a deferred-tools run. The native usage fields report only the final call; cost covers every call.
|
|
71
|
+
*/
|
|
72
|
+
deferredToolsDetails?: DeferredToolsDetails | undefined;
|
|
68
73
|
/**
|
|
69
74
|
* Whether a request was made using a Bring Your Own Key configuration
|
|
70
75
|
*/
|
package/esm/models/chatusage.js
CHANGED
|
@@ -6,6 +6,7 @@ import * as z from "zod/v4";
|
|
|
6
6
|
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
7
|
import { safeParse } from "../lib/schemas.js";
|
|
8
8
|
import { CostDetails$inboundSchema } from "./costdetails.js";
|
|
9
|
+
import { DeferredToolsDetails$inboundSchema, } from "./deferredtoolsdetails.js";
|
|
9
10
|
import { ServerToolUseDetails$inboundSchema, } from "./servertoolusedetails.js";
|
|
10
11
|
/** @internal */
|
|
11
12
|
export const ChatUsageCompletionTokensDetails$inboundSchema = z.object({
|
|
@@ -47,6 +48,7 @@ export const ChatUsage$inboundSchema = z.object({
|
|
|
47
48
|
completion_tokens_details: z.nullable(z.lazy(() => ChatUsageCompletionTokensDetails$inboundSchema)).optional(),
|
|
48
49
|
cost: z.nullable(z.number()).optional(),
|
|
49
50
|
cost_details: z.nullable(CostDetails$inboundSchema).optional(),
|
|
51
|
+
deferred_tools_details: DeferredToolsDetails$inboundSchema.optional(),
|
|
50
52
|
is_byok: z.boolean().optional(),
|
|
51
53
|
prompt_tokens: z.int(),
|
|
52
54
|
prompt_tokens_details: z.nullable(z.lazy(() => ChatUsagePromptTokensDetails$inboundSchema)).optional(),
|
|
@@ -58,6 +60,7 @@ export const ChatUsage$inboundSchema = z.object({
|
|
|
58
60
|
"completion_tokens": "completionTokens",
|
|
59
61
|
"completion_tokens_details": "completionTokensDetails",
|
|
60
62
|
"cost_details": "costDetails",
|
|
63
|
+
"deferred_tools_details": "deferredToolsDetails",
|
|
61
64
|
"is_byok": "isByok",
|
|
62
65
|
"prompt_tokens": "promptTokens",
|
|
63
66
|
"prompt_tokens_details": "promptTokensDetails",
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import * as z from "zod/v4";
|
|
2
|
-
import { ClosedEnum } from "../types/enums.js";
|
|
2
|
+
import { ClosedEnum, OpenEnum } from "../types/enums.js";
|
|
3
3
|
import { DeferredToolsSearchStrategy, DeferredToolsSearchStrategy$Outbound } from "./deferredtoolssearchstrategy.js";
|
|
4
4
|
/**
|
|
5
|
-
* Loading profile.
|
|
5
|
+
* Loading profile. `portable` serves the `defer_loading` tools with router-built search and call wrappers on any model and keeps the catalog fixed. `universal` defers every wrappable tool behind the same wrappers so the provider-facing tool list never changes, and rebuilds the catalog from each request so tools can be added or removed mid-conversation.
|
|
6
6
|
*/
|
|
7
7
|
export declare const Profile: {
|
|
8
8
|
readonly Portable: "portable";
|
|
9
|
+
readonly Universal: "universal";
|
|
9
10
|
};
|
|
10
11
|
/**
|
|
11
|
-
* Loading profile.
|
|
12
|
+
* Loading profile. `portable` serves the `defer_loading` tools with router-built search and call wrappers on any model and keeps the catalog fixed. `universal` defers every wrappable tool behind the same wrappers so the provider-facing tool list never changes, and rebuilds the catalog from each request so tools can be added or removed mid-conversation.
|
|
12
13
|
*/
|
|
13
|
-
export type Profile =
|
|
14
|
+
export type Profile = OpenEnum<typeof Profile>;
|
|
14
15
|
export declare const Protocol: {
|
|
15
16
|
readonly V1: "v1";
|
|
16
17
|
};
|
|
@@ -30,7 +31,7 @@ export type Validation = ClosedEnum<typeof Validation>;
|
|
|
30
31
|
*/
|
|
31
32
|
export type DeferredToolsControl = {
|
|
32
33
|
/**
|
|
33
|
-
* Loading profile.
|
|
34
|
+
* Loading profile. `portable` serves the `defer_loading` tools with router-built search and call wrappers on any model and keeps the catalog fixed. `universal` defers every wrappable tool behind the same wrappers so the provider-facing tool list never changes, and rebuilds the catalog from each request so tools can be added or removed mid-conversation.
|
|
34
35
|
*/
|
|
35
36
|
profile: Profile;
|
|
36
37
|
protocol: Protocol;
|
|
@@ -44,7 +45,7 @@ export type DeferredToolsControl = {
|
|
|
44
45
|
validation: Validation;
|
|
45
46
|
};
|
|
46
47
|
/** @internal */
|
|
47
|
-
export declare const Profile$outboundSchema: z.
|
|
48
|
+
export declare const Profile$outboundSchema: z.ZodType<string, Profile>;
|
|
48
49
|
/** @internal */
|
|
49
50
|
export declare const Protocol$outboundSchema: z.ZodEnum<typeof Protocol>;
|
|
50
51
|
/** @internal */
|
|
@@ -3,12 +3,14 @@
|
|
|
3
3
|
* @generated-id: 117738d3058e
|
|
4
4
|
*/
|
|
5
5
|
import * as z from "zod/v4";
|
|
6
|
+
import * as openEnums from "../types/enums.js";
|
|
6
7
|
import { DeferredToolsSearchStrategy$outboundSchema, } from "./deferredtoolssearchstrategy.js";
|
|
7
8
|
/**
|
|
8
|
-
* Loading profile.
|
|
9
|
+
* Loading profile. `portable` serves the `defer_loading` tools with router-built search and call wrappers on any model and keeps the catalog fixed. `universal` defers every wrappable tool behind the same wrappers so the provider-facing tool list never changes, and rebuilds the catalog from each request so tools can be added or removed mid-conversation.
|
|
9
10
|
*/
|
|
10
11
|
export const Profile = {
|
|
11
12
|
Portable: "portable",
|
|
13
|
+
Universal: "universal",
|
|
12
14
|
};
|
|
13
15
|
export const Protocol = {
|
|
14
16
|
V1: "v1",
|
|
@@ -20,7 +22,8 @@ export const Validation = {
|
|
|
20
22
|
Runtime: "runtime",
|
|
21
23
|
};
|
|
22
24
|
/** @internal */
|
|
23
|
-
export const Profile$outboundSchema =
|
|
25
|
+
export const Profile$outboundSchema = openEnums
|
|
26
|
+
.outboundSchema(Profile);
|
|
24
27
|
/** @internal */
|
|
25
28
|
export const Protocol$outboundSchema = z.enum(Protocol);
|
|
26
29
|
/** @internal */
|
|
@@ -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
|
+
* Totals across every upstream model call of a deferred-tools run. The native usage fields report only the final call; cost covers every call.
|
|
6
|
+
*/
|
|
7
|
+
export type DeferredToolsDetails = {
|
|
8
|
+
/**
|
|
9
|
+
* Completion tokens summed over every upstream call
|
|
10
|
+
*/
|
|
11
|
+
completionTokens: number;
|
|
12
|
+
/**
|
|
13
|
+
* Prompt tokens summed over every upstream call
|
|
14
|
+
*/
|
|
15
|
+
promptTokens: number;
|
|
16
|
+
/**
|
|
17
|
+
* Sum of the above two fields
|
|
18
|
+
*/
|
|
19
|
+
totalTokens: number;
|
|
20
|
+
/**
|
|
21
|
+
* Upstream model calls the run made
|
|
22
|
+
*/
|
|
23
|
+
turns: number;
|
|
24
|
+
};
|
|
25
|
+
/** @internal */
|
|
26
|
+
export declare const DeferredToolsDetails$inboundSchema: z.ZodType<DeferredToolsDetails, unknown>;
|
|
27
|
+
export declare function deferredToolsDetailsFromJSON(jsonString: string): SafeParseResult<DeferredToolsDetails, SDKValidationError>;
|
|
28
|
+
//# sourceMappingURL=deferredtoolsdetails.d.ts.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: be880e934c3b
|
|
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
|
+
/** @internal */
|
|
9
|
+
export const DeferredToolsDetails$inboundSchema = z.object({
|
|
10
|
+
completion_tokens: z.int(),
|
|
11
|
+
prompt_tokens: z.int(),
|
|
12
|
+
total_tokens: z.int(),
|
|
13
|
+
turns: z.int(),
|
|
14
|
+
}).transform((v) => {
|
|
15
|
+
return remap$(v, {
|
|
16
|
+
"completion_tokens": "completionTokens",
|
|
17
|
+
"prompt_tokens": "promptTokens",
|
|
18
|
+
"total_tokens": "totalTokens",
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
export function deferredToolsDetailsFromJSON(jsonString) {
|
|
22
|
+
return safeParse(jsonString, (x) => DeferredToolsDetails$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DeferredToolsDetails' from JSON`);
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=deferredtoolsdetails.js.map
|
package/esm/models/index.d.ts
CHANGED
|
@@ -319,6 +319,7 @@ export * from "./deferredbm25search.js";
|
|
|
319
319
|
export * from "./deferredcustomsearch.js";
|
|
320
320
|
export * from "./deferredregexsearch.js";
|
|
321
321
|
export * from "./deferredtoolscontrol.js";
|
|
322
|
+
export * from "./deferredtoolsdetails.js";
|
|
322
323
|
export * from "./deferredtoolssearchstrategy.js";
|
|
323
324
|
export * from "./deletebyokkeyresponse.js";
|
|
324
325
|
export * from "./deleteguardrailresponse.js";
|
package/esm/models/index.js
CHANGED
|
@@ -323,6 +323,7 @@ export * from "./deferredbm25search.js";
|
|
|
323
323
|
export * from "./deferredcustomsearch.js";
|
|
324
324
|
export * from "./deferredregexsearch.js";
|
|
325
325
|
export * from "./deferredtoolscontrol.js";
|
|
326
|
+
export * from "./deferredtoolsdetails.js";
|
|
326
327
|
export * from "./deferredtoolssearchstrategy.js";
|
|
327
328
|
export * from "./deletebyokkeyresponse.js";
|
|
328
329
|
export * from "./deleteguardrailresponse.js";
|
|
@@ -12,6 +12,7 @@ import { CodeInterpreterServerTool } from "./codeinterpreterservertool.js";
|
|
|
12
12
|
import { CodexLocalShellTool } from "./codexlocalshelltool.js";
|
|
13
13
|
import { ComputerUseServerTool } from "./computeruseservertool.js";
|
|
14
14
|
import { CustomTool } from "./customtool.js";
|
|
15
|
+
import { DeferredToolsDetails } from "./deferredtoolsdetails.js";
|
|
15
16
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
16
17
|
import { FileSearchServerTool } from "./filesearchservertool.js";
|
|
17
18
|
import { ImageGenerationServerTool } from "./imagegenerationservertool.js";
|
|
@@ -122,6 +123,10 @@ export type Usage = {
|
|
|
122
123
|
*/
|
|
123
124
|
cost?: number | null | undefined;
|
|
124
125
|
costDetails?: UsageCostDetails | undefined;
|
|
126
|
+
/**
|
|
127
|
+
* Totals across every upstream model call of a deferred-tools run. The native usage fields report only the final call; cost covers every call.
|
|
128
|
+
*/
|
|
129
|
+
deferredToolsDetails?: DeferredToolsDetails | undefined;
|
|
125
130
|
/**
|
|
126
131
|
* Whether a request was made using a Bring Your Own Key configuration
|
|
127
132
|
*/
|
|
@@ -17,6 +17,7 @@ import { CodeInterpreterServerTool$inboundSchema, } from "./codeinterpreterserve
|
|
|
17
17
|
import { CodexLocalShellTool$inboundSchema, } from "./codexlocalshelltool.js";
|
|
18
18
|
import { ComputerUseServerTool$inboundSchema, } from "./computeruseservertool.js";
|
|
19
19
|
import { CustomTool$inboundSchema } from "./customtool.js";
|
|
20
|
+
import { DeferredToolsDetails$inboundSchema, } from "./deferredtoolsdetails.js";
|
|
20
21
|
import { FileSearchServerTool$inboundSchema, } from "./filesearchservertool.js";
|
|
21
22
|
import { ImageGenerationServerTool$inboundSchema, } from "./imagegenerationservertool.js";
|
|
22
23
|
import { IncompleteDetails$inboundSchema, } from "./incompletedetails.js";
|
|
@@ -145,6 +146,7 @@ export const Usage$inboundSchema = z.object({
|
|
|
145
146
|
total_tokens: z.int(),
|
|
146
147
|
cost: z.nullable(z.number()).optional(),
|
|
147
148
|
cost_details: z.lazy(() => UsageCostDetails$inboundSchema).optional(),
|
|
149
|
+
deferred_tools_details: DeferredToolsDetails$inboundSchema.optional(),
|
|
148
150
|
is_byok: z.boolean().optional(),
|
|
149
151
|
server_tool_use_details: z.nullable(ServerToolUseDetails$inboundSchema)
|
|
150
152
|
.optional(),
|
|
@@ -156,6 +158,7 @@ export const Usage$inboundSchema = z.object({
|
|
|
156
158
|
"output_tokens_details": "outputTokensDetails",
|
|
157
159
|
"total_tokens": "totalTokens",
|
|
158
160
|
"cost_details": "costDetails",
|
|
161
|
+
"deferred_tools_details": "deferredToolsDetails",
|
|
159
162
|
"is_byok": "isByok",
|
|
160
163
|
"server_tool_use_details": "serverToolUseDetails",
|
|
161
164
|
});
|
|
@@ -53,14 +53,15 @@ export type ListOrganizationMembersRequest = {
|
|
|
53
53
|
limit?: number | undefined;
|
|
54
54
|
};
|
|
55
55
|
/**
|
|
56
|
-
* Role of the member in the organization
|
|
56
|
+
* Role of the member in the organization. `org:viewer` is coming soon and not yet available. Once launched, it has read-only organization access: it can view organization settings, billing and workspaces but not change them. Workspace roles can still grant write access in specific workspaces.
|
|
57
57
|
*/
|
|
58
58
|
export declare const Role: {
|
|
59
59
|
readonly OrgAdmin: "org:admin";
|
|
60
60
|
readonly OrgMember: "org:member";
|
|
61
|
+
readonly OrgViewer: "org:viewer";
|
|
61
62
|
};
|
|
62
63
|
/**
|
|
63
|
-
* Role of the member in the organization
|
|
64
|
+
* Role of the member in the organization. `org:viewer` is coming soon and not yet available. Once launched, it has read-only organization access: it can view organization settings, billing and workspaces but not change them. Workspace roles can still grant write access in specific workspaces.
|
|
64
65
|
*/
|
|
65
66
|
export type Role = OpenEnum<typeof Role>;
|
|
66
67
|
export type ListOrganizationMembersData = {
|
|
@@ -81,7 +82,7 @@ export type ListOrganizationMembersData = {
|
|
|
81
82
|
*/
|
|
82
83
|
lastName: string | null;
|
|
83
84
|
/**
|
|
84
|
-
* Role of the member in the organization
|
|
85
|
+
* Role of the member in the organization. `org:viewer` is coming soon and not yet available. Once launched, it has read-only organization access: it can view organization settings, billing and workspaces but not change them. Workspace roles can still grant write access in specific workspaces.
|
|
85
86
|
*/
|
|
86
87
|
role: Role;
|
|
87
88
|
};
|
|
@@ -7,11 +7,12 @@ import { remap as remap$ } from "../../lib/primitives.js";
|
|
|
7
7
|
import { safeParse } from "../../lib/schemas.js";
|
|
8
8
|
import * as openEnums from "../../types/enums.js";
|
|
9
9
|
/**
|
|
10
|
-
* Role of the member in the organization
|
|
10
|
+
* Role of the member in the organization. `org:viewer` is coming soon and not yet available. Once launched, it has read-only organization access: it can view organization settings, billing and workspaces but not change them. Workspace roles can still grant write access in specific workspaces.
|
|
11
11
|
*/
|
|
12
12
|
export const Role = {
|
|
13
13
|
OrgAdmin: "org:admin",
|
|
14
14
|
OrgMember: "org:member",
|
|
15
|
+
OrgViewer: "org:viewer",
|
|
15
16
|
};
|
|
16
17
|
/** @internal */
|
|
17
18
|
export const ListOrganizationMembersRequest$outboundSchema = z.object({
|
|
@@ -3,6 +3,16 @@ import { ClosedEnum } from "../types/enums.js";
|
|
|
3
3
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
4
4
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
5
|
import { FailableToolCallStatus } from "./failabletoolcallstatus.js";
|
|
6
|
+
/**
|
|
7
|
+
* How the model saw the matches. `compact` means each tool by name, description, and input shape, plus a call example. Replaying the item renders the same result.
|
|
8
|
+
*/
|
|
9
|
+
export declare const OutputToolSearchServerToolItemFormat: {
|
|
10
|
+
readonly Compact: "compact";
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* How the model saw the matches. `compact` means each tool by name, description, and input shape, plus a call example. Replaying the item renders the same result.
|
|
14
|
+
*/
|
|
15
|
+
export type OutputToolSearchServerToolItemFormat = ClosedEnum<typeof OutputToolSearchServerToolItemFormat>;
|
|
6
16
|
export type Match = {
|
|
7
17
|
definition: {
|
|
8
18
|
[k: string]: any;
|
|
@@ -18,17 +28,45 @@ export type OutputToolSearchServerToolItemType = ClosedEnum<typeof OutputToolSea
|
|
|
18
28
|
* An openrouter:tool_search server tool output item
|
|
19
29
|
*/
|
|
20
30
|
export type OutputToolSearchServerToolItem = {
|
|
31
|
+
/**
|
|
32
|
+
* The JSON arguments of the model call, verbatim. Replaying the item reuses them.
|
|
33
|
+
*/
|
|
34
|
+
arguments?: string | undefined;
|
|
35
|
+
/**
|
|
36
|
+
* The ID of the model call that ran the search. Replaying the item reuses it.
|
|
37
|
+
*/
|
|
38
|
+
callId?: string | undefined;
|
|
39
|
+
/**
|
|
40
|
+
* The deferred-tool index the router showed the model with a pre-search, listing tool sources and names. Replaying the item shows the same index.
|
|
41
|
+
*/
|
|
42
|
+
catalogIndex?: string | undefined;
|
|
21
43
|
/**
|
|
22
44
|
* The error message when the tool call failed before producing a result. Set together with `status: 'failed'`; absent on a successful call.
|
|
23
45
|
*/
|
|
24
46
|
error?: string | undefined;
|
|
47
|
+
/**
|
|
48
|
+
* How the model saw the matches. `compact` means each tool by name, description, and input shape, plus a call example. Replaying the item renders the same result.
|
|
49
|
+
*/
|
|
50
|
+
format?: OutputToolSearchServerToolItemFormat | undefined;
|
|
51
|
+
/**
|
|
52
|
+
* The guidance the model got when the search matched no tools.
|
|
53
|
+
*/
|
|
54
|
+
hint?: string | undefined;
|
|
25
55
|
id?: string | undefined;
|
|
26
56
|
matches?: Array<Match> | undefined;
|
|
27
57
|
query?: string | undefined;
|
|
28
58
|
status: FailableToolCallStatus;
|
|
59
|
+
/**
|
|
60
|
+
* The IDs of every tool call in the model response that ran the search, in order. Replaying the item keeps those calls in one turn.
|
|
61
|
+
*/
|
|
62
|
+
turnCallIds?: Array<string> | undefined;
|
|
29
63
|
type: OutputToolSearchServerToolItemType;
|
|
30
64
|
};
|
|
31
65
|
/** @internal */
|
|
66
|
+
export declare const OutputToolSearchServerToolItemFormat$inboundSchema: z.ZodEnum<typeof OutputToolSearchServerToolItemFormat>;
|
|
67
|
+
/** @internal */
|
|
68
|
+
export declare const OutputToolSearchServerToolItemFormat$outboundSchema: z.ZodEnum<typeof OutputToolSearchServerToolItemFormat>;
|
|
69
|
+
/** @internal */
|
|
32
70
|
export declare const Match$inboundSchema: z.ZodType<Match, unknown>;
|
|
33
71
|
/** @internal */
|
|
34
72
|
export type Match$Outbound = {
|
|
@@ -50,11 +88,17 @@ export declare const OutputToolSearchServerToolItemType$outboundSchema: z.ZodEnu
|
|
|
50
88
|
export declare const OutputToolSearchServerToolItem$inboundSchema: z.ZodType<OutputToolSearchServerToolItem, unknown>;
|
|
51
89
|
/** @internal */
|
|
52
90
|
export type OutputToolSearchServerToolItem$Outbound = {
|
|
91
|
+
arguments?: string | undefined;
|
|
92
|
+
call_id?: string | undefined;
|
|
93
|
+
catalog_index?: string | undefined;
|
|
53
94
|
error?: string | undefined;
|
|
95
|
+
format?: string | undefined;
|
|
96
|
+
hint?: string | undefined;
|
|
54
97
|
id?: string | undefined;
|
|
55
98
|
matches?: Array<Match$Outbound> | undefined;
|
|
56
99
|
query?: string | undefined;
|
|
57
100
|
status: string;
|
|
101
|
+
turn_call_ids?: Array<string> | undefined;
|
|
58
102
|
type: string;
|
|
59
103
|
};
|
|
60
104
|
/** @internal */
|
|
@@ -6,10 +6,20 @@ import * as z from "zod/v4";
|
|
|
6
6
|
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
7
|
import { safeParse } from "../lib/schemas.js";
|
|
8
8
|
import { FailableToolCallStatus$inboundSchema, FailableToolCallStatus$outboundSchema, } from "./failabletoolcallstatus.js";
|
|
9
|
+
/**
|
|
10
|
+
* How the model saw the matches. `compact` means each tool by name, description, and input shape, plus a call example. Replaying the item renders the same result.
|
|
11
|
+
*/
|
|
12
|
+
export const OutputToolSearchServerToolItemFormat = {
|
|
13
|
+
Compact: "compact",
|
|
14
|
+
};
|
|
9
15
|
export const OutputToolSearchServerToolItemType = {
|
|
10
16
|
OpenrouterToolSearch: "openrouter:tool_search",
|
|
11
17
|
};
|
|
12
18
|
/** @internal */
|
|
19
|
+
export const OutputToolSearchServerToolItemFormat$inboundSchema = z.enum(OutputToolSearchServerToolItemFormat);
|
|
20
|
+
/** @internal */
|
|
21
|
+
export const OutputToolSearchServerToolItemFormat$outboundSchema = OutputToolSearchServerToolItemFormat$inboundSchema;
|
|
22
|
+
/** @internal */
|
|
13
23
|
export const Match$inboundSchema = z.object({
|
|
14
24
|
definition: z.record(z.string(), z.any()),
|
|
15
25
|
schema_digest: z.string(),
|
|
@@ -43,21 +53,45 @@ export const OutputToolSearchServerToolItemType$inboundSchema = z.enum(OutputToo
|
|
|
43
53
|
export const OutputToolSearchServerToolItemType$outboundSchema = OutputToolSearchServerToolItemType$inboundSchema;
|
|
44
54
|
/** @internal */
|
|
45
55
|
export const OutputToolSearchServerToolItem$inboundSchema = z.object({
|
|
56
|
+
arguments: z.string().optional(),
|
|
57
|
+
call_id: z.string().optional(),
|
|
58
|
+
catalog_index: z.string().optional(),
|
|
46
59
|
error: z.string().optional(),
|
|
60
|
+
format: OutputToolSearchServerToolItemFormat$inboundSchema.optional(),
|
|
61
|
+
hint: z.string().optional(),
|
|
47
62
|
id: z.string().optional(),
|
|
48
63
|
matches: z.array(z.lazy(() => Match$inboundSchema)).optional(),
|
|
49
64
|
query: z.string().optional(),
|
|
50
65
|
status: FailableToolCallStatus$inboundSchema,
|
|
66
|
+
turn_call_ids: z.array(z.string()).optional(),
|
|
51
67
|
type: OutputToolSearchServerToolItemType$inboundSchema,
|
|
68
|
+
}).transform((v) => {
|
|
69
|
+
return remap$(v, {
|
|
70
|
+
"call_id": "callId",
|
|
71
|
+
"catalog_index": "catalogIndex",
|
|
72
|
+
"turn_call_ids": "turnCallIds",
|
|
73
|
+
});
|
|
52
74
|
});
|
|
53
75
|
/** @internal */
|
|
54
76
|
export const OutputToolSearchServerToolItem$outboundSchema = z.object({
|
|
77
|
+
arguments: z.string().optional(),
|
|
78
|
+
callId: z.string().optional(),
|
|
79
|
+
catalogIndex: z.string().optional(),
|
|
55
80
|
error: z.string().optional(),
|
|
81
|
+
format: OutputToolSearchServerToolItemFormat$outboundSchema.optional(),
|
|
82
|
+
hint: z.string().optional(),
|
|
56
83
|
id: z.string().optional(),
|
|
57
84
|
matches: z.array(z.lazy(() => Match$outboundSchema)).optional(),
|
|
58
85
|
query: z.string().optional(),
|
|
59
86
|
status: FailableToolCallStatus$outboundSchema,
|
|
87
|
+
turnCallIds: z.array(z.string()).optional(),
|
|
60
88
|
type: OutputToolSearchServerToolItemType$outboundSchema,
|
|
89
|
+
}).transform((v) => {
|
|
90
|
+
return remap$(v, {
|
|
91
|
+
callId: "call_id",
|
|
92
|
+
catalogIndex: "catalog_index",
|
|
93
|
+
turnCallIds: "turn_call_ids",
|
|
94
|
+
});
|
|
61
95
|
});
|
|
62
96
|
export function outputToolSearchServerToolItemToJSON(outputToolSearchServerToolItem) {
|
|
63
97
|
return JSON.stringify(OutputToolSearchServerToolItem$outboundSchema.parse(outputToolSearchServerToolItem));
|
package/jsr.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openrouter/sdk",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.51",
|
|
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 && node scripts/unbarrel-imports.js",
|
|
75
75
|
"prepublishOnly": "npm run build",
|
|
76
|
-
"
|
|
76
|
+
"compile": "tsc && node scripts/unbarrel-imports.js",
|
|
77
|
+
"test": "vitest --run --project unit",
|
|
77
78
|
"test:transit": "exit 0",
|
|
78
79
|
"typecheck:transit": "exit 0",
|
|
79
|
-
"test": "vitest --run --project unit",
|
|
80
|
-
"test:watch": "vitest --watch --project unit",
|
|
81
|
-
"typecheck": "tsc --noEmit",
|
|
82
|
-
"compile": "tsc && node scripts/unbarrel-imports.js",
|
|
83
80
|
"postinstall": "node scripts/check-types.js || true",
|
|
84
|
-
"prepare": "npm run build"
|
|
81
|
+
"prepare": "npm run build",
|
|
82
|
+
"test:e2e": "vitest --run --project e2e",
|
|
83
|
+
"test:watch": "vitest --watch --project unit",
|
|
84
|
+
"typecheck": "tsc --noEmit"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {
|
|
87
87
|
|