@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,67 @@
|
|
|
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
|
+
import {
|
|
10
|
+
AcceleratorSpec,
|
|
11
|
+
AcceleratorSpec$inboundSchema,
|
|
12
|
+
AcceleratorSpec$Outbound,
|
|
13
|
+
AcceleratorSpec$outboundSchema,
|
|
14
|
+
} from "./acceleratorspec.js";
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Pre-submission eligibility preview request. Mirrors the job form's accelerator block: type, count, and optional ordered fallback types.
|
|
18
|
+
*/
|
|
19
|
+
export type EligibilityRequest = {
|
|
20
|
+
/**
|
|
21
|
+
* A hardware accelerator request — GPU, NPU, TPU, or similar.
|
|
22
|
+
*
|
|
23
|
+
* @remarks
|
|
24
|
+
*
|
|
25
|
+
* Request an accelerator by type and count, with optional fallback types.
|
|
26
|
+
*/
|
|
27
|
+
accelerator: AcceleratorSpec;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
/** @internal */
|
|
31
|
+
export const EligibilityRequest$inboundSchema: z.ZodType<
|
|
32
|
+
EligibilityRequest,
|
|
33
|
+
z.ZodTypeDef,
|
|
34
|
+
unknown
|
|
35
|
+
> = z.object({
|
|
36
|
+
accelerator: AcceleratorSpec$inboundSchema,
|
|
37
|
+
});
|
|
38
|
+
/** @internal */
|
|
39
|
+
export type EligibilityRequest$Outbound = {
|
|
40
|
+
accelerator: AcceleratorSpec$Outbound;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
/** @internal */
|
|
44
|
+
export const EligibilityRequest$outboundSchema: z.ZodType<
|
|
45
|
+
EligibilityRequest$Outbound,
|
|
46
|
+
z.ZodTypeDef,
|
|
47
|
+
EligibilityRequest
|
|
48
|
+
> = z.object({
|
|
49
|
+
accelerator: AcceleratorSpec$outboundSchema,
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
export function eligibilityRequestToJSON(
|
|
53
|
+
eligibilityRequest: EligibilityRequest,
|
|
54
|
+
): string {
|
|
55
|
+
return JSON.stringify(
|
|
56
|
+
EligibilityRequest$outboundSchema.parse(eligibilityRequest),
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
export function eligibilityRequestFromJSON(
|
|
60
|
+
jsonString: string,
|
|
61
|
+
): SafeParseResult<EligibilityRequest, SDKValidationError> {
|
|
62
|
+
return safeParse(
|
|
63
|
+
jsonString,
|
|
64
|
+
(x) => EligibilityRequest$inboundSchema.parse(JSON.parse(x)),
|
|
65
|
+
`Failed to parse 'EligibilityRequest' from JSON`,
|
|
66
|
+
);
|
|
67
|
+
}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
+
export * from "./acceleratorpriceband.js";
|
|
5
6
|
export * from "./acceleratorspec.js";
|
|
6
7
|
export * from "./acceleratortype.js";
|
|
7
8
|
export * from "./accessentry.js";
|
|
@@ -9,6 +10,7 @@ export * from "./accesslistresponse.js";
|
|
|
9
10
|
export * from "./accessmutationrequest.js";
|
|
10
11
|
export * from "./accessmutationresponse.js";
|
|
11
12
|
export * from "./acknowledgedsafetycheck.js";
|
|
13
|
+
export * from "./acquirability.js";
|
|
12
14
|
export * from "./activateregistryentryrequest.js";
|
|
13
15
|
export * from "./addcatalogmodelrequest.js";
|
|
14
16
|
export * from "./agent.js";
|
|
@@ -149,6 +151,9 @@ export * from "./dpohyperparameters.js";
|
|
|
149
151
|
export * from "./dragaction.js";
|
|
150
152
|
export * from "./effectivepricerow.js";
|
|
151
153
|
export * from "./effectivepricesresponse.js";
|
|
154
|
+
export * from "./eligibilitypreview.js";
|
|
155
|
+
export * from "./eligibilitypriceband.js";
|
|
156
|
+
export * from "./eligibilityrequest.js";
|
|
152
157
|
export * from "./embeddingmodel.js";
|
|
153
158
|
export * from "./embeddingmodellimits.js";
|
|
154
159
|
export * from "./embeddingmodellistresponse.js";
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import * as z from "zod/v3";
|
|
6
6
|
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
7
|
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
8
9
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
10
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
11
|
import {
|
|
@@ -14,6 +15,18 @@ import {
|
|
|
14
15
|
DeploymentAcceleratorSpec$outboundSchema,
|
|
15
16
|
} from "./deploymentacceleratorspec.js";
|
|
16
17
|
|
|
18
|
+
/**
|
|
19
|
+
* Whether the replica runs on cluster-internal capacity or externally acquired capacity
|
|
20
|
+
*/
|
|
21
|
+
export const Placement = {
|
|
22
|
+
Internal: "internal",
|
|
23
|
+
External: "external",
|
|
24
|
+
} as const;
|
|
25
|
+
/**
|
|
26
|
+
* Whether the replica runs on cluster-internal capacity or externally acquired capacity
|
|
27
|
+
*/
|
|
28
|
+
export type Placement = ClosedEnum<typeof Placement>;
|
|
29
|
+
|
|
17
30
|
/**
|
|
18
31
|
* A single running replica (pod/container) behind a deployment.
|
|
19
32
|
*/
|
|
@@ -27,23 +40,40 @@ export type Replica = {
|
|
|
27
40
|
*/
|
|
28
41
|
accelerator: DeploymentAcceleratorSpec;
|
|
29
42
|
id: string;
|
|
30
|
-
|
|
43
|
+
/**
|
|
44
|
+
* Whether the replica runs on cluster-internal capacity or externally acquired capacity
|
|
45
|
+
*/
|
|
46
|
+
placement: Placement;
|
|
31
47
|
priceUsdHr?: number | undefined;
|
|
32
48
|
/**
|
|
33
|
-
*
|
|
49
|
+
* Backing infrastructure identity when allocated; omitted when the cluster hides provider identity
|
|
34
50
|
*/
|
|
35
51
|
provider?: string | undefined;
|
|
52
|
+
/**
|
|
53
|
+
* Backing infrastructure region when allocated; omitted when the cluster hides provider identity
|
|
54
|
+
*/
|
|
36
55
|
region?: string | undefined;
|
|
37
56
|
startedAt?: Date | null | undefined;
|
|
38
57
|
status: string;
|
|
58
|
+
/**
|
|
59
|
+
* Opaque placement zone identifier, stable per allocation
|
|
60
|
+
*/
|
|
61
|
+
zone: string;
|
|
39
62
|
};
|
|
40
63
|
|
|
64
|
+
/** @internal */
|
|
65
|
+
export const Placement$inboundSchema: z.ZodNativeEnum<typeof Placement> = z
|
|
66
|
+
.nativeEnum(Placement);
|
|
67
|
+
/** @internal */
|
|
68
|
+
export const Placement$outboundSchema: z.ZodNativeEnum<typeof Placement> =
|
|
69
|
+
Placement$inboundSchema;
|
|
70
|
+
|
|
41
71
|
/** @internal */
|
|
42
72
|
export const Replica$inboundSchema: z.ZodType<Replica, z.ZodTypeDef, unknown> =
|
|
43
73
|
z.object({
|
|
44
74
|
accelerator: DeploymentAcceleratorSpec$inboundSchema,
|
|
45
75
|
id: z.string(),
|
|
46
|
-
|
|
76
|
+
placement: Placement$inboundSchema,
|
|
47
77
|
price_usd_hr: z.number().optional(),
|
|
48
78
|
provider: z.string().optional(),
|
|
49
79
|
region: z.string().optional(),
|
|
@@ -51,6 +81,7 @@ export const Replica$inboundSchema: z.ZodType<Replica, z.ZodTypeDef, unknown> =
|
|
|
51
81
|
z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
52
82
|
).optional(),
|
|
53
83
|
status: z.string(),
|
|
84
|
+
zone: z.string(),
|
|
54
85
|
}).transform((v) => {
|
|
55
86
|
return remap$(v, {
|
|
56
87
|
"price_usd_hr": "priceUsdHr",
|
|
@@ -61,12 +92,13 @@ export const Replica$inboundSchema: z.ZodType<Replica, z.ZodTypeDef, unknown> =
|
|
|
61
92
|
export type Replica$Outbound = {
|
|
62
93
|
accelerator: DeploymentAcceleratorSpec$Outbound;
|
|
63
94
|
id: string;
|
|
64
|
-
|
|
95
|
+
placement: string;
|
|
65
96
|
price_usd_hr?: number | undefined;
|
|
66
97
|
provider?: string | undefined;
|
|
67
98
|
region?: string | undefined;
|
|
68
99
|
started_at?: string | null | undefined;
|
|
69
100
|
status: string;
|
|
101
|
+
zone: string;
|
|
70
102
|
};
|
|
71
103
|
|
|
72
104
|
/** @internal */
|
|
@@ -77,12 +109,13 @@ export const Replica$outboundSchema: z.ZodType<
|
|
|
77
109
|
> = z.object({
|
|
78
110
|
accelerator: DeploymentAcceleratorSpec$outboundSchema,
|
|
79
111
|
id: z.string(),
|
|
80
|
-
|
|
112
|
+
placement: Placement$outboundSchema,
|
|
81
113
|
priceUsdHr: z.number().optional(),
|
|
82
114
|
provider: z.string().optional(),
|
|
83
115
|
region: z.string().optional(),
|
|
84
116
|
startedAt: z.nullable(z.date().transform(v => v.toISOString())).optional(),
|
|
85
117
|
status: z.string(),
|
|
118
|
+
zone: z.string(),
|
|
86
119
|
}).transform((v) => {
|
|
87
120
|
return remap$(v, {
|
|
88
121
|
priceUsdHr: "price_usd_hr",
|
|
@@ -260,6 +260,7 @@ export * from "./llmrevoke.js";
|
|
|
260
260
|
export * from "./modifyvectorstore.js";
|
|
261
261
|
export * from "./pauseagentschedule.js";
|
|
262
262
|
export * from "./pausefinetuningjob.js";
|
|
263
|
+
export * from "./previeweligibility.js";
|
|
263
264
|
export * from "./proxybrowserportrequest.js";
|
|
264
265
|
export * from "./putorgautomodel.js";
|
|
265
266
|
export * from "./regeneratescopedapikey.js";
|
|
@@ -0,0 +1,70 @@
|
|
|
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 { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import * as components from "../components/index.js";
|
|
10
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
11
|
+
|
|
12
|
+
export type PreviewEligibilityRequest = {
|
|
13
|
+
/**
|
|
14
|
+
* Optional external end-user identifier forwarded by the API gateway.
|
|
15
|
+
*/
|
|
16
|
+
xOnBehalfOf?: string | undefined;
|
|
17
|
+
eligibilityRequest: components.EligibilityRequest;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
/** @internal */
|
|
21
|
+
export const PreviewEligibilityRequest$inboundSchema: z.ZodType<
|
|
22
|
+
PreviewEligibilityRequest,
|
|
23
|
+
z.ZodTypeDef,
|
|
24
|
+
unknown
|
|
25
|
+
> = z.object({
|
|
26
|
+
"X-On-Behalf-Of": z.string().optional(),
|
|
27
|
+
EligibilityRequest: components.EligibilityRequest$inboundSchema,
|
|
28
|
+
}).transform((v) => {
|
|
29
|
+
return remap$(v, {
|
|
30
|
+
"X-On-Behalf-Of": "xOnBehalfOf",
|
|
31
|
+
"EligibilityRequest": "eligibilityRequest",
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
/** @internal */
|
|
35
|
+
export type PreviewEligibilityRequest$Outbound = {
|
|
36
|
+
"X-On-Behalf-Of"?: string | undefined;
|
|
37
|
+
EligibilityRequest: components.EligibilityRequest$Outbound;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
/** @internal */
|
|
41
|
+
export const PreviewEligibilityRequest$outboundSchema: z.ZodType<
|
|
42
|
+
PreviewEligibilityRequest$Outbound,
|
|
43
|
+
z.ZodTypeDef,
|
|
44
|
+
PreviewEligibilityRequest
|
|
45
|
+
> = z.object({
|
|
46
|
+
xOnBehalfOf: z.string().optional(),
|
|
47
|
+
eligibilityRequest: components.EligibilityRequest$outboundSchema,
|
|
48
|
+
}).transform((v) => {
|
|
49
|
+
return remap$(v, {
|
|
50
|
+
xOnBehalfOf: "X-On-Behalf-Of",
|
|
51
|
+
eligibilityRequest: "EligibilityRequest",
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
export function previewEligibilityRequestToJSON(
|
|
56
|
+
previewEligibilityRequest: PreviewEligibilityRequest,
|
|
57
|
+
): string {
|
|
58
|
+
return JSON.stringify(
|
|
59
|
+
PreviewEligibilityRequest$outboundSchema.parse(previewEligibilityRequest),
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
export function previewEligibilityRequestFromJSON(
|
|
63
|
+
jsonString: string,
|
|
64
|
+
): SafeParseResult<PreviewEligibilityRequest, SDKValidationError> {
|
|
65
|
+
return safeParse(
|
|
66
|
+
jsonString,
|
|
67
|
+
(x) => PreviewEligibilityRequest$inboundSchema.parse(JSON.parse(x)),
|
|
68
|
+
`Failed to parse 'PreviewEligibilityRequest' from JSON`,
|
|
69
|
+
);
|
|
70
|
+
}
|
package/src/react-query/index.ts
CHANGED
|
@@ -307,6 +307,7 @@ export * from "./servingDeploymentsRegister.js";
|
|
|
307
307
|
export * from "./servingDeploymentsRollback.js";
|
|
308
308
|
export * from "./servingDeploymentsUpdate.js";
|
|
309
309
|
export * from "./servingDeploymentsUpdateScaling.js";
|
|
310
|
+
export * from "./servingEligibilityPreview.js";
|
|
310
311
|
export * from "./servingFinetuneJobsCancel.js";
|
|
311
312
|
export * from "./servingFinetuneJobsCreate.js";
|
|
312
313
|
export * from "./servingFinetuneJobsGet.js";
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
MutationKey,
|
|
7
|
+
useMutation,
|
|
8
|
+
UseMutationResult,
|
|
9
|
+
} from "@tanstack/react-query";
|
|
10
|
+
import { SDKCore } from "../core.js";
|
|
11
|
+
import { servingEligibilityPreview } from "../funcs/servingEligibilityPreview.js";
|
|
12
|
+
import { combineSignals } from "../lib/primitives.js";
|
|
13
|
+
import { RequestOptions } from "../lib/sdks.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 { unwrapAsync } from "../types/fp.js";
|
|
28
|
+
import { useSDKContext } from "./_context.js";
|
|
29
|
+
import { MutationHookOptions } from "./_types.js";
|
|
30
|
+
|
|
31
|
+
export type ServingEligibilityPreviewMutationVariables = {
|
|
32
|
+
request: operations.PreviewEligibilityRequest;
|
|
33
|
+
options?: RequestOptions;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export type ServingEligibilityPreviewMutationData =
|
|
37
|
+
components.EligibilityPreview;
|
|
38
|
+
|
|
39
|
+
export type ServingEligibilityPreviewMutationError =
|
|
40
|
+
| errors.ServingError
|
|
41
|
+
| errors.ServingHTTPValidationError
|
|
42
|
+
| SDKError
|
|
43
|
+
| ResponseValidationError
|
|
44
|
+
| ConnectionError
|
|
45
|
+
| RequestAbortedError
|
|
46
|
+
| RequestTimeoutError
|
|
47
|
+
| InvalidRequestError
|
|
48
|
+
| UnexpectedClientError
|
|
49
|
+
| SDKValidationError;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Preview accelerator eligibility
|
|
53
|
+
*
|
|
54
|
+
* @remarks
|
|
55
|
+
* 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.
|
|
56
|
+
*/
|
|
57
|
+
export function useServingEligibilityPreviewMutation(
|
|
58
|
+
options?: MutationHookOptions<
|
|
59
|
+
ServingEligibilityPreviewMutationData,
|
|
60
|
+
ServingEligibilityPreviewMutationError,
|
|
61
|
+
ServingEligibilityPreviewMutationVariables
|
|
62
|
+
>,
|
|
63
|
+
): UseMutationResult<
|
|
64
|
+
ServingEligibilityPreviewMutationData,
|
|
65
|
+
ServingEligibilityPreviewMutationError,
|
|
66
|
+
ServingEligibilityPreviewMutationVariables
|
|
67
|
+
> {
|
|
68
|
+
const client = useSDKContext();
|
|
69
|
+
return useMutation({
|
|
70
|
+
...buildServingEligibilityPreviewMutation(client, options),
|
|
71
|
+
...options,
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export function mutationKeyServingEligibilityPreview(): MutationKey {
|
|
76
|
+
return ["@meetkai/mka1", "eligibility", "preview"];
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export function buildServingEligibilityPreviewMutation(
|
|
80
|
+
client$: SDKCore,
|
|
81
|
+
hookOptions?: RequestOptions,
|
|
82
|
+
): {
|
|
83
|
+
mutationKey: MutationKey;
|
|
84
|
+
mutationFn: (
|
|
85
|
+
variables: ServingEligibilityPreviewMutationVariables,
|
|
86
|
+
) => Promise<ServingEligibilityPreviewMutationData>;
|
|
87
|
+
} {
|
|
88
|
+
return {
|
|
89
|
+
mutationKey: mutationKeyServingEligibilityPreview(),
|
|
90
|
+
mutationFn: function servingEligibilityPreviewMutationFn({
|
|
91
|
+
request,
|
|
92
|
+
options,
|
|
93
|
+
}): Promise<ServingEligibilityPreviewMutationData> {
|
|
94
|
+
const mergedOptions = {
|
|
95
|
+
...hookOptions,
|
|
96
|
+
...options,
|
|
97
|
+
fetchOptions: {
|
|
98
|
+
...hookOptions?.fetchOptions,
|
|
99
|
+
...options?.fetchOptions,
|
|
100
|
+
signal: combineSignals(
|
|
101
|
+
hookOptions?.fetchOptions?.signal,
|
|
102
|
+
options?.fetchOptions?.signal,
|
|
103
|
+
),
|
|
104
|
+
},
|
|
105
|
+
};
|
|
106
|
+
return unwrapAsync(servingEligibilityPreview(
|
|
107
|
+
client$,
|
|
108
|
+
request,
|
|
109
|
+
mergedOptions,
|
|
110
|
+
));
|
|
111
|
+
},
|
|
112
|
+
};
|
|
113
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { servingEligibilityPreview } from "../funcs/servingEligibilityPreview.js";
|
|
6
|
+
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
|
|
7
|
+
import * as components from "../models/components/index.js";
|
|
8
|
+
import * as operations from "../models/operations/index.js";
|
|
9
|
+
import { unwrapAsync } from "../types/fp.js";
|
|
10
|
+
|
|
11
|
+
export class Eligibility extends ClientSDK {
|
|
12
|
+
/**
|
|
13
|
+
* Preview accelerator eligibility
|
|
14
|
+
*
|
|
15
|
+
* @remarks
|
|
16
|
+
* 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.
|
|
17
|
+
*/
|
|
18
|
+
async preview(
|
|
19
|
+
request: operations.PreviewEligibilityRequest,
|
|
20
|
+
options?: RequestOptions,
|
|
21
|
+
): Promise<components.EligibilityPreview> {
|
|
22
|
+
return unwrapAsync(servingEligibilityPreview(
|
|
23
|
+
this,
|
|
24
|
+
request,
|
|
25
|
+
options,
|
|
26
|
+
));
|
|
27
|
+
}
|
|
28
|
+
}
|
package/src/sdk/serving.ts
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import { ClientSDK } from "../lib/sdks.js";
|
|
6
6
|
import { Accelerators } from "./accelerators.js";
|
|
7
7
|
import { Deployments } from "./deployments.js";
|
|
8
|
+
import { Eligibility } from "./eligibility.js";
|
|
8
9
|
import { FinetuneJobs } from "./finetunejobs.js";
|
|
9
10
|
import { Recipes } from "./recipes.js";
|
|
10
11
|
import { SDKImages } from "./sdkimages.js";
|
|
@@ -25,6 +26,11 @@ export class Serving extends ClientSDK {
|
|
|
25
26
|
return (this._deployments ??= new Deployments(this._options));
|
|
26
27
|
}
|
|
27
28
|
|
|
29
|
+
private _eligibility?: Eligibility;
|
|
30
|
+
get eligibility(): Eligibility {
|
|
31
|
+
return (this._eligibility ??= new Eligibility(this._options));
|
|
32
|
+
}
|
|
33
|
+
|
|
28
34
|
private _finetuneJobs?: FinetuneJobs;
|
|
29
35
|
get finetuneJobs(): FinetuneJobs {
|
|
30
36
|
return (this._finetuneJobs ??= new FinetuneJobs(this._options));
|