@openrouter/sdk 0.0.1-beta.10 → 0.0.1-beta.12
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/FUNCTIONS.md +110 -1
- package/REACT_QUERY.md +110 -1
- package/README.md +682 -14
- package/esm/funcs/analyticsGetUserActivity.d.ts +1 -1
- package/esm/funcs/analyticsGetUserActivity.js +2 -2
- package/esm/funcs/apiKeysCreate.d.ts +1 -1
- package/esm/funcs/apiKeysCreate.js +2 -2
- package/esm/funcs/apiKeysDelete.d.ts +1 -1
- package/esm/funcs/apiKeysDelete.js +2 -2
- package/esm/funcs/apiKeysGet.d.ts +1 -1
- package/esm/funcs/apiKeysGet.js +2 -2
- package/esm/funcs/apiKeysGetCurrentKeyMetadata.d.ts +1 -1
- package/esm/funcs/apiKeysGetCurrentKeyMetadata.js +2 -2
- package/esm/funcs/apiKeysList.d.ts +1 -1
- package/esm/funcs/apiKeysList.js +2 -2
- package/esm/funcs/apiKeysUpdate.d.ts +1 -1
- package/esm/funcs/apiKeysUpdate.js +2 -2
- package/esm/funcs/betaResponsesSend.d.ts +9 -1
- package/esm/funcs/betaResponsesSend.js +36 -12
- package/esm/funcs/chatSend.d.ts +7 -0
- package/esm/funcs/chatSend.js +1 -7
- package/esm/funcs/creditsCreateCoinbaseCharge.d.ts +1 -1
- package/esm/funcs/creditsCreateCoinbaseCharge.js +15 -5
- package/esm/funcs/creditsGetCredits.d.ts +1 -1
- package/esm/funcs/creditsGetCredits.js +2 -2
- package/esm/funcs/endpointsList.d.ts +1 -1
- package/esm/funcs/endpointsList.js +2 -2
- package/esm/funcs/endpointsListZdrEndpoints.d.ts +2 -1
- package/esm/funcs/endpointsListZdrEndpoints.js +6 -2
- package/esm/funcs/generationsGetGeneration.d.ts +1 -1
- package/esm/funcs/generationsGetGeneration.js +13 -2
- package/esm/funcs/modelsCount.d.ts +3 -2
- package/esm/funcs/modelsCount.js +7 -3
- package/esm/funcs/modelsList.d.ts +2 -1
- package/esm/funcs/modelsList.js +6 -2
- package/esm/funcs/modelsListForUser.d.ts +3 -1
- package/esm/funcs/modelsListForUser.js +7 -3
- package/esm/funcs/parametersGetParameters.d.ts +1 -1
- package/esm/funcs/parametersGetParameters.js +2 -2
- package/esm/funcs/providersList.d.ts +1 -1
- package/esm/funcs/providersList.js +1 -1
- package/esm/lib/config.d.ts +3 -3
- package/esm/lib/config.js +3 -3
- package/esm/models/badgatewayresponseerrordata.d.ts +40 -0
- package/esm/models/badgatewayresponseerrordata.js +35 -0
- package/esm/models/badrequestresponseerrordata.d.ts +40 -0
- package/esm/models/badrequestresponseerrordata.js +35 -0
- package/esm/models/chatgenerationparams.d.ts +2 -2
- package/esm/models/chatgenerationparams.js +2 -2
- package/esm/models/chatmessagecontentitemaudio.d.ts +10 -10
- package/esm/models/chatmessagecontentitemaudio.js +14 -14
- package/esm/models/chatstreamingresponsechunk.d.ts +15 -15
- package/esm/models/chatstreamingresponsechunk.js +15 -15
- package/esm/models/completioncreateparams.d.ts +2 -2
- package/esm/models/completioncreateparams.js +2 -2
- package/esm/models/createchargerequest.d.ts +31 -2
- package/esm/models/createchargerequest.js +47 -2
- package/esm/models/defaultparameters.d.ts +36 -0
- package/esm/models/defaultparameters.js +46 -0
- package/esm/models/edgenetworktimeoutresponseerrordata.d.ts +40 -0
- package/esm/models/edgenetworktimeoutresponseerrordata.js +35 -0
- package/esm/models/endpointstatus.d.ts +26 -0
- package/esm/models/endpointstatus.js +36 -0
- package/esm/models/errors/badgatewayresponseerror.d.ts +52 -0
- package/esm/models/errors/badgatewayresponseerror.js +63 -0
- package/esm/models/errors/badrequestresponseerror.d.ts +52 -0
- package/esm/models/errors/badrequestresponseerror.js +63 -0
- package/esm/models/errors/edgenetworktimeoutresponseerror.d.ts +52 -0
- package/esm/models/errors/edgenetworktimeoutresponseerror.js +63 -0
- package/esm/models/errors/forbiddenresponseerror.d.ts +52 -0
- package/esm/models/errors/forbiddenresponseerror.js +63 -0
- package/esm/models/errors/index.d.ts +14 -2
- package/esm/models/errors/index.js +14 -2
- package/esm/models/errors/internalserverresponseerror.d.ts +52 -0
- package/esm/models/errors/internalserverresponseerror.js +63 -0
- package/esm/models/errors/notfoundresponseerror.d.ts +52 -0
- package/esm/models/errors/{errorresponse.js → notfoundresponseerror.js} +16 -17
- package/esm/models/errors/payloadtoolargeresponseerror.d.ts +52 -0
- package/esm/models/errors/payloadtoolargeresponseerror.js +63 -0
- package/esm/models/errors/paymentrequiredresponseerror.d.ts +52 -0
- package/esm/models/errors/paymentrequiredresponseerror.js +63 -0
- package/esm/models/errors/provideroverloadedresponseerror.d.ts +52 -0
- package/esm/models/errors/provideroverloadedresponseerror.js +63 -0
- package/esm/models/errors/requesttimeoutresponseerror.d.ts +52 -0
- package/esm/models/errors/requesttimeoutresponseerror.js +63 -0
- package/esm/models/errors/serviceunavailableresponseerror.d.ts +52 -0
- package/esm/models/errors/serviceunavailableresponseerror.js +63 -0
- package/esm/models/errors/toomanyrequestsresponseerror.d.ts +52 -0
- package/esm/models/errors/toomanyrequestsresponseerror.js +63 -0
- package/esm/models/errors/unauthorizedresponseerror.d.ts +52 -0
- package/esm/models/errors/unauthorizedresponseerror.js +63 -0
- package/esm/models/errors/unprocessableentityresponseerror.d.ts +52 -0
- package/esm/models/errors/unprocessableentityresponseerror.js +63 -0
- package/esm/models/forbiddenresponseerrordata.d.ts +40 -0
- package/esm/models/forbiddenresponseerrordata.js +35 -0
- package/esm/models/index.d.ts +37 -1
- package/esm/models/index.js +37 -1
- package/esm/models/inputmodality.d.ts +24 -0
- package/esm/models/inputmodality.js +34 -0
- package/esm/models/instructtype.d.ts +48 -0
- package/esm/models/instructtype.js +55 -0
- package/esm/models/internalserverresponseerrordata.d.ts +40 -0
- package/esm/models/internalserverresponseerrordata.js +35 -0
- package/esm/models/listendpointsresponse.d.ts +126 -2
- package/esm/models/listendpointsresponse.js +115 -2
- package/esm/models/model.d.ts +101 -0
- package/esm/models/model.js +82 -0
- package/esm/models/modelarchitecture.d.ts +104 -0
- package/esm/models/modelarchitecture.js +107 -0
- package/esm/models/modelgroup.d.ts +45 -0
- package/esm/models/modelgroup.js +53 -0
- package/esm/models/modelscountresponse.d.ts +40 -2
- package/esm/models/modelscountresponse.js +31 -2
- package/esm/models/modelslistresponse.d.ts +10 -2
- package/esm/models/modelslistresponse.js +7 -2
- package/esm/models/notfoundresponseerrordata.d.ts +40 -0
- package/esm/models/notfoundresponseerrordata.js +35 -0
- package/esm/models/openairesponsesincludable.d.ts +25 -0
- package/esm/models/openairesponsesincludable.js +35 -0
- package/esm/models/openairesponsesinputunion.d.ts +78 -78
- package/esm/models/openairesponsesinputunion.js +124 -126
- package/esm/models/openresponseseasyinputmessage.d.ts +246 -0
- package/esm/models/openresponseseasyinputmessage.js +283 -0
- package/esm/models/openresponsesfunctioncalloutput.d.ts +64 -0
- package/esm/models/openresponsesfunctioncalloutput.js +67 -0
- package/esm/models/openresponsesfunctiontoolcall.d.ts +66 -0
- package/esm/models/openresponsesfunctiontoolcall.js +69 -0
- package/esm/models/openresponsesinput.d.ts +60 -0
- package/esm/models/openresponsesinput.js +113 -0
- package/esm/models/openresponsesinputmessageitem.d.ts +193 -0
- package/esm/models/openresponsesinputmessageitem.js +210 -0
- package/esm/models/openresponsesnonstreamingresponse.d.ts +13 -13
- package/esm/models/openresponsesnonstreamingresponse.js +13 -13
- package/esm/models/openresponsesreasoning.d.ts +179 -0
- package/esm/models/openresponsesreasoning.js +194 -0
- package/esm/models/openresponsesreasoningconfig.d.ts +40 -0
- package/esm/models/openresponsesreasoningconfig.js +48 -0
- package/esm/models/openresponsesrequest.d.ts +736 -2
- package/esm/models/openresponsesrequest.js +789 -2
- package/esm/models/openresponsesresponsetext.d.ts +59 -0
- package/esm/models/openresponsesresponsetext.js +64 -0
- package/esm/models/operations/createapialpharesponses.d.ts +3 -3
- package/esm/models/operations/createapialpharesponses.js +0 -2
- package/esm/models/operations/getmodels.d.ts +2 -2
- package/esm/models/operations/getmodels.js +2 -10
- package/esm/models/operations/index.d.ts +0 -1
- package/esm/models/operations/index.js +0 -1
- package/esm/models/operations/listendpointszdr.d.ts +3 -24
- package/esm/models/operations/listendpointszdr.js +2 -29
- package/esm/models/operations/listmodelsuser.d.ts +0 -22
- package/esm/models/operations/listmodelsuser.js +0 -28
- package/esm/models/operations/listproviders.d.ts +0 -36
- package/esm/models/operations/listproviders.js +0 -28
- package/esm/models/outputmodality.d.ts +23 -0
- package/esm/models/outputmodality.js +33 -0
- package/esm/models/parameter.d.ts +43 -0
- package/esm/models/parameter.js +54 -0
- package/esm/models/payloadtoolargeresponseerrordata.d.ts +40 -0
- package/esm/models/payloadtoolargeresponseerrordata.js +35 -0
- package/esm/models/paymentrequiredresponseerrordata.d.ts +40 -0
- package/esm/models/paymentrequiredresponseerrordata.js +35 -0
- package/esm/models/perrequestlimits.d.ts +40 -0
- package/esm/models/perrequestlimits.js +44 -0
- package/esm/models/providername.d.ts +106 -0
- package/esm/models/providername.js +116 -0
- package/esm/models/provideroverloadedresponseerrordata.d.ts +40 -0
- package/esm/models/provideroverloadedresponseerrordata.js +35 -0
- package/esm/models/publicendpoint.d.ts +140 -2
- package/esm/models/publicendpoint.js +156 -2
- package/esm/models/publicpricing.d.ts +87 -0
- package/esm/models/publicpricing.js +73 -0
- package/esm/models/quantization.d.ts +29 -0
- package/esm/models/quantization.js +39 -0
- package/esm/models/requesttimeoutresponseerrordata.d.ts +40 -0
- package/esm/models/requesttimeoutresponseerrordata.js +35 -0
- package/esm/models/responseserrorfield.d.ts +10 -10
- package/esm/models/responseserrorfield.js +14 -14
- package/esm/models/responsetextconfig.d.ts +10 -10
- package/esm/models/responsetextconfig.js +14 -15
- package/esm/models/serviceunavailableresponseerrordata.d.ts +40 -0
- package/esm/models/serviceunavailableresponseerrordata.js +35 -0
- package/esm/models/toomanyrequestsresponseerrordata.d.ts +40 -0
- package/esm/models/toomanyrequestsresponseerrordata.js +35 -0
- package/esm/models/topproviderinfo.d.ts +45 -0
- package/esm/models/topproviderinfo.js +48 -0
- package/esm/models/unauthorizedresponseerrordata.d.ts +40 -0
- package/esm/models/unauthorizedresponseerrordata.js +35 -0
- package/esm/models/unprocessableentityresponseerrordata.d.ts +40 -0
- package/esm/models/unprocessableentityresponseerrordata.js +35 -0
- package/esm/react-query/modelsCount.d.ts +2 -2
- package/esm/react-query/modelsListForUser.d.ts +2 -1
- package/esm/sdk/chat.d.ts +7 -0
- package/esm/sdk/chat.js +0 -6
- package/esm/sdk/models.d.ts +3 -2
- package/esm/sdk/responses.d.ts +7 -0
- package/esm/sdk/responses.js +0 -6
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/vitest.config.ts +11 -0
- package/esm/models/errorresponse.d.ts +0 -155
- package/esm/models/errorresponse.js +0 -167
- package/esm/models/errors/errorresponse.d.ts +0 -46
- package/esm/models/errors/listproviders.d.ts +0 -49
- package/esm/models/errors/listproviders.js +0 -51
- package/esm/models/operations/listmodelscount.d.ts +0 -26
- package/esm/models/operations/listmodelscount.js +0 -34
package/esm/funcs/modelsCount.js
CHANGED
|
@@ -5,7 +5,8 @@ import * as M from "../lib/matchers.js";
|
|
|
5
5
|
import { compactMap } from "../lib/primitives.js";
|
|
6
6
|
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
7
7
|
import { pathToFunc } from "../lib/url.js";
|
|
8
|
-
import * as
|
|
8
|
+
import * as errors from "../models/errors/index.js";
|
|
9
|
+
import * as models from "../models/index.js";
|
|
9
10
|
import { APIPromise } from "../types/async.js";
|
|
10
11
|
/**
|
|
11
12
|
* Get total count of available models
|
|
@@ -48,7 +49,7 @@ async function $do(client, options) {
|
|
|
48
49
|
const req = requestRes.value;
|
|
49
50
|
const doResult = await client._do(req, {
|
|
50
51
|
context,
|
|
51
|
-
errorCodes: ["4XX", "5XX"],
|
|
52
|
+
errorCodes: ["4XX", "500", "5XX"],
|
|
52
53
|
retryConfig: context.retryConfig,
|
|
53
54
|
retryCodes: context.retryCodes,
|
|
54
55
|
});
|
|
@@ -56,7 +57,10 @@ async function $do(client, options) {
|
|
|
56
57
|
return [doResult, { status: "request-error", request: req }];
|
|
57
58
|
}
|
|
58
59
|
const response = doResult.value;
|
|
59
|
-
const
|
|
60
|
+
const responseFields = {
|
|
61
|
+
HttpMeta: { Response: response, Request: req },
|
|
62
|
+
};
|
|
63
|
+
const [result] = await M.match(M.json(200, models.ModelsCountResponse$inboundSchema), M.jsonErr(500, errors.InternalServerResponseError$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
|
|
60
64
|
if (!result.ok) {
|
|
61
65
|
return [result, { status: "complete", request: req, response }];
|
|
62
66
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { OpenRouterCore } from "../core.js";
|
|
2
2
|
import { RequestOptions } from "../lib/sdks.js";
|
|
3
3
|
import { ConnectionError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, UnexpectedClientError } from "../models/errors/httpclienterrors.js";
|
|
4
|
+
import * as errors from "../models/errors/index.js";
|
|
4
5
|
import { OpenRouterError } from "../models/errors/openroutererror.js";
|
|
5
6
|
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
6
7
|
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
@@ -10,5 +11,5 @@ import { Result } from "../types/fp.js";
|
|
|
10
11
|
/**
|
|
11
12
|
* List all models and their properties
|
|
12
13
|
*/
|
|
13
|
-
export declare function modelsList(client: OpenRouterCore, request?: operations.GetModelsRequest | undefined, options?: RequestOptions): APIPromise<Result<operations.GetModelsResponse, OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
14
|
+
export declare function modelsList(client: OpenRouterCore, request?: operations.GetModelsRequest | undefined, options?: RequestOptions): APIPromise<Result<operations.GetModelsResponse, errors.BadRequestResponseError | errors.InternalServerResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
14
15
|
//# sourceMappingURL=modelsList.d.ts.map
|
package/esm/funcs/modelsList.js
CHANGED
|
@@ -7,6 +7,7 @@ import { compactMap } from "../lib/primitives.js";
|
|
|
7
7
|
import { safeParse } from "../lib/schemas.js";
|
|
8
8
|
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
9
9
|
import { pathToFunc } from "../lib/url.js";
|
|
10
|
+
import * as errors from "../models/errors/index.js";
|
|
10
11
|
import * as operations from "../models/operations/index.js";
|
|
11
12
|
import { APIPromise } from "../types/async.js";
|
|
12
13
|
/**
|
|
@@ -64,7 +65,7 @@ async function $do(client, request, options) {
|
|
|
64
65
|
const req = requestRes.value;
|
|
65
66
|
const doResult = await client._do(req, {
|
|
66
67
|
context,
|
|
67
|
-
errorCodes: ["4XX", "5XX"],
|
|
68
|
+
errorCodes: ["400", "4XX", "500", "5XX"],
|
|
68
69
|
retryConfig: context.retryConfig,
|
|
69
70
|
retryCodes: context.retryCodes,
|
|
70
71
|
});
|
|
@@ -72,9 +73,12 @@ async function $do(client, request, options) {
|
|
|
72
73
|
return [doResult, { status: "request-error", request: req }];
|
|
73
74
|
}
|
|
74
75
|
const response = doResult.value;
|
|
76
|
+
const responseFields = {
|
|
77
|
+
HttpMeta: { Response: response, Request: req },
|
|
78
|
+
};
|
|
75
79
|
const [result] = await M.match(M.json(200, operations.GetModelsResponse$inboundSchema), M.text(200, operations.GetModelsResponse$inboundSchema, {
|
|
76
80
|
ctype: "application/rss+xml",
|
|
77
|
-
}), M.
|
|
81
|
+
}), M.jsonErr(400, errors.BadRequestResponseError$inboundSchema), M.jsonErr(500, errors.InternalServerResponseError$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
|
|
78
82
|
if (!result.ok) {
|
|
79
83
|
return [result, { status: "complete", request: req, response }];
|
|
80
84
|
}
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { OpenRouterCore } from "../core.js";
|
|
2
2
|
import { RequestOptions } from "../lib/sdks.js";
|
|
3
3
|
import { ConnectionError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, UnexpectedClientError } from "../models/errors/httpclienterrors.js";
|
|
4
|
+
import * as errors from "../models/errors/index.js";
|
|
4
5
|
import { OpenRouterError } from "../models/errors/openroutererror.js";
|
|
5
6
|
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
6
7
|
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
8
|
+
import * as models from "../models/index.js";
|
|
7
9
|
import * as operations from "../models/operations/index.js";
|
|
8
10
|
import { APIPromise } from "../types/async.js";
|
|
9
11
|
import { Result } from "../types/fp.js";
|
|
10
12
|
/**
|
|
11
13
|
* List models filtered by user provider preferences
|
|
12
14
|
*/
|
|
13
|
-
export declare function modelsListForUser(client: OpenRouterCore, security: operations.ListModelsUserSecurity, options?: RequestOptions): APIPromise<Result<
|
|
15
|
+
export declare function modelsListForUser(client: OpenRouterCore, security: operations.ListModelsUserSecurity, options?: RequestOptions): APIPromise<Result<models.ModelsListResponse, errors.UnauthorizedResponseError | errors.InternalServerResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
14
16
|
//# sourceMappingURL=modelsListForUser.d.ts.map
|
|
@@ -5,7 +5,8 @@ import * as M from "../lib/matchers.js";
|
|
|
5
5
|
import { compactMap } from "../lib/primitives.js";
|
|
6
6
|
import { resolveSecurity } from "../lib/security.js";
|
|
7
7
|
import { pathToFunc } from "../lib/url.js";
|
|
8
|
-
import * as
|
|
8
|
+
import * as errors from "../models/errors/index.js";
|
|
9
|
+
import * as models from "../models/index.js";
|
|
9
10
|
import { APIPromise } from "../types/async.js";
|
|
10
11
|
/**
|
|
11
12
|
* List models filtered by user provider preferences
|
|
@@ -52,7 +53,7 @@ async function $do(client, security, options) {
|
|
|
52
53
|
const req = requestRes.value;
|
|
53
54
|
const doResult = await client._do(req, {
|
|
54
55
|
context,
|
|
55
|
-
errorCodes: ["4XX", "5XX"],
|
|
56
|
+
errorCodes: ["401", "4XX", "500", "5XX"],
|
|
56
57
|
retryConfig: context.retryConfig,
|
|
57
58
|
retryCodes: context.retryCodes,
|
|
58
59
|
});
|
|
@@ -60,7 +61,10 @@ async function $do(client, security, options) {
|
|
|
60
61
|
return [doResult, { status: "request-error", request: req }];
|
|
61
62
|
}
|
|
62
63
|
const response = doResult.value;
|
|
63
|
-
const
|
|
64
|
+
const responseFields = {
|
|
65
|
+
HttpMeta: { Response: response, Request: req },
|
|
66
|
+
};
|
|
67
|
+
const [result] = await M.match(M.json(200, models.ModelsListResponse$inboundSchema), M.jsonErr(401, errors.UnauthorizedResponseError$inboundSchema), M.jsonErr(500, errors.InternalServerResponseError$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
|
|
64
68
|
if (!result.ok) {
|
|
65
69
|
return [result, { status: "complete", request: req, response }];
|
|
66
70
|
}
|
|
@@ -11,5 +11,5 @@ import { Result } from "../types/fp.js";
|
|
|
11
11
|
/**
|
|
12
12
|
* Get a model's supported parameters and data about which are most popular
|
|
13
13
|
*/
|
|
14
|
-
export declare function parametersGetParameters(client: OpenRouterCore, security: operations.GetParametersSecurity, request: operations.GetParametersRequest, options?: RequestOptions): APIPromise<Result<operations.GetParametersResponse, errors.
|
|
14
|
+
export declare function parametersGetParameters(client: OpenRouterCore, security: operations.GetParametersSecurity, request: operations.GetParametersRequest, options?: RequestOptions): APIPromise<Result<operations.GetParametersResponse, errors.UnauthorizedResponseError | errors.NotFoundResponseError | errors.InternalServerResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
15
15
|
//# sourceMappingURL=parametersGetParameters.d.ts.map
|
|
@@ -76,7 +76,7 @@ async function $do(client, security, request, options) {
|
|
|
76
76
|
const req = requestRes.value;
|
|
77
77
|
const doResult = await client._do(req, {
|
|
78
78
|
context,
|
|
79
|
-
errorCodes: ["4XX", "5XX"],
|
|
79
|
+
errorCodes: ["401", "404", "4XX", "500", "5XX"],
|
|
80
80
|
retryConfig: context.retryConfig,
|
|
81
81
|
retryCodes: context.retryCodes,
|
|
82
82
|
});
|
|
@@ -87,7 +87,7 @@ async function $do(client, security, request, options) {
|
|
|
87
87
|
const responseFields = {
|
|
88
88
|
HttpMeta: { Response: response, Request: req },
|
|
89
89
|
};
|
|
90
|
-
const [result] = await M.match(M.json(200, operations.GetParametersResponse$inboundSchema), M.jsonErr(
|
|
90
|
+
const [result] = await M.match(M.json(200, operations.GetParametersResponse$inboundSchema), M.jsonErr(401, errors.UnauthorizedResponseError$inboundSchema), M.jsonErr(404, errors.NotFoundResponseError$inboundSchema), M.jsonErr(500, errors.InternalServerResponseError$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
|
|
91
91
|
if (!result.ok) {
|
|
92
92
|
return [result, { status: "complete", request: req, response }];
|
|
93
93
|
}
|
|
@@ -11,5 +11,5 @@ import { Result } from "../types/fp.js";
|
|
|
11
11
|
/**
|
|
12
12
|
* List all providers
|
|
13
13
|
*/
|
|
14
|
-
export declare function providersList(client: OpenRouterCore, options?: RequestOptions): APIPromise<Result<operations.ListProvidersResponse, errors.
|
|
14
|
+
export declare function providersList(client: OpenRouterCore, options?: RequestOptions): APIPromise<Result<operations.ListProvidersResponse, errors.InternalServerResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
15
15
|
//# sourceMappingURL=providersList.d.ts.map
|
|
@@ -60,7 +60,7 @@ async function $do(client, options) {
|
|
|
60
60
|
const responseFields = {
|
|
61
61
|
HttpMeta: { Response: response, Request: req },
|
|
62
62
|
};
|
|
63
|
-
const [result] = await M.match(M.json(200, operations.ListProvidersResponse$inboundSchema), M.jsonErr(500, errors.
|
|
63
|
+
const [result] = await M.match(M.json(200, operations.ListProvidersResponse$inboundSchema), M.jsonErr(500, errors.InternalServerResponseError$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
|
|
64
64
|
if (!result.ok) {
|
|
65
65
|
return [result, { status: "complete", request: req, response }];
|
|
66
66
|
}
|
package/esm/lib/config.d.ts
CHANGED
|
@@ -37,8 +37,8 @@ export declare function serverURLFromOptions(options: SDKOptions): URL | null;
|
|
|
37
37
|
export declare const SDK_METADATA: {
|
|
38
38
|
readonly language: "typescript";
|
|
39
39
|
readonly openapiDocVersion: "1.0.0";
|
|
40
|
-
readonly sdkVersion: "0.0.1-beta.
|
|
41
|
-
readonly genVersion: "2.
|
|
42
|
-
readonly userAgent: "speakeasy-sdk/typescript 0.0.1-beta.
|
|
40
|
+
readonly sdkVersion: "0.0.1-beta.12";
|
|
41
|
+
readonly genVersion: "2.731.4";
|
|
42
|
+
readonly userAgent: "speakeasy-sdk/typescript 0.0.1-beta.12 2.731.4 1.0.0 @openrouter/sdk";
|
|
43
43
|
};
|
|
44
44
|
//# sourceMappingURL=config.d.ts.map
|
package/esm/lib/config.js
CHANGED
|
@@ -25,8 +25,8 @@ export function serverURLFromOptions(options) {
|
|
|
25
25
|
export const SDK_METADATA = {
|
|
26
26
|
language: "typescript",
|
|
27
27
|
openapiDocVersion: "1.0.0",
|
|
28
|
-
sdkVersion: "0.0.1-beta.
|
|
29
|
-
genVersion: "2.
|
|
30
|
-
userAgent: "speakeasy-sdk/typescript 0.0.1-beta.
|
|
28
|
+
sdkVersion: "0.0.1-beta.12",
|
|
29
|
+
genVersion: "2.731.4",
|
|
30
|
+
userAgent: "speakeasy-sdk/typescript 0.0.1-beta.12 2.731.4 1.0.0 @openrouter/sdk",
|
|
31
31
|
};
|
|
32
32
|
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1,40 @@
|
|
|
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
|
+
* Error data for BadGatewayResponse
|
|
6
|
+
*/
|
|
7
|
+
export type BadGatewayResponseErrorData = {
|
|
8
|
+
code: number;
|
|
9
|
+
message: string;
|
|
10
|
+
metadata?: {
|
|
11
|
+
[k: string]: any | null;
|
|
12
|
+
} | null | undefined;
|
|
13
|
+
};
|
|
14
|
+
/** @internal */
|
|
15
|
+
export declare const BadGatewayResponseErrorData$inboundSchema: z.ZodType<BadGatewayResponseErrorData, unknown>;
|
|
16
|
+
/** @internal */
|
|
17
|
+
export type BadGatewayResponseErrorData$Outbound = {
|
|
18
|
+
code: number;
|
|
19
|
+
message: string;
|
|
20
|
+
metadata?: {
|
|
21
|
+
[k: string]: any | null;
|
|
22
|
+
} | null | undefined;
|
|
23
|
+
};
|
|
24
|
+
/** @internal */
|
|
25
|
+
export declare const BadGatewayResponseErrorData$outboundSchema: z.ZodType<BadGatewayResponseErrorData$Outbound, BadGatewayResponseErrorData>;
|
|
26
|
+
/**
|
|
27
|
+
* @internal
|
|
28
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
29
|
+
*/
|
|
30
|
+
export declare namespace BadGatewayResponseErrorData$ {
|
|
31
|
+
/** @deprecated use `BadGatewayResponseErrorData$inboundSchema` instead. */
|
|
32
|
+
const inboundSchema: z.ZodType<BadGatewayResponseErrorData, unknown, z.core.$ZodTypeInternals<BadGatewayResponseErrorData, unknown>>;
|
|
33
|
+
/** @deprecated use `BadGatewayResponseErrorData$outboundSchema` instead. */
|
|
34
|
+
const outboundSchema: z.ZodType<BadGatewayResponseErrorData$Outbound, BadGatewayResponseErrorData, z.core.$ZodTypeInternals<BadGatewayResponseErrorData$Outbound, BadGatewayResponseErrorData>>;
|
|
35
|
+
/** @deprecated use `BadGatewayResponseErrorData$Outbound` instead. */
|
|
36
|
+
type Outbound = BadGatewayResponseErrorData$Outbound;
|
|
37
|
+
}
|
|
38
|
+
export declare function badGatewayResponseErrorDataToJSON(badGatewayResponseErrorData: BadGatewayResponseErrorData): string;
|
|
39
|
+
export declare function badGatewayResponseErrorDataFromJSON(jsonString: string): SafeParseResult<BadGatewayResponseErrorData, SDKValidationError>;
|
|
40
|
+
//# sourceMappingURL=badgatewayresponseerrordata.d.ts.map
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
import * as z from "zod/v4";
|
|
5
|
+
import { safeParse } from "../lib/schemas.js";
|
|
6
|
+
/** @internal */
|
|
7
|
+
export const BadGatewayResponseErrorData$inboundSchema = z.object({
|
|
8
|
+
code: z.number().int(),
|
|
9
|
+
message: z.string(),
|
|
10
|
+
metadata: z.nullable(z.record(z.string(), z.nullable(z.any()))).optional(),
|
|
11
|
+
});
|
|
12
|
+
/** @internal */
|
|
13
|
+
export const BadGatewayResponseErrorData$outboundSchema = z.object({
|
|
14
|
+
code: z.number().int(),
|
|
15
|
+
message: z.string(),
|
|
16
|
+
metadata: z.nullable(z.record(z.string(), z.nullable(z.any()))).optional(),
|
|
17
|
+
});
|
|
18
|
+
/**
|
|
19
|
+
* @internal
|
|
20
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
21
|
+
*/
|
|
22
|
+
export var BadGatewayResponseErrorData$;
|
|
23
|
+
(function (BadGatewayResponseErrorData$) {
|
|
24
|
+
/** @deprecated use `BadGatewayResponseErrorData$inboundSchema` instead. */
|
|
25
|
+
BadGatewayResponseErrorData$.inboundSchema = BadGatewayResponseErrorData$inboundSchema;
|
|
26
|
+
/** @deprecated use `BadGatewayResponseErrorData$outboundSchema` instead. */
|
|
27
|
+
BadGatewayResponseErrorData$.outboundSchema = BadGatewayResponseErrorData$outboundSchema;
|
|
28
|
+
})(BadGatewayResponseErrorData$ || (BadGatewayResponseErrorData$ = {}));
|
|
29
|
+
export function badGatewayResponseErrorDataToJSON(badGatewayResponseErrorData) {
|
|
30
|
+
return JSON.stringify(BadGatewayResponseErrorData$outboundSchema.parse(badGatewayResponseErrorData));
|
|
31
|
+
}
|
|
32
|
+
export function badGatewayResponseErrorDataFromJSON(jsonString) {
|
|
33
|
+
return safeParse(jsonString, (x) => BadGatewayResponseErrorData$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'BadGatewayResponseErrorData' from JSON`);
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=badgatewayresponseerrordata.js.map
|
|
@@ -0,0 +1,40 @@
|
|
|
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
|
+
* Error data for BadRequestResponse
|
|
6
|
+
*/
|
|
7
|
+
export type BadRequestResponseErrorData = {
|
|
8
|
+
code: number;
|
|
9
|
+
message: string;
|
|
10
|
+
metadata?: {
|
|
11
|
+
[k: string]: any | null;
|
|
12
|
+
} | null | undefined;
|
|
13
|
+
};
|
|
14
|
+
/** @internal */
|
|
15
|
+
export declare const BadRequestResponseErrorData$inboundSchema: z.ZodType<BadRequestResponseErrorData, unknown>;
|
|
16
|
+
/** @internal */
|
|
17
|
+
export type BadRequestResponseErrorData$Outbound = {
|
|
18
|
+
code: number;
|
|
19
|
+
message: string;
|
|
20
|
+
metadata?: {
|
|
21
|
+
[k: string]: any | null;
|
|
22
|
+
} | null | undefined;
|
|
23
|
+
};
|
|
24
|
+
/** @internal */
|
|
25
|
+
export declare const BadRequestResponseErrorData$outboundSchema: z.ZodType<BadRequestResponseErrorData$Outbound, BadRequestResponseErrorData>;
|
|
26
|
+
/**
|
|
27
|
+
* @internal
|
|
28
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
29
|
+
*/
|
|
30
|
+
export declare namespace BadRequestResponseErrorData$ {
|
|
31
|
+
/** @deprecated use `BadRequestResponseErrorData$inboundSchema` instead. */
|
|
32
|
+
const inboundSchema: z.ZodType<BadRequestResponseErrorData, unknown, z.core.$ZodTypeInternals<BadRequestResponseErrorData, unknown>>;
|
|
33
|
+
/** @deprecated use `BadRequestResponseErrorData$outboundSchema` instead. */
|
|
34
|
+
const outboundSchema: z.ZodType<BadRequestResponseErrorData$Outbound, BadRequestResponseErrorData, z.core.$ZodTypeInternals<BadRequestResponseErrorData$Outbound, BadRequestResponseErrorData>>;
|
|
35
|
+
/** @deprecated use `BadRequestResponseErrorData$Outbound` instead. */
|
|
36
|
+
type Outbound = BadRequestResponseErrorData$Outbound;
|
|
37
|
+
}
|
|
38
|
+
export declare function badRequestResponseErrorDataToJSON(badRequestResponseErrorData: BadRequestResponseErrorData): string;
|
|
39
|
+
export declare function badRequestResponseErrorDataFromJSON(jsonString: string): SafeParseResult<BadRequestResponseErrorData, SDKValidationError>;
|
|
40
|
+
//# sourceMappingURL=badrequestresponseerrordata.d.ts.map
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
import * as z from "zod/v4";
|
|
5
|
+
import { safeParse } from "../lib/schemas.js";
|
|
6
|
+
/** @internal */
|
|
7
|
+
export const BadRequestResponseErrorData$inboundSchema = z.object({
|
|
8
|
+
code: z.number().int(),
|
|
9
|
+
message: z.string(),
|
|
10
|
+
metadata: z.nullable(z.record(z.string(), z.nullable(z.any()))).optional(),
|
|
11
|
+
});
|
|
12
|
+
/** @internal */
|
|
13
|
+
export const BadRequestResponseErrorData$outboundSchema = z.object({
|
|
14
|
+
code: z.number().int(),
|
|
15
|
+
message: z.string(),
|
|
16
|
+
metadata: z.nullable(z.record(z.string(), z.nullable(z.any()))).optional(),
|
|
17
|
+
});
|
|
18
|
+
/**
|
|
19
|
+
* @internal
|
|
20
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
21
|
+
*/
|
|
22
|
+
export var BadRequestResponseErrorData$;
|
|
23
|
+
(function (BadRequestResponseErrorData$) {
|
|
24
|
+
/** @deprecated use `BadRequestResponseErrorData$inboundSchema` instead. */
|
|
25
|
+
BadRequestResponseErrorData$.inboundSchema = BadRequestResponseErrorData$inboundSchema;
|
|
26
|
+
/** @deprecated use `BadRequestResponseErrorData$outboundSchema` instead. */
|
|
27
|
+
BadRequestResponseErrorData$.outboundSchema = BadRequestResponseErrorData$outboundSchema;
|
|
28
|
+
})(BadRequestResponseErrorData$ || (BadRequestResponseErrorData$ = {}));
|
|
29
|
+
export function badRequestResponseErrorDataToJSON(badRequestResponseErrorData) {
|
|
30
|
+
return JSON.stringify(BadRequestResponseErrorData$outboundSchema.parse(badRequestResponseErrorData));
|
|
31
|
+
}
|
|
32
|
+
export function badRequestResponseErrorDataFromJSON(jsonString) {
|
|
33
|
+
return safeParse(jsonString, (x) => BadRequestResponseErrorData$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'BadRequestResponseErrorData' from JSON`);
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=badrequestresponseerrordata.js.map
|
|
@@ -49,7 +49,7 @@ export type ChatGenerationParams = {
|
|
|
49
49
|
responseFormat?: ResponseFormatJSONSchema | ResponseFormatTextGrammar | ChatGenerationParamsResponseFormatText | ChatGenerationParamsResponseFormatJSONObject | ChatGenerationParamsResponseFormatPython | undefined;
|
|
50
50
|
seed?: number | null | undefined;
|
|
51
51
|
stop?: string | Array<string> | null | undefined;
|
|
52
|
-
stream?: boolean |
|
|
52
|
+
stream?: boolean | undefined;
|
|
53
53
|
streamOptions?: ChatStreamOptions | null | undefined;
|
|
54
54
|
temperature?: number | null | undefined;
|
|
55
55
|
toolChoice?: any | undefined;
|
|
@@ -222,7 +222,7 @@ export type ChatGenerationParams$Outbound = {
|
|
|
222
222
|
response_format?: ResponseFormatJSONSchema$Outbound | ResponseFormatTextGrammar$Outbound | ChatGenerationParamsResponseFormatText$Outbound | ChatGenerationParamsResponseFormatJSONObject$Outbound | ChatGenerationParamsResponseFormatPython$Outbound | undefined;
|
|
223
223
|
seed?: number | null | undefined;
|
|
224
224
|
stop?: string | Array<string> | null | undefined;
|
|
225
|
-
stream
|
|
225
|
+
stream: boolean;
|
|
226
226
|
stream_options?: ChatStreamOptions$Outbound | null | undefined;
|
|
227
227
|
temperature?: number | null | undefined;
|
|
228
228
|
tool_choice?: any | undefined;
|
|
@@ -217,7 +217,7 @@ export const ChatGenerationParams$inboundSchema = z.object({
|
|
|
217
217
|
]).optional(),
|
|
218
218
|
seed: z.nullable(z.number().int()).optional(),
|
|
219
219
|
stop: z.nullable(z.union([z.string(), z.array(z.string())])).optional(),
|
|
220
|
-
stream: z.
|
|
220
|
+
stream: z.boolean().default(false),
|
|
221
221
|
stream_options: z.nullable(ChatStreamOptions$inboundSchema).optional(),
|
|
222
222
|
temperature: z.nullable(z.number()).optional(),
|
|
223
223
|
tool_choice: z.any().optional(),
|
|
@@ -260,7 +260,7 @@ export const ChatGenerationParams$outboundSchema = z.object({
|
|
|
260
260
|
]).optional(),
|
|
261
261
|
seed: z.nullable(z.number().int()).optional(),
|
|
262
262
|
stop: z.nullable(z.union([z.string(), z.array(z.string())])).optional(),
|
|
263
|
-
stream: z.
|
|
263
|
+
stream: z.boolean().default(false),
|
|
264
264
|
streamOptions: z.nullable(ChatStreamOptions$outboundSchema).optional(),
|
|
265
265
|
temperature: z.nullable(z.number()).optional(),
|
|
266
266
|
toolChoice: z.any().optional(),
|
|
@@ -2,7 +2,7 @@ import * as z from "zod/v4";
|
|
|
2
2
|
import { OpenEnum } from "../types/enums.js";
|
|
3
3
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
4
4
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
|
-
export declare const
|
|
5
|
+
export declare const ChatMessageContentItemAudioFormat: {
|
|
6
6
|
readonly Wav: "wav";
|
|
7
7
|
readonly Mp3: "mp3";
|
|
8
8
|
readonly Flac: "flac";
|
|
@@ -11,28 +11,28 @@ export declare const Format: {
|
|
|
11
11
|
readonly Pcm16: "pcm16";
|
|
12
12
|
readonly Pcm24: "pcm24";
|
|
13
13
|
};
|
|
14
|
-
export type
|
|
14
|
+
export type ChatMessageContentItemAudioFormat = OpenEnum<typeof ChatMessageContentItemAudioFormat>;
|
|
15
15
|
export type InputAudio = {
|
|
16
16
|
data: string;
|
|
17
|
-
format:
|
|
17
|
+
format: ChatMessageContentItemAudioFormat;
|
|
18
18
|
};
|
|
19
19
|
export type ChatMessageContentItemAudio = {
|
|
20
20
|
type: "input_audio";
|
|
21
21
|
inputAudio: InputAudio;
|
|
22
22
|
};
|
|
23
23
|
/** @internal */
|
|
24
|
-
export declare const
|
|
24
|
+
export declare const ChatMessageContentItemAudioFormat$inboundSchema: z.ZodType<ChatMessageContentItemAudioFormat, unknown>;
|
|
25
25
|
/** @internal */
|
|
26
|
-
export declare const
|
|
26
|
+
export declare const ChatMessageContentItemAudioFormat$outboundSchema: z.ZodType<ChatMessageContentItemAudioFormat, ChatMessageContentItemAudioFormat>;
|
|
27
27
|
/**
|
|
28
28
|
* @internal
|
|
29
29
|
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
30
30
|
*/
|
|
31
|
-
export declare namespace
|
|
32
|
-
/** @deprecated use `
|
|
33
|
-
const inboundSchema: z.ZodType<
|
|
34
|
-
/** @deprecated use `
|
|
35
|
-
const outboundSchema: z.ZodType<
|
|
31
|
+
export declare namespace ChatMessageContentItemAudioFormat$ {
|
|
32
|
+
/** @deprecated use `ChatMessageContentItemAudioFormat$inboundSchema` instead. */
|
|
33
|
+
const inboundSchema: z.ZodType<ChatMessageContentItemAudioFormat, unknown, z.core.$ZodTypeInternals<ChatMessageContentItemAudioFormat, unknown>>;
|
|
34
|
+
/** @deprecated use `ChatMessageContentItemAudioFormat$outboundSchema` instead. */
|
|
35
|
+
const outboundSchema: z.ZodType<ChatMessageContentItemAudioFormat, ChatMessageContentItemAudioFormat, z.core.$ZodTypeInternals<ChatMessageContentItemAudioFormat, ChatMessageContentItemAudioFormat>>;
|
|
36
36
|
}
|
|
37
37
|
/** @internal */
|
|
38
38
|
export declare const InputAudio$inboundSchema: z.ZodType<InputAudio, unknown>;
|
|
@@ -5,7 +5,7 @@ import * as z from "zod/v4";
|
|
|
5
5
|
import { remap as remap$ } from "../lib/primitives.js";
|
|
6
6
|
import { safeParse } from "../lib/schemas.js";
|
|
7
7
|
import { catchUnrecognizedEnum, } from "../types/enums.js";
|
|
8
|
-
export const
|
|
8
|
+
export const ChatMessageContentItemAudioFormat = {
|
|
9
9
|
Wav: "wav",
|
|
10
10
|
Mp3: "mp3",
|
|
11
11
|
Flac: "flac",
|
|
@@ -15,37 +15,37 @@ export const Format = {
|
|
|
15
15
|
Pcm24: "pcm24",
|
|
16
16
|
};
|
|
17
17
|
/** @internal */
|
|
18
|
-
export const
|
|
18
|
+
export const ChatMessageContentItemAudioFormat$inboundSchema = z
|
|
19
19
|
.union([
|
|
20
|
-
z.enum(
|
|
20
|
+
z.enum(ChatMessageContentItemAudioFormat),
|
|
21
21
|
z.string().transform(catchUnrecognizedEnum),
|
|
22
22
|
]);
|
|
23
23
|
/** @internal */
|
|
24
|
-
export const
|
|
25
|
-
z.enum(
|
|
24
|
+
export const ChatMessageContentItemAudioFormat$outboundSchema = z.union([
|
|
25
|
+
z.enum(ChatMessageContentItemAudioFormat),
|
|
26
26
|
z.string().and(z.custom()),
|
|
27
27
|
]);
|
|
28
28
|
/**
|
|
29
29
|
* @internal
|
|
30
30
|
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
31
31
|
*/
|
|
32
|
-
export var
|
|
33
|
-
(function (
|
|
34
|
-
/** @deprecated use `
|
|
35
|
-
|
|
36
|
-
/** @deprecated use `
|
|
37
|
-
|
|
38
|
-
})(
|
|
32
|
+
export var ChatMessageContentItemAudioFormat$;
|
|
33
|
+
(function (ChatMessageContentItemAudioFormat$) {
|
|
34
|
+
/** @deprecated use `ChatMessageContentItemAudioFormat$inboundSchema` instead. */
|
|
35
|
+
ChatMessageContentItemAudioFormat$.inboundSchema = ChatMessageContentItemAudioFormat$inboundSchema;
|
|
36
|
+
/** @deprecated use `ChatMessageContentItemAudioFormat$outboundSchema` instead. */
|
|
37
|
+
ChatMessageContentItemAudioFormat$.outboundSchema = ChatMessageContentItemAudioFormat$outboundSchema;
|
|
38
|
+
})(ChatMessageContentItemAudioFormat$ || (ChatMessageContentItemAudioFormat$ = {}));
|
|
39
39
|
/** @internal */
|
|
40
40
|
export const InputAudio$inboundSchema = z
|
|
41
41
|
.object({
|
|
42
42
|
data: z.string(),
|
|
43
|
-
format:
|
|
43
|
+
format: ChatMessageContentItemAudioFormat$inboundSchema,
|
|
44
44
|
});
|
|
45
45
|
/** @internal */
|
|
46
46
|
export const InputAudio$outboundSchema = z.object({
|
|
47
47
|
data: z.string(),
|
|
48
|
-
format:
|
|
48
|
+
format: ChatMessageContentItemAudioFormat$outboundSchema,
|
|
49
49
|
});
|
|
50
50
|
/**
|
|
51
51
|
* @internal
|
|
@@ -7,7 +7,7 @@ export type ChatStreamingResponseChunkError = {
|
|
|
7
7
|
message: string;
|
|
8
8
|
code: number;
|
|
9
9
|
};
|
|
10
|
-
export type
|
|
10
|
+
export type ChatStreamingResponseChunkData = {
|
|
11
11
|
id: string;
|
|
12
12
|
choices: Array<ChatStreamingChoice>;
|
|
13
13
|
created: number;
|
|
@@ -18,7 +18,7 @@ export type Data = {
|
|
|
18
18
|
usage?: ChatGenerationTokenUsage | undefined;
|
|
19
19
|
};
|
|
20
20
|
export type ChatStreamingResponseChunk = {
|
|
21
|
-
data:
|
|
21
|
+
data: ChatStreamingResponseChunkData;
|
|
22
22
|
};
|
|
23
23
|
/** @internal */
|
|
24
24
|
export declare const ChatStreamingResponseChunkError$inboundSchema: z.ZodType<ChatStreamingResponseChunkError, unknown>;
|
|
@@ -44,9 +44,9 @@ export declare namespace ChatStreamingResponseChunkError$ {
|
|
|
44
44
|
export declare function chatStreamingResponseChunkErrorToJSON(chatStreamingResponseChunkError: ChatStreamingResponseChunkError): string;
|
|
45
45
|
export declare function chatStreamingResponseChunkErrorFromJSON(jsonString: string): SafeParseResult<ChatStreamingResponseChunkError, SDKValidationError>;
|
|
46
46
|
/** @internal */
|
|
47
|
-
export declare const
|
|
47
|
+
export declare const ChatStreamingResponseChunkData$inboundSchema: z.ZodType<ChatStreamingResponseChunkData, unknown>;
|
|
48
48
|
/** @internal */
|
|
49
|
-
export type
|
|
49
|
+
export type ChatStreamingResponseChunkData$Outbound = {
|
|
50
50
|
id: string;
|
|
51
51
|
choices: Array<ChatStreamingChoice$Outbound>;
|
|
52
52
|
created: number;
|
|
@@ -57,26 +57,26 @@ export type Data$Outbound = {
|
|
|
57
57
|
usage?: ChatGenerationTokenUsage$Outbound | undefined;
|
|
58
58
|
};
|
|
59
59
|
/** @internal */
|
|
60
|
-
export declare const
|
|
60
|
+
export declare const ChatStreamingResponseChunkData$outboundSchema: z.ZodType<ChatStreamingResponseChunkData$Outbound, ChatStreamingResponseChunkData>;
|
|
61
61
|
/**
|
|
62
62
|
* @internal
|
|
63
63
|
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
64
64
|
*/
|
|
65
|
-
export declare namespace
|
|
66
|
-
/** @deprecated use `
|
|
67
|
-
const inboundSchema: z.ZodType<
|
|
68
|
-
/** @deprecated use `
|
|
69
|
-
const outboundSchema: z.ZodType<
|
|
70
|
-
/** @deprecated use `
|
|
71
|
-
type Outbound =
|
|
65
|
+
export declare namespace ChatStreamingResponseChunkData$ {
|
|
66
|
+
/** @deprecated use `ChatStreamingResponseChunkData$inboundSchema` instead. */
|
|
67
|
+
const inboundSchema: z.ZodType<ChatStreamingResponseChunkData, unknown, z.core.$ZodTypeInternals<ChatStreamingResponseChunkData, unknown>>;
|
|
68
|
+
/** @deprecated use `ChatStreamingResponseChunkData$outboundSchema` instead. */
|
|
69
|
+
const outboundSchema: z.ZodType<ChatStreamingResponseChunkData$Outbound, ChatStreamingResponseChunkData, z.core.$ZodTypeInternals<ChatStreamingResponseChunkData$Outbound, ChatStreamingResponseChunkData>>;
|
|
70
|
+
/** @deprecated use `ChatStreamingResponseChunkData$Outbound` instead. */
|
|
71
|
+
type Outbound = ChatStreamingResponseChunkData$Outbound;
|
|
72
72
|
}
|
|
73
|
-
export declare function
|
|
74
|
-
export declare function
|
|
73
|
+
export declare function chatStreamingResponseChunkDataToJSON(chatStreamingResponseChunkData: ChatStreamingResponseChunkData): string;
|
|
74
|
+
export declare function chatStreamingResponseChunkDataFromJSON(jsonString: string): SafeParseResult<ChatStreamingResponseChunkData, SDKValidationError>;
|
|
75
75
|
/** @internal */
|
|
76
76
|
export declare const ChatStreamingResponseChunk$inboundSchema: z.ZodType<ChatStreamingResponseChunk, unknown>;
|
|
77
77
|
/** @internal */
|
|
78
78
|
export type ChatStreamingResponseChunk$Outbound = {
|
|
79
|
-
data:
|
|
79
|
+
data: ChatStreamingResponseChunkData$Outbound;
|
|
80
80
|
};
|
|
81
81
|
/** @internal */
|
|
82
82
|
export declare const ChatStreamingResponseChunk$outboundSchema: z.ZodType<ChatStreamingResponseChunk$Outbound, ChatStreamingResponseChunk>;
|
|
@@ -34,7 +34,7 @@ export function chatStreamingResponseChunkErrorFromJSON(jsonString) {
|
|
|
34
34
|
return safeParse(jsonString, (x) => ChatStreamingResponseChunkError$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ChatStreamingResponseChunkError' from JSON`);
|
|
35
35
|
}
|
|
36
36
|
/** @internal */
|
|
37
|
-
export const
|
|
37
|
+
export const ChatStreamingResponseChunkData$inboundSchema = z.object({
|
|
38
38
|
id: z.string(),
|
|
39
39
|
choices: z.array(ChatStreamingChoice$inboundSchema),
|
|
40
40
|
created: z.number(),
|
|
@@ -49,7 +49,7 @@ export const Data$inboundSchema = z.object({
|
|
|
49
49
|
});
|
|
50
50
|
});
|
|
51
51
|
/** @internal */
|
|
52
|
-
export const
|
|
52
|
+
export const ChatStreamingResponseChunkData$outboundSchema = z.object({
|
|
53
53
|
id: z.string(),
|
|
54
54
|
choices: z.array(ChatStreamingChoice$outboundSchema),
|
|
55
55
|
created: z.number(),
|
|
@@ -68,18 +68,18 @@ export const Data$outboundSchema = z.object({
|
|
|
68
68
|
* @internal
|
|
69
69
|
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
70
70
|
*/
|
|
71
|
-
export var
|
|
72
|
-
(function (
|
|
73
|
-
/** @deprecated use `
|
|
74
|
-
|
|
75
|
-
/** @deprecated use `
|
|
76
|
-
|
|
77
|
-
})(
|
|
78
|
-
export function
|
|
79
|
-
return JSON.stringify(
|
|
71
|
+
export var ChatStreamingResponseChunkData$;
|
|
72
|
+
(function (ChatStreamingResponseChunkData$) {
|
|
73
|
+
/** @deprecated use `ChatStreamingResponseChunkData$inboundSchema` instead. */
|
|
74
|
+
ChatStreamingResponseChunkData$.inboundSchema = ChatStreamingResponseChunkData$inboundSchema;
|
|
75
|
+
/** @deprecated use `ChatStreamingResponseChunkData$outboundSchema` instead. */
|
|
76
|
+
ChatStreamingResponseChunkData$.outboundSchema = ChatStreamingResponseChunkData$outboundSchema;
|
|
77
|
+
})(ChatStreamingResponseChunkData$ || (ChatStreamingResponseChunkData$ = {}));
|
|
78
|
+
export function chatStreamingResponseChunkDataToJSON(chatStreamingResponseChunkData) {
|
|
79
|
+
return JSON.stringify(ChatStreamingResponseChunkData$outboundSchema.parse(chatStreamingResponseChunkData));
|
|
80
80
|
}
|
|
81
|
-
export function
|
|
82
|
-
return safeParse(jsonString, (x) =>
|
|
81
|
+
export function chatStreamingResponseChunkDataFromJSON(jsonString) {
|
|
82
|
+
return safeParse(jsonString, (x) => ChatStreamingResponseChunkData$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ChatStreamingResponseChunkData' from JSON`);
|
|
83
83
|
}
|
|
84
84
|
/** @internal */
|
|
85
85
|
export const ChatStreamingResponseChunk$inboundSchema = z.object({
|
|
@@ -94,11 +94,11 @@ export const ChatStreamingResponseChunk$inboundSchema = z.object({
|
|
|
94
94
|
});
|
|
95
95
|
return z.NEVER;
|
|
96
96
|
}
|
|
97
|
-
}).pipe(z.lazy(() =>
|
|
97
|
+
}).pipe(z.lazy(() => ChatStreamingResponseChunkData$inboundSchema)),
|
|
98
98
|
});
|
|
99
99
|
/** @internal */
|
|
100
100
|
export const ChatStreamingResponseChunk$outboundSchema = z.object({
|
|
101
|
-
data: z.lazy(() =>
|
|
101
|
+
data: z.lazy(() => ChatStreamingResponseChunkData$outboundSchema),
|
|
102
102
|
});
|
|
103
103
|
/**
|
|
104
104
|
* @internal
|