@openrouter/sdk 0.3.10 → 0.3.11
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 +4 -2
- package/esm/lib/config.js +2 -2
- package/esm/lib/tool-executor.d.ts +2 -1
- package/esm/lib/tool-executor.js +3 -1
- package/esm/lib/tool-types.d.ts +1 -1
- package/esm/lib/tool.d.ts +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
package/esm/lib/config.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { SDKHooks } from "../hooks/hooks.js";
|
|
1
2
|
import { HTTPClient } from "./http.js";
|
|
2
3
|
import { Logger } from "./logger.js";
|
|
3
4
|
import { RetryConfig } from "./retries.js";
|
|
@@ -40,13 +41,14 @@ export type SDKOptions = {
|
|
|
40
41
|
retryConfig?: RetryConfig;
|
|
41
42
|
timeoutMs?: number;
|
|
42
43
|
debugLogger?: Logger;
|
|
44
|
+
hooks?: SDKHooks;
|
|
43
45
|
};
|
|
44
46
|
export declare function serverURLFromOptions(options: SDKOptions): URL | null;
|
|
45
47
|
export declare const SDK_METADATA: {
|
|
46
48
|
readonly language: "typescript";
|
|
47
49
|
readonly openapiDocVersion: "1.0.0";
|
|
48
|
-
readonly sdkVersion: "0.3.
|
|
50
|
+
readonly sdkVersion: "0.3.11";
|
|
49
51
|
readonly genVersion: "2.788.4";
|
|
50
|
-
readonly userAgent: "speakeasy-sdk/typescript 0.3.
|
|
52
|
+
readonly userAgent: "speakeasy-sdk/typescript 0.3.11 2.788.4 1.0.0 @openrouter/sdk";
|
|
51
53
|
};
|
|
52
54
|
//# 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.3.
|
|
29
|
+
sdkVersion: "0.3.11",
|
|
30
30
|
genVersion: "2.788.4",
|
|
31
|
-
userAgent: "speakeasy-sdk/typescript 0.3.
|
|
31
|
+
userAgent: "speakeasy-sdk/typescript 0.3.11 2.788.4 1.0.0 @openrouter/sdk",
|
|
32
32
|
};
|
|
33
33
|
//# sourceMappingURL=config.js.map
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import type { ZodType } from 'zod
|
|
1
|
+
import type { ZodType } from 'zod';
|
|
2
2
|
import type { APITool, Tool, ParsedToolCall, ToolExecutionResult, TurnContext } from './tool-types.js';
|
|
3
3
|
/**
|
|
4
4
|
* Convert a Zod schema to JSON Schema using Zod v4's toJSONSchema function
|
|
5
|
+
* Uses type assertion to bridge zod (user schemas) and zod/v4 (toJSONSchema)
|
|
5
6
|
*/
|
|
6
7
|
export declare function convertZodToJsonSchema(zodSchema: ZodType): Record<string, unknown>;
|
|
7
8
|
/**
|
package/esm/lib/tool-executor.js
CHANGED
|
@@ -2,10 +2,12 @@ import { toJSONSchema, ZodError } from 'zod/v4';
|
|
|
2
2
|
import { hasExecuteFunction, isGeneratorTool, isRegularExecuteTool } from './tool-types.js';
|
|
3
3
|
/**
|
|
4
4
|
* Convert a Zod schema to JSON Schema using Zod v4's toJSONSchema function
|
|
5
|
+
* Uses type assertion to bridge zod (user schemas) and zod/v4 (toJSONSchema)
|
|
5
6
|
*/
|
|
6
7
|
export function convertZodToJsonSchema(zodSchema) {
|
|
8
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
7
9
|
const jsonSchema = toJSONSchema(zodSchema, {
|
|
8
|
-
target: '
|
|
10
|
+
target: 'draft-7',
|
|
9
11
|
});
|
|
10
12
|
return jsonSchema;
|
|
11
13
|
}
|
package/esm/lib/tool-types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ZodObject, ZodRawShape, ZodType, z } from 'zod
|
|
1
|
+
import type { ZodObject, ZodRawShape, ZodType, z } from 'zod';
|
|
2
2
|
import type * as models from '../models/index.js';
|
|
3
3
|
import type { OpenResponsesStreamEvent } from '../models/index.js';
|
|
4
4
|
import type { ModelResult } from './model-result.js';
|
package/esm/lib/tool.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ZodObject, ZodRawShape, ZodType, z } from "zod
|
|
1
|
+
import type { ZodObject, ZodRawShape, ZodType, z } from "zod";
|
|
2
2
|
import { type TurnContext, type ToolWithExecute, type ToolWithGenerator, type ManualTool, type NextTurnParamsFunctions } from "./tool-types.js";
|
|
3
3
|
/**
|
|
4
4
|
* Configuration for a regular tool with outputSchema
|
package/jsr.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openrouter/sdk",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.11",
|
|
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": [
|