@meetkai/mka1 0.51.13 → 0.51.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/README.md +233 -227
- package/bin/mcp-server.js +541 -264
- package/bin/mcp-server.js.map +18 -10
- package/dist/commonjs/funcs/servingEligibilityPreview.d.ts +19 -0
- package/dist/commonjs/funcs/servingEligibilityPreview.d.ts.map +1 -0
- package/dist/commonjs/funcs/servingEligibilityPreview.js +133 -0
- package/dist/commonjs/funcs/servingEligibilityPreview.js.map +1 -0
- package/dist/commonjs/lib/config.d.ts +2 -2
- package/dist/commonjs/lib/config.js +2 -2
- package/dist/commonjs/mcp-server/mcp-server.js +1 -1
- package/dist/commonjs/mcp-server/server.d.ts.map +1 -1
- package/dist/commonjs/mcp-server/server.js +3 -1
- package/dist/commonjs/mcp-server/server.js.map +1 -1
- package/dist/commonjs/mcp-server/tools/servingEligibilityPreview.d.ts +8 -0
- package/dist/commonjs/mcp-server/tools/servingEligibilityPreview.d.ts.map +1 -0
- package/dist/commonjs/mcp-server/tools/servingEligibilityPreview.js +64 -0
- package/dist/commonjs/mcp-server/tools/servingEligibilityPreview.js.map +1 -0
- package/dist/commonjs/models/components/acceleratorpriceband.d.ts +22 -0
- package/dist/commonjs/models/components/acceleratorpriceband.d.ts.map +1 -0
- package/dist/commonjs/models/components/acceleratorpriceband.js +60 -0
- package/dist/commonjs/models/components/acceleratorpriceband.js.map +1 -0
- package/dist/commonjs/models/components/acceleratortype.d.ts +22 -0
- package/dist/commonjs/models/components/acceleratortype.d.ts.map +1 -1
- package/dist/commonjs/models/components/acceleratortype.js +14 -0
- package/dist/commonjs/models/components/acceleratortype.js.map +1 -1
- package/dist/commonjs/models/components/acquirability.d.ts +20 -0
- package/dist/commonjs/models/components/acquirability.d.ts.map +1 -0
- package/dist/commonjs/models/components/acquirability.js +54 -0
- package/dist/commonjs/models/components/acquirability.js.map +1 -0
- package/dist/commonjs/models/components/eligibilitypreview.d.ts +73 -0
- package/dist/commonjs/models/components/eligibilitypreview.d.ts.map +1 -0
- package/dist/commonjs/models/components/eligibilitypreview.js +99 -0
- package/dist/commonjs/models/components/eligibilitypreview.js.map +1 -0
- package/dist/commonjs/models/components/eligibilitypriceband.d.ts +24 -0
- package/dist/commonjs/models/components/eligibilitypriceband.d.ts.map +1 -0
- package/dist/commonjs/models/components/eligibilitypriceband.js +62 -0
- package/dist/commonjs/models/components/eligibilitypriceband.js.map +1 -0
- package/dist/commonjs/models/components/eligibilityrequest.d.ts +28 -0
- package/dist/commonjs/models/components/eligibilityrequest.d.ts.map +1 -0
- package/dist/commonjs/models/components/eligibilityrequest.js +59 -0
- package/dist/commonjs/models/components/eligibilityrequest.js.map +1 -0
- package/dist/commonjs/models/components/index.d.ts +5 -0
- package/dist/commonjs/models/components/index.d.ts.map +1 -1
- package/dist/commonjs/models/components/index.js +5 -0
- package/dist/commonjs/models/components/index.js.map +1 -1
- package/dist/commonjs/models/components/replica.d.ts +30 -3
- package/dist/commonjs/models/components/replica.d.ts.map +1 -1
- package/dist/commonjs/models/components/replica.js +17 -3
- package/dist/commonjs/models/components/replica.js.map +1 -1
- package/dist/commonjs/models/operations/index.d.ts +1 -0
- package/dist/commonjs/models/operations/index.d.ts.map +1 -1
- package/dist/commonjs/models/operations/index.js +1 -0
- package/dist/commonjs/models/operations/index.js.map +1 -1
- package/dist/commonjs/models/operations/previeweligibility.d.ts +23 -0
- package/dist/commonjs/models/operations/previeweligibility.d.ts.map +1 -0
- package/dist/commonjs/models/operations/previeweligibility.js +72 -0
- package/dist/commonjs/models/operations/previeweligibility.js.map +1 -0
- package/dist/commonjs/react-query/index.d.ts +1 -0
- package/dist/commonjs/react-query/index.d.ts.map +1 -1
- package/dist/commonjs/react-query/index.js +1 -0
- package/dist/commonjs/react-query/index.js.map +1 -1
- package/dist/commonjs/react-query/servingEligibilityPreview.d.ts +30 -0
- package/dist/commonjs/react-query/servingEligibilityPreview.d.ts.map +1 -0
- package/dist/commonjs/react-query/servingEligibilityPreview.js +47 -0
- package/dist/commonjs/react-query/servingEligibilityPreview.js.map +1 -0
- package/dist/commonjs/sdk/eligibility.d.ts +13 -0
- package/dist/commonjs/sdk/eligibility.d.ts.map +1 -0
- package/dist/commonjs/sdk/eligibility.js +22 -0
- package/dist/commonjs/sdk/eligibility.js.map +1 -0
- package/dist/commonjs/sdk/serving.d.ts +3 -0
- package/dist/commonjs/sdk/serving.d.ts.map +1 -1
- package/dist/commonjs/sdk/serving.js +4 -0
- package/dist/commonjs/sdk/serving.js.map +1 -1
- package/dist/esm/funcs/servingEligibilityPreview.d.ts +19 -0
- package/dist/esm/funcs/servingEligibilityPreview.d.ts.map +1 -0
- package/dist/esm/funcs/servingEligibilityPreview.js +97 -0
- package/dist/esm/funcs/servingEligibilityPreview.js.map +1 -0
- package/dist/esm/lib/config.d.ts +2 -2
- package/dist/esm/lib/config.js +2 -2
- package/dist/esm/mcp-server/mcp-server.js +1 -1
- package/dist/esm/mcp-server/server.d.ts.map +1 -1
- package/dist/esm/mcp-server/server.js +3 -1
- package/dist/esm/mcp-server/server.js.map +1 -1
- package/dist/esm/mcp-server/tools/servingEligibilityPreview.d.ts +8 -0
- package/dist/esm/mcp-server/tools/servingEligibilityPreview.d.ts.map +1 -0
- package/dist/esm/mcp-server/tools/servingEligibilityPreview.js +28 -0
- package/dist/esm/mcp-server/tools/servingEligibilityPreview.js.map +1 -0
- package/dist/esm/models/components/acceleratorpriceband.d.ts +22 -0
- package/dist/esm/models/components/acceleratorpriceband.d.ts.map +1 -0
- package/dist/esm/models/components/acceleratorpriceband.js +22 -0
- package/dist/esm/models/components/acceleratorpriceband.js.map +1 -0
- package/dist/esm/models/components/acceleratortype.d.ts +22 -0
- package/dist/esm/models/components/acceleratortype.d.ts.map +1 -1
- package/dist/esm/models/components/acceleratortype.js +14 -0
- package/dist/esm/models/components/acceleratortype.js.map +1 -1
- package/dist/esm/models/components/acquirability.d.ts +20 -0
- package/dist/esm/models/components/acquirability.d.ts.map +1 -0
- package/dist/esm/models/components/acquirability.js +18 -0
- package/dist/esm/models/components/acquirability.js.map +1 -0
- package/dist/esm/models/components/eligibilitypreview.d.ts +73 -0
- package/dist/esm/models/components/eligibilitypreview.d.ts.map +1 -0
- package/dist/esm/models/components/eligibilitypreview.js +61 -0
- package/dist/esm/models/components/eligibilitypreview.js.map +1 -0
- package/dist/esm/models/components/eligibilitypriceband.d.ts +24 -0
- package/dist/esm/models/components/eligibilitypriceband.d.ts.map +1 -0
- package/dist/esm/models/components/eligibilitypriceband.js +24 -0
- package/dist/esm/models/components/eligibilitypriceband.js.map +1 -0
- package/dist/esm/models/components/eligibilityrequest.d.ts +28 -0
- package/dist/esm/models/components/eligibilityrequest.d.ts.map +1 -0
- package/dist/esm/models/components/eligibilityrequest.js +21 -0
- package/dist/esm/models/components/eligibilityrequest.js.map +1 -0
- package/dist/esm/models/components/index.d.ts +5 -0
- package/dist/esm/models/components/index.d.ts.map +1 -1
- package/dist/esm/models/components/index.js +5 -0
- package/dist/esm/models/components/index.js.map +1 -1
- package/dist/esm/models/components/replica.d.ts +30 -3
- package/dist/esm/models/components/replica.d.ts.map +1 -1
- package/dist/esm/models/components/replica.js +16 -2
- package/dist/esm/models/components/replica.js.map +1 -1
- package/dist/esm/models/operations/index.d.ts +1 -0
- package/dist/esm/models/operations/index.d.ts.map +1 -1
- package/dist/esm/models/operations/index.js +1 -0
- package/dist/esm/models/operations/index.js.map +1 -1
- package/dist/esm/models/operations/previeweligibility.d.ts +23 -0
- package/dist/esm/models/operations/previeweligibility.d.ts.map +1 -0
- package/dist/esm/models/operations/previeweligibility.js +34 -0
- package/dist/esm/models/operations/previeweligibility.js.map +1 -0
- package/dist/esm/react-query/index.d.ts +1 -0
- package/dist/esm/react-query/index.d.ts.map +1 -1
- package/dist/esm/react-query/index.js +1 -0
- package/dist/esm/react-query/index.js.map +1 -1
- package/dist/esm/react-query/servingEligibilityPreview.d.ts +30 -0
- package/dist/esm/react-query/servingEligibilityPreview.d.ts.map +1 -0
- package/dist/esm/react-query/servingEligibilityPreview.js +42 -0
- package/dist/esm/react-query/servingEligibilityPreview.js.map +1 -0
- package/dist/esm/sdk/eligibility.d.ts +13 -0
- package/dist/esm/sdk/eligibility.d.ts.map +1 -0
- package/dist/esm/sdk/eligibility.js +18 -0
- package/dist/esm/sdk/eligibility.js.map +1 -0
- package/dist/esm/sdk/serving.d.ts +3 -0
- package/dist/esm/sdk/serving.d.ts.map +1 -1
- package/dist/esm/sdk/serving.js +4 -0
- package/dist/esm/sdk/serving.js.map +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/servingEligibilityPreview.ts +193 -0
- package/src/lib/config.ts +2 -2
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +3 -1
- package/src/mcp-server/tools/servingEligibilityPreview.ts +37 -0
- package/src/models/components/acceleratorpriceband.ts +58 -0
- package/src/models/components/acceleratortype.ts +43 -0
- package/src/models/components/acquirability.ts +29 -0
- package/src/models/components/eligibilitypreview.ts +145 -0
- package/src/models/components/eligibilitypriceband.ts +62 -0
- package/src/models/components/eligibilityrequest.ts +67 -0
- package/src/models/components/index.ts +5 -0
- package/src/models/components/replica.ts +38 -5
- package/src/models/operations/index.ts +1 -0
- package/src/models/operations/previeweligibility.ts +70 -0
- package/src/react-query/index.ts +1 -0
- package/src/react-query/servingEligibilityPreview.ts +113 -0
- package/src/sdk/eligibility.ts +28 -0
- package/src/sdk/serving.ts +6 -0
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { SDKCore } from "../core.js";
|
|
6
|
+
import { encodeJSON, encodeSimple } from "../lib/encodings.js";
|
|
7
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
8
|
+
import * as M from "../lib/matchers.js";
|
|
9
|
+
import { compactMap } from "../lib/primitives.js";
|
|
10
|
+
import { safeParse } from "../lib/schemas.js";
|
|
11
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
12
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
13
|
+
import { pathToFunc } from "../lib/url.js";
|
|
14
|
+
import * as components from "../models/components/index.js";
|
|
15
|
+
import {
|
|
16
|
+
ConnectionError,
|
|
17
|
+
InvalidRequestError,
|
|
18
|
+
RequestAbortedError,
|
|
19
|
+
RequestTimeoutError,
|
|
20
|
+
UnexpectedClientError,
|
|
21
|
+
} from "../models/errors/httpclienterrors.js";
|
|
22
|
+
import * as errors from "../models/errors/index.js";
|
|
23
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
24
|
+
import { SDKError } from "../models/errors/sdkerror.js";
|
|
25
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
26
|
+
import * as operations from "../models/operations/index.js";
|
|
27
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
28
|
+
import { Result } from "../types/fp.js";
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Preview accelerator eligibility
|
|
32
|
+
*
|
|
33
|
+
* @remarks
|
|
34
|
+
* Preview, before submitting a job or deployment, how much matching capacity the cluster can currently acquire and how likely it is to start. The response is provider-anonymous: counts, price bands, and advice only. This is an advisory read; it reserves nothing.
|
|
35
|
+
*/
|
|
36
|
+
export function servingEligibilityPreview(
|
|
37
|
+
client: SDKCore,
|
|
38
|
+
request: operations.PreviewEligibilityRequest,
|
|
39
|
+
options?: RequestOptions,
|
|
40
|
+
): APIPromise<
|
|
41
|
+
Result<
|
|
42
|
+
components.EligibilityPreview,
|
|
43
|
+
| errors.ServingError
|
|
44
|
+
| errors.ServingHTTPValidationError
|
|
45
|
+
| SDKError
|
|
46
|
+
| ResponseValidationError
|
|
47
|
+
| ConnectionError
|
|
48
|
+
| RequestAbortedError
|
|
49
|
+
| RequestTimeoutError
|
|
50
|
+
| InvalidRequestError
|
|
51
|
+
| UnexpectedClientError
|
|
52
|
+
| SDKValidationError
|
|
53
|
+
>
|
|
54
|
+
> {
|
|
55
|
+
return new APIPromise($do(
|
|
56
|
+
client,
|
|
57
|
+
request,
|
|
58
|
+
options,
|
|
59
|
+
));
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
async function $do(
|
|
63
|
+
client: SDKCore,
|
|
64
|
+
request: operations.PreviewEligibilityRequest,
|
|
65
|
+
options?: RequestOptions,
|
|
66
|
+
): Promise<
|
|
67
|
+
[
|
|
68
|
+
Result<
|
|
69
|
+
components.EligibilityPreview,
|
|
70
|
+
| errors.ServingError
|
|
71
|
+
| errors.ServingHTTPValidationError
|
|
72
|
+
| SDKError
|
|
73
|
+
| ResponseValidationError
|
|
74
|
+
| ConnectionError
|
|
75
|
+
| RequestAbortedError
|
|
76
|
+
| RequestTimeoutError
|
|
77
|
+
| InvalidRequestError
|
|
78
|
+
| UnexpectedClientError
|
|
79
|
+
| SDKValidationError
|
|
80
|
+
>,
|
|
81
|
+
APICall,
|
|
82
|
+
]
|
|
83
|
+
> {
|
|
84
|
+
const parsed = safeParse(
|
|
85
|
+
request,
|
|
86
|
+
(value) => operations.PreviewEligibilityRequest$outboundSchema.parse(value),
|
|
87
|
+
"Input validation failed",
|
|
88
|
+
);
|
|
89
|
+
if (!parsed.ok) {
|
|
90
|
+
return [parsed, { status: "invalid" }];
|
|
91
|
+
}
|
|
92
|
+
const payload = parsed.value;
|
|
93
|
+
const body = encodeJSON("body", payload.EligibilityRequest, {
|
|
94
|
+
explode: true,
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
const path = pathToFunc("/api/v1/serving/eligibility")();
|
|
98
|
+
|
|
99
|
+
const headers = new Headers(compactMap({
|
|
100
|
+
"Content-Type": "application/json",
|
|
101
|
+
Accept: "application/json",
|
|
102
|
+
"X-On-Behalf-Of": encodeSimple(
|
|
103
|
+
"X-On-Behalf-Of",
|
|
104
|
+
payload["X-On-Behalf-Of"],
|
|
105
|
+
{ explode: false, charEncoding: "none" },
|
|
106
|
+
),
|
|
107
|
+
}));
|
|
108
|
+
|
|
109
|
+
const secConfig = await extractSecurity(client._options.bearerAuth);
|
|
110
|
+
const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
|
|
111
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
112
|
+
|
|
113
|
+
const context = {
|
|
114
|
+
options: client._options,
|
|
115
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
116
|
+
operationID: "previewEligibility",
|
|
117
|
+
oAuth2Scopes: null,
|
|
118
|
+
|
|
119
|
+
resolvedSecurity: requestSecurity,
|
|
120
|
+
|
|
121
|
+
securitySource: client._options.bearerAuth,
|
|
122
|
+
retryConfig: options?.retries
|
|
123
|
+
|| client._options.retryConfig
|
|
124
|
+
|| {
|
|
125
|
+
strategy: "backoff",
|
|
126
|
+
backoff: {
|
|
127
|
+
initialInterval: 500,
|
|
128
|
+
maxInterval: 5000,
|
|
129
|
+
exponent: 1.5,
|
|
130
|
+
maxElapsedTime: 15000,
|
|
131
|
+
},
|
|
132
|
+
retryConnectionErrors: true,
|
|
133
|
+
}
|
|
134
|
+
|| { strategy: "none" },
|
|
135
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
const requestRes = client._createRequest(context, {
|
|
139
|
+
security: requestSecurity,
|
|
140
|
+
method: "POST",
|
|
141
|
+
baseURL: options?.serverURL,
|
|
142
|
+
path: path,
|
|
143
|
+
headers: headers,
|
|
144
|
+
body: body,
|
|
145
|
+
userAgent: client._options.userAgent,
|
|
146
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
147
|
+
}, options);
|
|
148
|
+
if (!requestRes.ok) {
|
|
149
|
+
return [requestRes, { status: "invalid" }];
|
|
150
|
+
}
|
|
151
|
+
const req = requestRes.value;
|
|
152
|
+
|
|
153
|
+
const doResult = await client._do(req, {
|
|
154
|
+
context,
|
|
155
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
156
|
+
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
157
|
+
retryConfig: context.retryConfig,
|
|
158
|
+
retryCodes: context.retryCodes,
|
|
159
|
+
});
|
|
160
|
+
if (!doResult.ok) {
|
|
161
|
+
return [doResult, { status: "request-error", request: req }];
|
|
162
|
+
}
|
|
163
|
+
const response = doResult.value;
|
|
164
|
+
|
|
165
|
+
const responseFields = {
|
|
166
|
+
HttpMeta: { Response: response, Request: req },
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
const [result] = await M.match<
|
|
170
|
+
components.EligibilityPreview,
|
|
171
|
+
| errors.ServingError
|
|
172
|
+
| errors.ServingHTTPValidationError
|
|
173
|
+
| SDKError
|
|
174
|
+
| ResponseValidationError
|
|
175
|
+
| ConnectionError
|
|
176
|
+
| RequestAbortedError
|
|
177
|
+
| RequestTimeoutError
|
|
178
|
+
| InvalidRequestError
|
|
179
|
+
| UnexpectedClientError
|
|
180
|
+
| SDKValidationError
|
|
181
|
+
>(
|
|
182
|
+
M.json(200, components.EligibilityPreview$inboundSchema),
|
|
183
|
+
M.jsonErr(403, errors.ServingError$inboundSchema),
|
|
184
|
+
M.jsonErr(422, errors.ServingHTTPValidationError$inboundSchema),
|
|
185
|
+
M.fail([401, "4XX"]),
|
|
186
|
+
M.fail("5XX"),
|
|
187
|
+
)(response, req, { extraFields: responseFields });
|
|
188
|
+
if (!result.ok) {
|
|
189
|
+
return [result, { status: "complete", request: req, response }];
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
return [result, { status: "complete", request: req, response }];
|
|
193
|
+
}
|
package/src/lib/config.ts
CHANGED
|
@@ -65,7 +65,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
65
65
|
export const SDK_METADATA = {
|
|
66
66
|
language: "typescript",
|
|
67
67
|
openapiDocVersion: "1.1.0",
|
|
68
|
-
sdkVersion: "0.51.
|
|
68
|
+
sdkVersion: "0.51.15",
|
|
69
69
|
genVersion: "2.918.4",
|
|
70
|
-
userAgent: "speakeasy-sdk/typescript 0.51.
|
|
70
|
+
userAgent: "speakeasy-sdk/typescript 0.51.15 2.918.4 1.1.0 @meetkai/mka1",
|
|
71
71
|
} as const;
|
package/src/mcp-server/server.ts
CHANGED
|
@@ -314,6 +314,7 @@ import { tool$servingDeploymentsRegister } from "./tools/servingDeploymentsRegis
|
|
|
314
314
|
import { tool$servingDeploymentsRollback } from "./tools/servingDeploymentsRollback.js";
|
|
315
315
|
import { tool$servingDeploymentsUpdate } from "./tools/servingDeploymentsUpdate.js";
|
|
316
316
|
import { tool$servingDeploymentsUpdateScaling } from "./tools/servingDeploymentsUpdateScaling.js";
|
|
317
|
+
import { tool$servingEligibilityPreview } from "./tools/servingEligibilityPreview.js";
|
|
317
318
|
import { tool$servingFinetuneJobsCancel } from "./tools/servingFinetuneJobsCancel.js";
|
|
318
319
|
import { tool$servingFinetuneJobsCreate } from "./tools/servingFinetuneJobsCreate.js";
|
|
319
320
|
import { tool$servingFinetuneJobsGet } from "./tools/servingFinetuneJobsGet.js";
|
|
@@ -361,7 +362,7 @@ export function createMCPServer(deps: {
|
|
|
361
362
|
}) {
|
|
362
363
|
const server = new McpServer({
|
|
363
364
|
name: "SDK",
|
|
364
|
-
version: "0.51.
|
|
365
|
+
version: "0.51.15",
|
|
365
366
|
});
|
|
366
367
|
|
|
367
368
|
const client = new SDKCore({
|
|
@@ -694,6 +695,7 @@ export function createMCPServer(deps: {
|
|
|
694
695
|
tool(tool$servingDeploymentsListRevisions);
|
|
695
696
|
tool(tool$servingDeploymentsRollback);
|
|
696
697
|
tool(tool$servingDeploymentsUpdateScaling);
|
|
698
|
+
tool(tool$servingEligibilityPreview);
|
|
697
699
|
tool(tool$servingFinetuneJobsList);
|
|
698
700
|
tool(tool$servingFinetuneJobsCreate);
|
|
699
701
|
tool(tool$servingFinetuneJobsCancel);
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { servingEligibilityPreview } from "../../funcs/servingEligibilityPreview.js";
|
|
6
|
+
import * as operations from "../../models/operations/index.js";
|
|
7
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
|
+
|
|
9
|
+
const args = {
|
|
10
|
+
request: operations.PreviewEligibilityRequest$inboundSchema,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const tool$servingEligibilityPreview: ToolDefinition<typeof args> = {
|
|
14
|
+
name: "serving-eligibility-preview",
|
|
15
|
+
description: `Preview accelerator eligibility
|
|
16
|
+
|
|
17
|
+
Preview, before submitting a job or deployment, how much matching capacity the cluster can currently acquire and how likely it is to start. The response is provider-anonymous: counts, price bands, and advice only. This is an advisory read; it reserves nothing.`,
|
|
18
|
+
args,
|
|
19
|
+
tool: async (client, args, ctx) => {
|
|
20
|
+
const [result, apiCall] = await servingEligibilityPreview(
|
|
21
|
+
client,
|
|
22
|
+
args.request,
|
|
23
|
+
{ fetchOptions: { signal: ctx.signal } },
|
|
24
|
+
).$inspect();
|
|
25
|
+
|
|
26
|
+
if (!result.ok) {
|
|
27
|
+
return {
|
|
28
|
+
content: [{ type: "text", text: result.error.message }],
|
|
29
|
+
isError: true,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const value = result.value;
|
|
34
|
+
|
|
35
|
+
return formatResult(value, apiCall);
|
|
36
|
+
},
|
|
37
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
7
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
8
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* USD-per-hour price band across configurations acquirable now for an accelerator type.
|
|
12
|
+
*/
|
|
13
|
+
export type AcceleratorPriceBand = {
|
|
14
|
+
min: number;
|
|
15
|
+
p50: number;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
/** @internal */
|
|
19
|
+
export const AcceleratorPriceBand$inboundSchema: z.ZodType<
|
|
20
|
+
AcceleratorPriceBand,
|
|
21
|
+
z.ZodTypeDef,
|
|
22
|
+
unknown
|
|
23
|
+
> = z.object({
|
|
24
|
+
min: z.number(),
|
|
25
|
+
p50: z.number(),
|
|
26
|
+
});
|
|
27
|
+
/** @internal */
|
|
28
|
+
export type AcceleratorPriceBand$Outbound = {
|
|
29
|
+
min: number;
|
|
30
|
+
p50: number;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
/** @internal */
|
|
34
|
+
export const AcceleratorPriceBand$outboundSchema: z.ZodType<
|
|
35
|
+
AcceleratorPriceBand$Outbound,
|
|
36
|
+
z.ZodTypeDef,
|
|
37
|
+
AcceleratorPriceBand
|
|
38
|
+
> = z.object({
|
|
39
|
+
min: z.number(),
|
|
40
|
+
p50: z.number(),
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
export function acceleratorPriceBandToJSON(
|
|
44
|
+
acceleratorPriceBand: AcceleratorPriceBand,
|
|
45
|
+
): string {
|
|
46
|
+
return JSON.stringify(
|
|
47
|
+
AcceleratorPriceBand$outboundSchema.parse(acceleratorPriceBand),
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
export function acceleratorPriceBandFromJSON(
|
|
51
|
+
jsonString: string,
|
|
52
|
+
): SafeParseResult<AcceleratorPriceBand, SDKValidationError> {
|
|
53
|
+
return safeParse(
|
|
54
|
+
jsonString,
|
|
55
|
+
(x) => AcceleratorPriceBand$inboundSchema.parse(JSON.parse(x)),
|
|
56
|
+
`Failed to parse 'AcceleratorPriceBand' from JSON`,
|
|
57
|
+
);
|
|
58
|
+
}
|
|
@@ -8,6 +8,17 @@ import { safeParse } from "../../lib/schemas.js";
|
|
|
8
8
|
import { ClosedEnum } from "../../types/enums.js";
|
|
9
9
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
10
10
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
11
|
+
import {
|
|
12
|
+
AcceleratorPriceBand,
|
|
13
|
+
AcceleratorPriceBand$inboundSchema,
|
|
14
|
+
AcceleratorPriceBand$Outbound,
|
|
15
|
+
AcceleratorPriceBand$outboundSchema,
|
|
16
|
+
} from "./acceleratorpriceband.js";
|
|
17
|
+
import {
|
|
18
|
+
Acquirability,
|
|
19
|
+
Acquirability$inboundSchema,
|
|
20
|
+
Acquirability$outboundSchema,
|
|
21
|
+
} from "./acquirability.js";
|
|
11
22
|
|
|
12
23
|
export const Kind = {
|
|
13
24
|
Gpu: "gpu",
|
|
@@ -21,6 +32,14 @@ export type Kind = ClosedEnum<typeof Kind>;
|
|
|
21
32
|
* An offered accelerator type in the catalog.
|
|
22
33
|
*/
|
|
23
34
|
export type AcceleratorType = {
|
|
35
|
+
/**
|
|
36
|
+
* Banded estimate of how reliably matching capacity can be acquired, computed from availability history. "unknown" means no history, never a guess.
|
|
37
|
+
*/
|
|
38
|
+
acquirability?: Acquirability | undefined;
|
|
39
|
+
/**
|
|
40
|
+
* Configurations acquirable now (0 when offered is false). Absent when live market data is unavailable.
|
|
41
|
+
*/
|
|
42
|
+
acquirableCount?: number | undefined;
|
|
24
43
|
kind?: Kind | undefined;
|
|
25
44
|
/**
|
|
26
45
|
* Max accelerators of this type per replica
|
|
@@ -28,6 +47,14 @@ export type AcceleratorType = {
|
|
|
28
47
|
maxCount: number;
|
|
29
48
|
memoryGb: number;
|
|
30
49
|
name: string;
|
|
50
|
+
/**
|
|
51
|
+
* Whether any capacity acquirable right now matches this type. Absent when live market data is unavailable.
|
|
52
|
+
*/
|
|
53
|
+
offered?: boolean | undefined;
|
|
54
|
+
/**
|
|
55
|
+
* USD-per-hour price band across configurations acquirable now for an accelerator type.
|
|
56
|
+
*/
|
|
57
|
+
priceUsdHr?: AcceleratorPriceBand | undefined;
|
|
31
58
|
vendor: string;
|
|
32
59
|
};
|
|
33
60
|
|
|
@@ -45,23 +72,33 @@ export const AcceleratorType$inboundSchema: z.ZodType<
|
|
|
45
72
|
z.ZodTypeDef,
|
|
46
73
|
unknown
|
|
47
74
|
> = z.object({
|
|
75
|
+
acquirability: Acquirability$inboundSchema.optional(),
|
|
76
|
+
acquirable_count: z.number().int().optional(),
|
|
48
77
|
kind: Kind$inboundSchema.default("gpu"),
|
|
49
78
|
max_count: z.number().int(),
|
|
50
79
|
memory_gb: z.number().int(),
|
|
51
80
|
name: z.string(),
|
|
81
|
+
offered: z.boolean().optional(),
|
|
82
|
+
price_usd_hr: AcceleratorPriceBand$inboundSchema.optional(),
|
|
52
83
|
vendor: z.string(),
|
|
53
84
|
}).transform((v) => {
|
|
54
85
|
return remap$(v, {
|
|
86
|
+
"acquirable_count": "acquirableCount",
|
|
55
87
|
"max_count": "maxCount",
|
|
56
88
|
"memory_gb": "memoryGb",
|
|
89
|
+
"price_usd_hr": "priceUsdHr",
|
|
57
90
|
});
|
|
58
91
|
});
|
|
59
92
|
/** @internal */
|
|
60
93
|
export type AcceleratorType$Outbound = {
|
|
94
|
+
acquirability?: string | undefined;
|
|
95
|
+
acquirable_count?: number | undefined;
|
|
61
96
|
kind: string;
|
|
62
97
|
max_count: number;
|
|
63
98
|
memory_gb: number;
|
|
64
99
|
name: string;
|
|
100
|
+
offered?: boolean | undefined;
|
|
101
|
+
price_usd_hr?: AcceleratorPriceBand$Outbound | undefined;
|
|
65
102
|
vendor: string;
|
|
66
103
|
};
|
|
67
104
|
|
|
@@ -71,15 +108,21 @@ export const AcceleratorType$outboundSchema: z.ZodType<
|
|
|
71
108
|
z.ZodTypeDef,
|
|
72
109
|
AcceleratorType
|
|
73
110
|
> = z.object({
|
|
111
|
+
acquirability: Acquirability$outboundSchema.optional(),
|
|
112
|
+
acquirableCount: z.number().int().optional(),
|
|
74
113
|
kind: Kind$outboundSchema.default("gpu"),
|
|
75
114
|
maxCount: z.number().int(),
|
|
76
115
|
memoryGb: z.number().int(),
|
|
77
116
|
name: z.string(),
|
|
117
|
+
offered: z.boolean().optional(),
|
|
118
|
+
priceUsdHr: AcceleratorPriceBand$outboundSchema.optional(),
|
|
78
119
|
vendor: z.string(),
|
|
79
120
|
}).transform((v) => {
|
|
80
121
|
return remap$(v, {
|
|
122
|
+
acquirableCount: "acquirable_count",
|
|
81
123
|
maxCount: "max_count",
|
|
82
124
|
memoryGb: "memory_gb",
|
|
125
|
+
priceUsdHr: "price_usd_hr",
|
|
83
126
|
});
|
|
84
127
|
});
|
|
85
128
|
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Banded estimate of how reliably matching capacity can be acquired, computed from availability history. "unknown" means no history, never a guess.
|
|
10
|
+
*/
|
|
11
|
+
export const Acquirability = {
|
|
12
|
+
High: "high",
|
|
13
|
+
Medium: "medium",
|
|
14
|
+
Low: "low",
|
|
15
|
+
Unknown: "unknown",
|
|
16
|
+
} as const;
|
|
17
|
+
/**
|
|
18
|
+
* Banded estimate of how reliably matching capacity can be acquired, computed from availability history. "unknown" means no history, never a guess.
|
|
19
|
+
*/
|
|
20
|
+
export type Acquirability = ClosedEnum<typeof Acquirability>;
|
|
21
|
+
|
|
22
|
+
/** @internal */
|
|
23
|
+
export const Acquirability$inboundSchema: z.ZodNativeEnum<
|
|
24
|
+
typeof Acquirability
|
|
25
|
+
> = z.nativeEnum(Acquirability);
|
|
26
|
+
/** @internal */
|
|
27
|
+
export const Acquirability$outboundSchema: z.ZodNativeEnum<
|
|
28
|
+
typeof Acquirability
|
|
29
|
+
> = Acquirability$inboundSchema;
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
9
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
10
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
11
|
+
import {
|
|
12
|
+
Acquirability,
|
|
13
|
+
Acquirability$inboundSchema,
|
|
14
|
+
Acquirability$outboundSchema,
|
|
15
|
+
} from "./acquirability.js";
|
|
16
|
+
import {
|
|
17
|
+
EligibilityPriceBand,
|
|
18
|
+
EligibilityPriceBand$inboundSchema,
|
|
19
|
+
EligibilityPriceBand$Outbound,
|
|
20
|
+
EligibilityPriceBand$outboundSchema,
|
|
21
|
+
} from "./eligibilitypriceband.js";
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Coarse expected-start band for the request as the market looks now.
|
|
25
|
+
*/
|
|
26
|
+
export const EstStart = {
|
|
27
|
+
Immediate: "immediate",
|
|
28
|
+
Minutes: "minutes",
|
|
29
|
+
Queued: "queued",
|
|
30
|
+
Unknown: "unknown",
|
|
31
|
+
} as const;
|
|
32
|
+
/**
|
|
33
|
+
* Coarse expected-start band for the request as the market looks now.
|
|
34
|
+
*/
|
|
35
|
+
export type EstStart = ClosedEnum<typeof EstStart>;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Provider-anonymous capacity preview: counts, price bands, and advice only. Configurations, providers, regions, and SKUs are never enumerated.
|
|
39
|
+
*/
|
|
40
|
+
export type EligibilityPreview = {
|
|
41
|
+
/**
|
|
42
|
+
* Banded estimate of how reliably matching capacity can be acquired, computed from availability history. "unknown" means no history, never a guess.
|
|
43
|
+
*/
|
|
44
|
+
acquirability: Acquirability;
|
|
45
|
+
/**
|
|
46
|
+
* Matching configurations that could start immediately.
|
|
47
|
+
*/
|
|
48
|
+
acquirableNow: number;
|
|
49
|
+
/**
|
|
50
|
+
* Machine-generated, provider-anonymous guidance.
|
|
51
|
+
*/
|
|
52
|
+
advice: Array<string>;
|
|
53
|
+
/**
|
|
54
|
+
* Whether any known configuration matches the request.
|
|
55
|
+
*/
|
|
56
|
+
eligible: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Coarse expected-start band for the request as the market looks now.
|
|
59
|
+
*/
|
|
60
|
+
estStart: EstStart;
|
|
61
|
+
/**
|
|
62
|
+
* USD-per-hour price band across the configurations matching an eligibility request.
|
|
63
|
+
*/
|
|
64
|
+
priceUsdHr?: EligibilityPriceBand | undefined;
|
|
65
|
+
/**
|
|
66
|
+
* Known matching configurations currently out of stock.
|
|
67
|
+
*/
|
|
68
|
+
watchable: number;
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
/** @internal */
|
|
72
|
+
export const EstStart$inboundSchema: z.ZodNativeEnum<typeof EstStart> = z
|
|
73
|
+
.nativeEnum(EstStart);
|
|
74
|
+
/** @internal */
|
|
75
|
+
export const EstStart$outboundSchema: z.ZodNativeEnum<typeof EstStart> =
|
|
76
|
+
EstStart$inboundSchema;
|
|
77
|
+
|
|
78
|
+
/** @internal */
|
|
79
|
+
export const EligibilityPreview$inboundSchema: z.ZodType<
|
|
80
|
+
EligibilityPreview,
|
|
81
|
+
z.ZodTypeDef,
|
|
82
|
+
unknown
|
|
83
|
+
> = z.object({
|
|
84
|
+
acquirability: Acquirability$inboundSchema,
|
|
85
|
+
acquirable_now: z.number().int(),
|
|
86
|
+
advice: z.array(z.string()),
|
|
87
|
+
eligible: z.boolean(),
|
|
88
|
+
est_start: EstStart$inboundSchema,
|
|
89
|
+
price_usd_hr: EligibilityPriceBand$inboundSchema.optional(),
|
|
90
|
+
watchable: z.number().int(),
|
|
91
|
+
}).transform((v) => {
|
|
92
|
+
return remap$(v, {
|
|
93
|
+
"acquirable_now": "acquirableNow",
|
|
94
|
+
"est_start": "estStart",
|
|
95
|
+
"price_usd_hr": "priceUsdHr",
|
|
96
|
+
});
|
|
97
|
+
});
|
|
98
|
+
/** @internal */
|
|
99
|
+
export type EligibilityPreview$Outbound = {
|
|
100
|
+
acquirability: string;
|
|
101
|
+
acquirable_now: number;
|
|
102
|
+
advice: Array<string>;
|
|
103
|
+
eligible: boolean;
|
|
104
|
+
est_start: string;
|
|
105
|
+
price_usd_hr?: EligibilityPriceBand$Outbound | undefined;
|
|
106
|
+
watchable: number;
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
/** @internal */
|
|
110
|
+
export const EligibilityPreview$outboundSchema: z.ZodType<
|
|
111
|
+
EligibilityPreview$Outbound,
|
|
112
|
+
z.ZodTypeDef,
|
|
113
|
+
EligibilityPreview
|
|
114
|
+
> = z.object({
|
|
115
|
+
acquirability: Acquirability$outboundSchema,
|
|
116
|
+
acquirableNow: z.number().int(),
|
|
117
|
+
advice: z.array(z.string()),
|
|
118
|
+
eligible: z.boolean(),
|
|
119
|
+
estStart: EstStart$outboundSchema,
|
|
120
|
+
priceUsdHr: EligibilityPriceBand$outboundSchema.optional(),
|
|
121
|
+
watchable: z.number().int(),
|
|
122
|
+
}).transform((v) => {
|
|
123
|
+
return remap$(v, {
|
|
124
|
+
acquirableNow: "acquirable_now",
|
|
125
|
+
estStart: "est_start",
|
|
126
|
+
priceUsdHr: "price_usd_hr",
|
|
127
|
+
});
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
export function eligibilityPreviewToJSON(
|
|
131
|
+
eligibilityPreview: EligibilityPreview,
|
|
132
|
+
): string {
|
|
133
|
+
return JSON.stringify(
|
|
134
|
+
EligibilityPreview$outboundSchema.parse(eligibilityPreview),
|
|
135
|
+
);
|
|
136
|
+
}
|
|
137
|
+
export function eligibilityPreviewFromJSON(
|
|
138
|
+
jsonString: string,
|
|
139
|
+
): SafeParseResult<EligibilityPreview, SDKValidationError> {
|
|
140
|
+
return safeParse(
|
|
141
|
+
jsonString,
|
|
142
|
+
(x) => EligibilityPreview$inboundSchema.parse(JSON.parse(x)),
|
|
143
|
+
`Failed to parse 'EligibilityPreview' from JSON`,
|
|
144
|
+
);
|
|
145
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
7
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
8
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* USD-per-hour price band across the configurations matching an eligibility request.
|
|
12
|
+
*/
|
|
13
|
+
export type EligibilityPriceBand = {
|
|
14
|
+
max: number;
|
|
15
|
+
min: number;
|
|
16
|
+
p50: number;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
/** @internal */
|
|
20
|
+
export const EligibilityPriceBand$inboundSchema: z.ZodType<
|
|
21
|
+
EligibilityPriceBand,
|
|
22
|
+
z.ZodTypeDef,
|
|
23
|
+
unknown
|
|
24
|
+
> = z.object({
|
|
25
|
+
max: z.number(),
|
|
26
|
+
min: z.number(),
|
|
27
|
+
p50: z.number(),
|
|
28
|
+
});
|
|
29
|
+
/** @internal */
|
|
30
|
+
export type EligibilityPriceBand$Outbound = {
|
|
31
|
+
max: number;
|
|
32
|
+
min: number;
|
|
33
|
+
p50: number;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
/** @internal */
|
|
37
|
+
export const EligibilityPriceBand$outboundSchema: z.ZodType<
|
|
38
|
+
EligibilityPriceBand$Outbound,
|
|
39
|
+
z.ZodTypeDef,
|
|
40
|
+
EligibilityPriceBand
|
|
41
|
+
> = z.object({
|
|
42
|
+
max: z.number(),
|
|
43
|
+
min: z.number(),
|
|
44
|
+
p50: z.number(),
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
export function eligibilityPriceBandToJSON(
|
|
48
|
+
eligibilityPriceBand: EligibilityPriceBand,
|
|
49
|
+
): string {
|
|
50
|
+
return JSON.stringify(
|
|
51
|
+
EligibilityPriceBand$outboundSchema.parse(eligibilityPriceBand),
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
export function eligibilityPriceBandFromJSON(
|
|
55
|
+
jsonString: string,
|
|
56
|
+
): SafeParseResult<EligibilityPriceBand, SDKValidationError> {
|
|
57
|
+
return safeParse(
|
|
58
|
+
jsonString,
|
|
59
|
+
(x) => EligibilityPriceBand$inboundSchema.parse(JSON.parse(x)),
|
|
60
|
+
`Failed to parse 'EligibilityPriceBand' from JSON`,
|
|
61
|
+
);
|
|
62
|
+
}
|