@daocloud-proto/infery 0.0.0-dev-3186c9a3 → 0.0.0-dev-08e8fa87
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/fetch.pb.ts
CHANGED
|
@@ -338,21 +338,4 @@ export function renderURLSearchParams<T extends RequestPayload>(
|
|
|
338
338
|
);
|
|
339
339
|
|
|
340
340
|
return new URLSearchParams(urlSearchParams).toString();
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
export async function fetchRawReq(path: string, init?: InitReq): Promise<Response> {
|
|
344
|
-
const {pathPrefix, ...req} = init || {}
|
|
345
|
-
const url = pathPrefix ? `${pathPrefix}${path}` : path
|
|
346
|
-
const response = await fetch(url, req)
|
|
347
|
-
if (!response.ok) {
|
|
348
|
-
const text = await response.text()
|
|
349
|
-
let body: unknown = text
|
|
350
|
-
try {
|
|
351
|
-
body = JSON.parse(text)
|
|
352
|
-
} catch {
|
|
353
|
-
// Preserve a non-JSON error body when an intermediary does not use the gateway error schema.
|
|
354
|
-
}
|
|
355
|
-
throw body
|
|
356
|
-
}
|
|
357
|
-
return response
|
|
358
|
-
}
|
|
341
|
+
}
|
|
@@ -89,17 +89,6 @@ export type InferenceTemplate = {
|
|
|
89
89
|
spec?: InferenceTemplateSpec
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
-
|
|
93
|
-
type BaseExportInferenceTemplateRequest = {
|
|
94
|
-
workspace?: number
|
|
95
|
-
modelServingName?: string
|
|
96
|
-
templateName?: string
|
|
97
|
-
maturity?: Maturity
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
export type ExportInferenceTemplateRequest = BaseExportInferenceTemplateRequest
|
|
101
|
-
& OneOf<{ resourceVersion: string }>
|
|
102
|
-
|
|
103
92
|
export type ParseInferenceTemplateRequest = {
|
|
104
93
|
workspace?: number
|
|
105
94
|
manifest?: InferenceTemplateManifest
|
|
@@ -125,6 +114,7 @@ export type ListInferenceTemplatesRequest = {
|
|
|
125
114
|
disaggregationMode?: InferyCommonCommon.DisaggregationMode[]
|
|
126
115
|
maturity?: Maturity[]
|
|
127
116
|
page?: InferyCommonCommon.Pagination
|
|
117
|
+
source?: TemplateSource
|
|
128
118
|
}
|
|
129
119
|
|
|
130
120
|
export type ListInferenceTemplatesResponse = {
|
|
@@ -165,9 +155,6 @@ export type DeleteInferenceTemplateRequest = {
|
|
|
165
155
|
}
|
|
166
156
|
|
|
167
157
|
export class InferenceTemplateManagement {
|
|
168
|
-
static ExportInferenceTemplate(req: ExportInferenceTemplateRequest, initReq?: fm.InitReq): Promise<Response> {
|
|
169
|
-
return fm.fetchRawReq(`/apis/infery.io/v1alpha1/workspaces/${req["workspace"]}/inference-templates:export?${fm.renderURLSearchParams(req, ["workspace"])}`, {...initReq, method: "GET"})
|
|
170
|
-
}
|
|
171
158
|
static ParseInferenceTemplate(req: ParseInferenceTemplateRequest, initReq?: fm.InitReq): Promise<ParseInferenceTemplateResponse> {
|
|
172
159
|
return fm.fetchReq<ParseInferenceTemplateRequest, ParseInferenceTemplateResponse>(`/apis/infery.io/v1alpha1/workspaces/${req["workspace"]}/inference-templates:parse`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
173
160
|
}
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
import * as InferyCommonCommon from "../../../common/common.pb"
|
|
8
8
|
import * as fm from "../../../fetch.pb"
|
|
9
9
|
import * as GoogleProtobufTimestamp from "../../../google/protobuf/timestamp.pb"
|
|
10
|
+
import * as InferyManagement_apiInference_templateV1alpha1Inference_template from "../../inference_template/v1alpha1/inference_template.pb"
|
|
10
11
|
|
|
11
12
|
type Absent<T, K extends keyof T> = { [k in Exclude<keyof T, K>]?: undefined };
|
|
12
13
|
type OneOf<T> =
|
|
@@ -425,6 +426,19 @@ export type CreateModelServingJSONRequest = {
|
|
|
425
426
|
helmValues?: string
|
|
426
427
|
}
|
|
427
428
|
|
|
429
|
+
|
|
430
|
+
type BaseExportInferenceTemplateRequest = {
|
|
431
|
+
workspace?: number
|
|
432
|
+
modelServingName?: string
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
export type ExportInferenceTemplateRequest = BaseExportInferenceTemplateRequest
|
|
436
|
+
& OneOf<{ version: string }>
|
|
437
|
+
|
|
438
|
+
export type ExportInferenceTemplateResponse = {
|
|
439
|
+
manifest?: InferyManagement_apiInference_templateV1alpha1Inference_template.InferenceTemplateManifest
|
|
440
|
+
}
|
|
441
|
+
|
|
428
442
|
export type GetModelServingJSONRequest = {
|
|
429
443
|
workspace?: number
|
|
430
444
|
name?: string
|
|
@@ -532,4 +546,7 @@ export class ModelServingManagement {
|
|
|
532
546
|
static UpdateModelServingJSON(req: UpdateModelServingJSONRequest, initReq?: fm.InitReq): Promise<UpdateModelServingJSONResponse> {
|
|
533
547
|
return fm.fetchReq<UpdateModelServingJSONRequest, UpdateModelServingJSONResponse>(`/apis/infery.io/v1alpha1/workspaces/${req["workspace"]}/model-serving/${req["name"]}/json`, {...initReq, method: "PUT", body: JSON.stringify(req, fm.replacer)})
|
|
534
548
|
}
|
|
549
|
+
static ExportInferenceTemplate(req: ExportInferenceTemplateRequest, initReq?: fm.InitReq): Promise<ExportInferenceTemplateResponse> {
|
|
550
|
+
return fm.fetchReq<ExportInferenceTemplateRequest, ExportInferenceTemplateResponse>(`/apis/infery.io/v1alpha1/workspaces/${req["workspace"]}/model-serving/${req["modelServingName"]}:export?${fm.renderURLSearchParams(req, ["workspace", "modelServingName"])}`, {...initReq, method: "GET"})
|
|
551
|
+
}
|
|
535
552
|
}
|