@openrouter/sdk 0.3.14 → 0.3.15
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/funcs/analyticsGetUserActivity.d.ts +1 -1
- package/esm/funcs/analyticsGetUserActivity.js +1 -1
- package/esm/funcs/apiKeysCreate.d.ts +3 -0
- package/esm/funcs/apiKeysCreate.js +3 -0
- package/esm/funcs/apiKeysDelete.d.ts +3 -0
- package/esm/funcs/apiKeysDelete.js +3 -0
- package/esm/funcs/apiKeysGet.d.ts +3 -0
- package/esm/funcs/apiKeysGet.js +3 -0
- package/esm/funcs/apiKeysList.d.ts +3 -0
- package/esm/funcs/apiKeysList.js +3 -0
- package/esm/funcs/apiKeysUpdate.d.ts +3 -0
- package/esm/funcs/apiKeysUpdate.js +3 -0
- package/esm/funcs/call-model.js +9 -6
- package/esm/funcs/creditsGetCredits.d.ts +1 -1
- package/esm/funcs/creditsGetCredits.js +1 -1
- package/esm/funcs/guardrailsBulkAssignKeys.d.ts +18 -0
- package/esm/funcs/guardrailsBulkAssignKeys.js +89 -0
- package/esm/funcs/guardrailsBulkAssignMembers.d.ts +18 -0
- package/esm/funcs/guardrailsBulkAssignMembers.js +89 -0
- package/esm/funcs/guardrailsBulkUnassignKeys.d.ts +18 -0
- package/esm/funcs/guardrailsBulkUnassignKeys.js +89 -0
- package/esm/funcs/guardrailsBulkUnassignMembers.d.ts +18 -0
- package/esm/funcs/guardrailsBulkUnassignMembers.js +89 -0
- package/esm/funcs/guardrailsCreate.d.ts +18 -0
- package/esm/funcs/guardrailsCreate.js +83 -0
- package/esm/funcs/guardrailsDelete.d.ts +18 -0
- package/esm/funcs/guardrailsDelete.js +88 -0
- package/esm/funcs/{parametersGetParameters.d.ts → guardrailsGet.d.ts} +6 -3
- package/esm/funcs/guardrailsGet.js +88 -0
- package/esm/funcs/guardrailsList.d.ts +18 -0
- package/esm/funcs/guardrailsList.js +87 -0
- package/esm/funcs/guardrailsListGuardrailKeyAssignments.d.ts +18 -0
- package/esm/funcs/guardrailsListGuardrailKeyAssignments.js +93 -0
- package/esm/funcs/guardrailsListGuardrailMemberAssignments.d.ts +18 -0
- package/esm/funcs/guardrailsListGuardrailMemberAssignments.js +93 -0
- package/esm/funcs/guardrailsListKeyAssignments.d.ts +18 -0
- package/esm/funcs/guardrailsListKeyAssignments.js +87 -0
- package/esm/funcs/guardrailsListMemberAssignments.d.ts +18 -0
- package/esm/funcs/guardrailsListMemberAssignments.js +87 -0
- package/esm/funcs/guardrailsUpdate.d.ts +18 -0
- package/esm/funcs/{parametersGetParameters.js → guardrailsUpdate.js} +24 -32
- package/esm/index.d.ts +4 -3
- package/esm/index.js +3 -1
- package/esm/lib/async-params.d.ts +46 -6
- package/esm/lib/async-params.js +10 -2
- package/esm/lib/config.d.ts +2 -4
- package/esm/lib/config.js +2 -2
- package/esm/lib/conversation-state.d.ts +61 -0
- package/esm/lib/conversation-state.js +207 -0
- package/esm/lib/model-result.d.ts +175 -2
- package/esm/lib/model-result.js +678 -181
- package/esm/lib/tool-types.d.ts +108 -0
- package/esm/lib/tool-types.js +13 -0
- package/esm/lib/tool.d.ts +21 -1
- package/esm/lib/tool.js +7 -0
- package/esm/models/assistantmessage.d.ts +31 -0
- package/esm/models/assistantmessage.js +43 -0
- package/esm/models/chatmessagecontentitemimage.d.ts +8 -8
- package/esm/models/chatmessagecontentitemimage.js +8 -9
- package/esm/models/chatresponsechoice.d.ts +0 -2
- package/esm/models/chatresponsechoice.js +0 -3
- package/esm/models/chatstreamingmessagechunk.d.ts +2 -2
- package/esm/models/chatstreamingmessagechunk.js +2 -2
- package/esm/models/index.d.ts +1 -1
- package/esm/models/index.js +1 -1
- package/esm/models/model.d.ts +4 -0
- package/esm/models/model.js +2 -0
- package/esm/models/operations/bulkassignkeystoguardrail.d.ts +44 -0
- package/esm/models/operations/bulkassignkeystoguardrail.js +42 -0
- package/esm/models/operations/bulkassignmemberstoguardrail.d.ts +44 -0
- package/esm/models/operations/bulkassignmemberstoguardrail.js +42 -0
- package/esm/models/operations/bulkunassignkeysfromguardrail.d.ts +44 -0
- package/esm/models/operations/bulkunassignkeysfromguardrail.js +42 -0
- package/esm/models/operations/bulkunassignmembersfromguardrail.d.ts +44 -0
- package/esm/models/operations/bulkunassignmembersfromguardrail.js +42 -0
- package/esm/models/operations/createguardrail.d.ts +136 -0
- package/esm/models/operations/createguardrail.js +85 -0
- package/esm/models/operations/deleteguardrail.d.ts +29 -0
- package/esm/models/operations/deleteguardrail.js +21 -0
- package/esm/models/operations/getguardrail.d.ts +92 -0
- package/esm/models/operations/getguardrail.js +60 -0
- package/esm/models/operations/getmodels.d.ts +28 -1
- package/esm/models/operations/getmodels.js +22 -1
- package/esm/models/operations/index.d.ts +13 -1
- package/esm/models/operations/index.js +13 -1
- package/esm/models/operations/listguardrailkeyassignments.d.ts +76 -0
- package/esm/models/operations/listguardrailkeyassignments.js +51 -0
- package/esm/models/operations/listguardrailmemberassignments.d.ts +72 -0
- package/esm/models/operations/listguardrailmemberassignments.js +49 -0
- package/esm/models/operations/listguardrails.d.ts +98 -0
- package/esm/models/operations/listguardrails.js +66 -0
- package/esm/models/operations/listkeyassignments.d.ts +71 -0
- package/esm/models/operations/listkeyassignments.js +50 -0
- package/esm/models/operations/listmemberassignments.d.ts +67 -0
- package/esm/models/operations/listmemberassignments.js +48 -0
- package/esm/models/operations/updateguardrail.d.ts +151 -0
- package/esm/models/operations/updateguardrail.js +97 -0
- package/esm/models/percentilelatencycutoffs.js +1 -1
- package/esm/models/percentilestats.js +1 -1
- package/esm/models/percentilethroughputcutoffs.js +1 -1
- package/esm/models/preferredmaxlatency.js +1 -1
- package/esm/models/preferredminthroughput.js +1 -1
- package/esm/models/responseinputvideo.js +1 -1
- package/esm/models/responsesoutputmodality.js +1 -1
- package/esm/models/schema2.d.ts +92 -0
- package/esm/models/schema2.js +109 -0
- package/esm/sdk/analytics.d.ts +1 -1
- package/esm/sdk/analytics.js +1 -1
- package/esm/sdk/apikeys.d.ts +15 -0
- package/esm/sdk/apikeys.js +15 -0
- package/esm/sdk/credits.d.ts +1 -1
- package/esm/sdk/credits.js +1 -1
- package/esm/sdk/guardrails.d.ts +96 -0
- package/esm/sdk/guardrails.js +139 -0
- package/esm/sdk/sdk.d.ts +3 -3
- package/esm/sdk/sdk.js +4 -4
- package/esm/types/index.d.ts +2 -0
- package/esm/types/index.js +1 -0
- package/esm/types/models.d.ts +25 -0
- package/esm/types/models.js +10 -0
- package/jsr.json +1 -1
- package/package.json +12 -10
- package/scripts/check-types.js +127 -0
- package/esm/models/operations/getparameters.d.ts +0 -87
- package/esm/models/operations/getparameters.js +0 -73
- package/esm/models/schema3.d.ts +0 -51
- package/esm/models/schema3.js +0 -62
- package/esm/sdk/parameters.d.ts +0 -9
- package/esm/sdk/parameters.js +0 -16
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openrouter/sdk",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.15",
|
|
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": [
|
|
@@ -64,15 +64,17 @@
|
|
|
64
64
|
"type": "git",
|
|
65
65
|
"url": "https://github.com/OpenRouterTeam/typescript-sdk.git"
|
|
66
66
|
},
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
67
|
+
"scripts": {
|
|
68
|
+
"lint": "eslint --cache --max-warnings=0 src",
|
|
69
|
+
"build": "tsc",
|
|
70
|
+
"typecheck": "tsc --noEmit",
|
|
71
|
+
"prepublishOnly": "npm run build",
|
|
72
|
+
"postinstall": "node scripts/check-types.js || true",
|
|
73
|
+
"test": "vitest --run --project unit",
|
|
74
|
+
"test:e2e": "vitest --run --project e2e",
|
|
75
|
+
"test:watch": "vitest --watch --project unit"
|
|
76
|
+
},
|
|
77
|
+
"peerDependencies": {},
|
|
76
78
|
"devDependencies": {
|
|
77
79
|
"@eslint/js": "^9.19.0",
|
|
78
80
|
"@types/node": "^22.13.12",
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Postinstall script to check if model types are stale.
|
|
4
|
+
* Similar to update-browserslist-db, this warns users when their
|
|
5
|
+
* generated types are outdated.
|
|
6
|
+
*
|
|
7
|
+
* This script:
|
|
8
|
+
* 1. Reads the MODEL_HASH from the generated types file
|
|
9
|
+
* 2. Fetches current models from the OpenRouter API
|
|
10
|
+
* 3. Computes a hash of the current models
|
|
11
|
+
* 4. Warns to stderr if the hashes don't match
|
|
12
|
+
*
|
|
13
|
+
* Exit codes:
|
|
14
|
+
* - 0: Types are up to date OR check was skipped
|
|
15
|
+
* - Does NOT fail on stale types (to avoid breaking installs)
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
import { createHash } from 'node:crypto';
|
|
19
|
+
import { readFile } from 'node:fs/promises';
|
|
20
|
+
import { fileURLToPath } from 'node:url';
|
|
21
|
+
import { dirname, resolve } from 'node:path';
|
|
22
|
+
|
|
23
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
24
|
+
const __dirname = dirname(__filename);
|
|
25
|
+
|
|
26
|
+
const TYPES_FILE_PATH = resolve(__dirname, '../src/types/models.ts');
|
|
27
|
+
const API_URL = 'https://openrouter.ai/api/v1/models';
|
|
28
|
+
const TIMEOUT_MS = 5000;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Type guard for Node.js errors with error codes
|
|
32
|
+
* @param {unknown} error
|
|
33
|
+
* @returns {error is NodeJS.ErrnoException}
|
|
34
|
+
*/
|
|
35
|
+
function isNodeError(error) {
|
|
36
|
+
return error instanceof Error && 'code' in error;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Compute SHA-256 hash of sorted model IDs (first 16 chars)
|
|
41
|
+
* @param {string[]} modelIds
|
|
42
|
+
* @returns {string}
|
|
43
|
+
*/
|
|
44
|
+
function computeHash(modelIds) {
|
|
45
|
+
const sorted = [...modelIds].sort();
|
|
46
|
+
const content = sorted.join('\n');
|
|
47
|
+
const hash = createHash('sha256').update(content).digest('hex');
|
|
48
|
+
return hash.substring(0, 16);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Extract MODEL_HASH from types file content
|
|
53
|
+
* @param {string} content
|
|
54
|
+
* @returns {string | null}
|
|
55
|
+
*/
|
|
56
|
+
function extractHash(content) {
|
|
57
|
+
const match = content.match(/export const MODEL_HASH = '([a-f0-9]+)'/);
|
|
58
|
+
return match ? match[1] : null;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Fetch models from API with timeout
|
|
63
|
+
* @returns {Promise<string[]>}
|
|
64
|
+
*/
|
|
65
|
+
async function fetchModels() {
|
|
66
|
+
const controller = new AbortController();
|
|
67
|
+
const timeout = setTimeout(() => controller.abort(), TIMEOUT_MS);
|
|
68
|
+
|
|
69
|
+
try {
|
|
70
|
+
const response = await fetch(API_URL, { signal: controller.signal });
|
|
71
|
+
if (!response.ok) {
|
|
72
|
+
throw new Error(`HTTP ${response.status}`);
|
|
73
|
+
}
|
|
74
|
+
const data = await response.json();
|
|
75
|
+
if (!data?.data || !Array.isArray(data.data)) {
|
|
76
|
+
throw new Error('Invalid API response structure');
|
|
77
|
+
}
|
|
78
|
+
return data.data.map((m) => m.id);
|
|
79
|
+
} finally {
|
|
80
|
+
clearTimeout(timeout);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
async function main() {
|
|
85
|
+
if (process.env.CI) {
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
if (process.env.OPENROUTER_SKIP_TYPE_CHECK) {
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
try {
|
|
94
|
+
/** @type {string | null} */
|
|
95
|
+
let existingHash;
|
|
96
|
+
try {
|
|
97
|
+
const content = await readFile(TYPES_FILE_PATH, 'utf-8');
|
|
98
|
+
existingHash = extractHash(content);
|
|
99
|
+
} catch (error) {
|
|
100
|
+
if (isNodeError(error) && error.code === 'ENOENT') {
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
throw error;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
if (!existingHash) {
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
const modelIds = await fetchModels();
|
|
111
|
+
const currentHash = computeHash(modelIds);
|
|
112
|
+
|
|
113
|
+
if (existingHash !== currentHash) {
|
|
114
|
+
process.stderr.write(
|
|
115
|
+
'\n' +
|
|
116
|
+
'\x1b[33m' +
|
|
117
|
+
'OpenRouter model types are outdated.\n' +
|
|
118
|
+
'Run: npx @openrouter/cli types\n' +
|
|
119
|
+
'\x1b[0m',
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
} catch {
|
|
123
|
+
// Silently ignore errors - we don't want to break installs
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
main();
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import * as z from "zod/v4";
|
|
2
|
-
import { OpenEnum } from "../../types/enums.js";
|
|
3
|
-
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
4
|
-
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
5
|
-
import * as models from "../index.js";
|
|
6
|
-
export type GetParametersSecurity = {
|
|
7
|
-
bearer: string;
|
|
8
|
-
};
|
|
9
|
-
export type GetParametersRequest = {
|
|
10
|
-
author: string;
|
|
11
|
-
slug: string;
|
|
12
|
-
provider?: models.ProviderName | undefined;
|
|
13
|
-
};
|
|
14
|
-
export declare const SupportedParameter: {
|
|
15
|
-
readonly Temperature: "temperature";
|
|
16
|
-
readonly TopP: "top_p";
|
|
17
|
-
readonly TopK: "top_k";
|
|
18
|
-
readonly MinP: "min_p";
|
|
19
|
-
readonly TopA: "top_a";
|
|
20
|
-
readonly FrequencyPenalty: "frequency_penalty";
|
|
21
|
-
readonly PresencePenalty: "presence_penalty";
|
|
22
|
-
readonly RepetitionPenalty: "repetition_penalty";
|
|
23
|
-
readonly MaxTokens: "max_tokens";
|
|
24
|
-
readonly LogitBias: "logit_bias";
|
|
25
|
-
readonly Logprobs: "logprobs";
|
|
26
|
-
readonly TopLogprobs: "top_logprobs";
|
|
27
|
-
readonly Seed: "seed";
|
|
28
|
-
readonly ResponseFormat: "response_format";
|
|
29
|
-
readonly StructuredOutputs: "structured_outputs";
|
|
30
|
-
readonly Stop: "stop";
|
|
31
|
-
readonly Tools: "tools";
|
|
32
|
-
readonly ToolChoice: "tool_choice";
|
|
33
|
-
readonly ParallelToolCalls: "parallel_tool_calls";
|
|
34
|
-
readonly IncludeReasoning: "include_reasoning";
|
|
35
|
-
readonly Reasoning: "reasoning";
|
|
36
|
-
readonly ReasoningEffort: "reasoning_effort";
|
|
37
|
-
readonly WebSearchOptions: "web_search_options";
|
|
38
|
-
readonly Verbosity: "verbosity";
|
|
39
|
-
};
|
|
40
|
-
export type SupportedParameter = OpenEnum<typeof SupportedParameter>;
|
|
41
|
-
/**
|
|
42
|
-
* Parameter analytics data
|
|
43
|
-
*/
|
|
44
|
-
export type GetParametersData = {
|
|
45
|
-
/**
|
|
46
|
-
* Model identifier
|
|
47
|
-
*/
|
|
48
|
-
model: string;
|
|
49
|
-
/**
|
|
50
|
-
* List of parameters supported by this model
|
|
51
|
-
*/
|
|
52
|
-
supportedParameters: Array<SupportedParameter>;
|
|
53
|
-
};
|
|
54
|
-
/**
|
|
55
|
-
* Returns the parameters for the specified model
|
|
56
|
-
*/
|
|
57
|
-
export type GetParametersResponse = {
|
|
58
|
-
/**
|
|
59
|
-
* Parameter analytics data
|
|
60
|
-
*/
|
|
61
|
-
data: GetParametersData;
|
|
62
|
-
};
|
|
63
|
-
/** @internal */
|
|
64
|
-
export type GetParametersSecurity$Outbound = {
|
|
65
|
-
bearer: string;
|
|
66
|
-
};
|
|
67
|
-
/** @internal */
|
|
68
|
-
export declare const GetParametersSecurity$outboundSchema: z.ZodType<GetParametersSecurity$Outbound, GetParametersSecurity>;
|
|
69
|
-
export declare function getParametersSecurityToJSON(getParametersSecurity: GetParametersSecurity): string;
|
|
70
|
-
/** @internal */
|
|
71
|
-
export type GetParametersRequest$Outbound = {
|
|
72
|
-
author: string;
|
|
73
|
-
slug: string;
|
|
74
|
-
provider?: string | undefined;
|
|
75
|
-
};
|
|
76
|
-
/** @internal */
|
|
77
|
-
export declare const GetParametersRequest$outboundSchema: z.ZodType<GetParametersRequest$Outbound, GetParametersRequest>;
|
|
78
|
-
export declare function getParametersRequestToJSON(getParametersRequest: GetParametersRequest): string;
|
|
79
|
-
/** @internal */
|
|
80
|
-
export declare const SupportedParameter$inboundSchema: z.ZodType<SupportedParameter, unknown>;
|
|
81
|
-
/** @internal */
|
|
82
|
-
export declare const GetParametersData$inboundSchema: z.ZodType<GetParametersData, unknown>;
|
|
83
|
-
export declare function getParametersDataFromJSON(jsonString: string): SafeParseResult<GetParametersData, SDKValidationError>;
|
|
84
|
-
/** @internal */
|
|
85
|
-
export declare const GetParametersResponse$inboundSchema: z.ZodType<GetParametersResponse, unknown>;
|
|
86
|
-
export declare function getParametersResponseFromJSON(jsonString: string): SafeParseResult<GetParametersResponse, SDKValidationError>;
|
|
87
|
-
//# sourceMappingURL=getparameters.d.ts.map
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
* @generated-id: 9b364a4cca61
|
|
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 * as openEnums from "../../types/enums.js";
|
|
9
|
-
import * as models from "../index.js";
|
|
10
|
-
export const SupportedParameter = {
|
|
11
|
-
Temperature: "temperature",
|
|
12
|
-
TopP: "top_p",
|
|
13
|
-
TopK: "top_k",
|
|
14
|
-
MinP: "min_p",
|
|
15
|
-
TopA: "top_a",
|
|
16
|
-
FrequencyPenalty: "frequency_penalty",
|
|
17
|
-
PresencePenalty: "presence_penalty",
|
|
18
|
-
RepetitionPenalty: "repetition_penalty",
|
|
19
|
-
MaxTokens: "max_tokens",
|
|
20
|
-
LogitBias: "logit_bias",
|
|
21
|
-
Logprobs: "logprobs",
|
|
22
|
-
TopLogprobs: "top_logprobs",
|
|
23
|
-
Seed: "seed",
|
|
24
|
-
ResponseFormat: "response_format",
|
|
25
|
-
StructuredOutputs: "structured_outputs",
|
|
26
|
-
Stop: "stop",
|
|
27
|
-
Tools: "tools",
|
|
28
|
-
ToolChoice: "tool_choice",
|
|
29
|
-
ParallelToolCalls: "parallel_tool_calls",
|
|
30
|
-
IncludeReasoning: "include_reasoning",
|
|
31
|
-
Reasoning: "reasoning",
|
|
32
|
-
ReasoningEffort: "reasoning_effort",
|
|
33
|
-
WebSearchOptions: "web_search_options",
|
|
34
|
-
Verbosity: "verbosity",
|
|
35
|
-
};
|
|
36
|
-
/** @internal */
|
|
37
|
-
export const GetParametersSecurity$outboundSchema = z.object({
|
|
38
|
-
bearer: z.string(),
|
|
39
|
-
});
|
|
40
|
-
export function getParametersSecurityToJSON(getParametersSecurity) {
|
|
41
|
-
return JSON.stringify(GetParametersSecurity$outboundSchema.parse(getParametersSecurity));
|
|
42
|
-
}
|
|
43
|
-
/** @internal */
|
|
44
|
-
export const GetParametersRequest$outboundSchema = z.object({
|
|
45
|
-
author: z.string(),
|
|
46
|
-
slug: z.string(),
|
|
47
|
-
provider: models.ProviderName$outboundSchema.optional(),
|
|
48
|
-
});
|
|
49
|
-
export function getParametersRequestToJSON(getParametersRequest) {
|
|
50
|
-
return JSON.stringify(GetParametersRequest$outboundSchema.parse(getParametersRequest));
|
|
51
|
-
}
|
|
52
|
-
/** @internal */
|
|
53
|
-
export const SupportedParameter$inboundSchema = openEnums.inboundSchema(SupportedParameter);
|
|
54
|
-
/** @internal */
|
|
55
|
-
export const GetParametersData$inboundSchema = z.object({
|
|
56
|
-
model: z.string(),
|
|
57
|
-
supported_parameters: z.array(SupportedParameter$inboundSchema),
|
|
58
|
-
}).transform((v) => {
|
|
59
|
-
return remap$(v, {
|
|
60
|
-
"supported_parameters": "supportedParameters",
|
|
61
|
-
});
|
|
62
|
-
});
|
|
63
|
-
export function getParametersDataFromJSON(jsonString) {
|
|
64
|
-
return safeParse(jsonString, (x) => GetParametersData$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetParametersData' from JSON`);
|
|
65
|
-
}
|
|
66
|
-
/** @internal */
|
|
67
|
-
export const GetParametersResponse$inboundSchema = z.object({
|
|
68
|
-
data: z.lazy(() => GetParametersData$inboundSchema),
|
|
69
|
-
});
|
|
70
|
-
export function getParametersResponseFromJSON(jsonString) {
|
|
71
|
-
return safeParse(jsonString, (x) => GetParametersResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetParametersResponse' from JSON`);
|
|
72
|
-
}
|
|
73
|
-
//# sourceMappingURL=getparameters.js.map
|
package/esm/models/schema3.d.ts
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import * as z from "zod/v4";
|
|
2
|
-
import { OpenEnum } from "../types/enums.js";
|
|
3
|
-
import { Result as SafeParseResult } from "../types/fp.js";
|
|
4
|
-
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
|
-
export declare const Schema5: {
|
|
6
|
-
readonly Unknown: "unknown";
|
|
7
|
-
readonly OpenaiResponsesV1: "openai-responses-v1";
|
|
8
|
-
readonly AzureOpenaiResponsesV1: "azure-openai-responses-v1";
|
|
9
|
-
readonly XaiResponsesV1: "xai-responses-v1";
|
|
10
|
-
readonly AnthropicClaudeV1: "anthropic-claude-v1";
|
|
11
|
-
readonly GoogleGeminiV1: "google-gemini-v1";
|
|
12
|
-
};
|
|
13
|
-
export type Schema5 = OpenEnum<typeof Schema5>;
|
|
14
|
-
export type Schema3ReasoningText = {
|
|
15
|
-
type: "reasoning.text";
|
|
16
|
-
text?: string | null | undefined;
|
|
17
|
-
signature?: string | null | undefined;
|
|
18
|
-
id?: string | null | undefined;
|
|
19
|
-
format?: Schema5 | null | undefined;
|
|
20
|
-
index?: number | undefined;
|
|
21
|
-
};
|
|
22
|
-
export type Schema3ReasoningEncrypted = {
|
|
23
|
-
type: "reasoning.encrypted";
|
|
24
|
-
data: string;
|
|
25
|
-
id?: string | null | undefined;
|
|
26
|
-
format?: Schema5 | null | undefined;
|
|
27
|
-
index?: number | undefined;
|
|
28
|
-
};
|
|
29
|
-
export type Schema3ReasoningSummary = {
|
|
30
|
-
type: "reasoning.summary";
|
|
31
|
-
summary: string;
|
|
32
|
-
id?: string | null | undefined;
|
|
33
|
-
format?: Schema5 | null | undefined;
|
|
34
|
-
index?: number | undefined;
|
|
35
|
-
};
|
|
36
|
-
export type Schema3 = Schema3ReasoningSummary | Schema3ReasoningEncrypted | Schema3ReasoningText;
|
|
37
|
-
/** @internal */
|
|
38
|
-
export declare const Schema5$inboundSchema: z.ZodType<Schema5, unknown>;
|
|
39
|
-
/** @internal */
|
|
40
|
-
export declare const Schema3ReasoningText$inboundSchema: z.ZodType<Schema3ReasoningText, unknown>;
|
|
41
|
-
export declare function schema3ReasoningTextFromJSON(jsonString: string): SafeParseResult<Schema3ReasoningText, SDKValidationError>;
|
|
42
|
-
/** @internal */
|
|
43
|
-
export declare const Schema3ReasoningEncrypted$inboundSchema: z.ZodType<Schema3ReasoningEncrypted, unknown>;
|
|
44
|
-
export declare function schema3ReasoningEncryptedFromJSON(jsonString: string): SafeParseResult<Schema3ReasoningEncrypted, SDKValidationError>;
|
|
45
|
-
/** @internal */
|
|
46
|
-
export declare const Schema3ReasoningSummary$inboundSchema: z.ZodType<Schema3ReasoningSummary, unknown>;
|
|
47
|
-
export declare function schema3ReasoningSummaryFromJSON(jsonString: string): SafeParseResult<Schema3ReasoningSummary, SDKValidationError>;
|
|
48
|
-
/** @internal */
|
|
49
|
-
export declare const Schema3$inboundSchema: z.ZodType<Schema3, unknown>;
|
|
50
|
-
export declare function schema3FromJSON(jsonString: string): SafeParseResult<Schema3, SDKValidationError>;
|
|
51
|
-
//# sourceMappingURL=schema3.d.ts.map
|
package/esm/models/schema3.js
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
* @generated-id: 6f7380bcbcea
|
|
4
|
-
*/
|
|
5
|
-
import * as z from "zod/v4";
|
|
6
|
-
import { safeParse } from "../lib/schemas.js";
|
|
7
|
-
import * as openEnums from "../types/enums.js";
|
|
8
|
-
export const Schema5 = {
|
|
9
|
-
Unknown: "unknown",
|
|
10
|
-
OpenaiResponsesV1: "openai-responses-v1",
|
|
11
|
-
AzureOpenaiResponsesV1: "azure-openai-responses-v1",
|
|
12
|
-
XaiResponsesV1: "xai-responses-v1",
|
|
13
|
-
AnthropicClaudeV1: "anthropic-claude-v1",
|
|
14
|
-
GoogleGeminiV1: "google-gemini-v1",
|
|
15
|
-
};
|
|
16
|
-
/** @internal */
|
|
17
|
-
export const Schema5$inboundSchema = openEnums
|
|
18
|
-
.inboundSchema(Schema5);
|
|
19
|
-
/** @internal */
|
|
20
|
-
export const Schema3ReasoningText$inboundSchema = z.object({
|
|
21
|
-
type: z.literal("reasoning.text"),
|
|
22
|
-
text: z.nullable(z.string()).optional(),
|
|
23
|
-
signature: z.nullable(z.string()).optional(),
|
|
24
|
-
id: z.nullable(z.string()).optional(),
|
|
25
|
-
format: z.nullable(Schema5$inboundSchema).optional(),
|
|
26
|
-
index: z.number().optional(),
|
|
27
|
-
});
|
|
28
|
-
export function schema3ReasoningTextFromJSON(jsonString) {
|
|
29
|
-
return safeParse(jsonString, (x) => Schema3ReasoningText$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Schema3ReasoningText' from JSON`);
|
|
30
|
-
}
|
|
31
|
-
/** @internal */
|
|
32
|
-
export const Schema3ReasoningEncrypted$inboundSchema = z.object({
|
|
33
|
-
type: z.literal("reasoning.encrypted"),
|
|
34
|
-
data: z.string(),
|
|
35
|
-
id: z.nullable(z.string()).optional(),
|
|
36
|
-
format: z.nullable(Schema5$inboundSchema).optional(),
|
|
37
|
-
index: z.number().optional(),
|
|
38
|
-
});
|
|
39
|
-
export function schema3ReasoningEncryptedFromJSON(jsonString) {
|
|
40
|
-
return safeParse(jsonString, (x) => Schema3ReasoningEncrypted$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Schema3ReasoningEncrypted' from JSON`);
|
|
41
|
-
}
|
|
42
|
-
/** @internal */
|
|
43
|
-
export const Schema3ReasoningSummary$inboundSchema = z.object({
|
|
44
|
-
type: z.literal("reasoning.summary"),
|
|
45
|
-
summary: z.string(),
|
|
46
|
-
id: z.nullable(z.string()).optional(),
|
|
47
|
-
format: z.nullable(Schema5$inboundSchema).optional(),
|
|
48
|
-
index: z.number().optional(),
|
|
49
|
-
});
|
|
50
|
-
export function schema3ReasoningSummaryFromJSON(jsonString) {
|
|
51
|
-
return safeParse(jsonString, (x) => Schema3ReasoningSummary$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Schema3ReasoningSummary' from JSON`);
|
|
52
|
-
}
|
|
53
|
-
/** @internal */
|
|
54
|
-
export const Schema3$inboundSchema = z.union([
|
|
55
|
-
z.lazy(() => Schema3ReasoningSummary$inboundSchema),
|
|
56
|
-
z.lazy(() => Schema3ReasoningEncrypted$inboundSchema),
|
|
57
|
-
z.lazy(() => Schema3ReasoningText$inboundSchema),
|
|
58
|
-
]);
|
|
59
|
-
export function schema3FromJSON(jsonString) {
|
|
60
|
-
return safeParse(jsonString, (x) => Schema3$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Schema3' from JSON`);
|
|
61
|
-
}
|
|
62
|
-
//# sourceMappingURL=schema3.js.map
|
package/esm/sdk/parameters.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
|
|
2
|
-
import * as operations from "../models/operations/index.js";
|
|
3
|
-
export declare class ParametersT extends ClientSDK {
|
|
4
|
-
/**
|
|
5
|
-
* Get a model's supported parameters and data about which are most popular
|
|
6
|
-
*/
|
|
7
|
-
getParameters(security: operations.GetParametersSecurity, request: operations.GetParametersRequest, options?: RequestOptions): Promise<operations.GetParametersResponse>;
|
|
8
|
-
}
|
|
9
|
-
//# sourceMappingURL=parameters.d.ts.map
|
package/esm/sdk/parameters.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
* @generated-id: 6e4ef00c29b7
|
|
4
|
-
*/
|
|
5
|
-
import { parametersGetParameters } from "../funcs/parametersGetParameters.js";
|
|
6
|
-
import { ClientSDK } from "../lib/sdks.js";
|
|
7
|
-
import { unwrapAsync } from "../types/fp.js";
|
|
8
|
-
export class ParametersT extends ClientSDK {
|
|
9
|
-
/**
|
|
10
|
-
* Get a model's supported parameters and data about which are most popular
|
|
11
|
-
*/
|
|
12
|
-
async getParameters(security, request, options) {
|
|
13
|
-
return unwrapAsync(parametersGetParameters(this, security, request, options));
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
//# sourceMappingURL=parameters.js.map
|