@daocloud-proto/hydra 0.1.1 → 0.1.2-dev-2

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.
@@ -23,6 +23,11 @@ export enum ModelServingStatus {
23
23
  STOPPED = "STOPPED",
24
24
  }
25
25
 
26
+ export enum ModelServingActionRequestAction {
27
+ MODEL_SERVING_ACTION_UNSPECIFIED = "MODEL_SERVING_ACTION_UNSPECIFIED",
28
+ START = "START",
29
+ }
30
+
26
31
  export type CreateModelServingRequest = {
27
32
  name?: string
28
33
  modelId?: string
@@ -49,6 +54,8 @@ export type ModelServing = {
49
54
  stop?: string[]
50
55
  stopTokenIds?: number[]
51
56
  address?: string
57
+ modelAvatar?: string
58
+ regionName?: HydraCommonCommon.I18nName
52
59
  }
53
60
 
54
61
  export type ListModelServingRequest = {
@@ -73,6 +80,11 @@ export type UpdateModelServingReplicasRequest = {
73
80
  replicas?: number
74
81
  }
75
82
 
83
+ export type ModelServingActionRequest = {
84
+ id?: string
85
+ action?: ModelServingActionRequestAction
86
+ }
87
+
76
88
  export class ModelServingManagement {
77
89
  static CreateModelServing(req: CreateModelServingRequest, initReq?: fm.InitReq): Promise<ModelServing> {
78
90
  return fm.fetchReq<CreateModelServingRequest, ModelServing>(`/apis/hydra.io/v1alpha1/model-serving`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
@@ -89,4 +101,7 @@ export class ModelServingManagement {
89
101
  static UpdateModelServingReplicas(req: UpdateModelServingReplicasRequest, initReq?: fm.InitReq): Promise<ModelServing> {
90
102
  return fm.fetchReq<UpdateModelServingReplicasRequest, ModelServing>(`/apis/hydra.io/v1alpha1/model-serving/${req["id"]}/replicas`, {...initReq, method: "PATCH", body: JSON.stringify(req, fm.replacer)})
91
103
  }
104
+ static DoModelServingAction(req: ModelServingActionRequest, initReq?: fm.InitReq): Promise<ModelServing> {
105
+ return fm.fetchReq<ModelServingActionRequest, ModelServing>(`/apis/hydra.io/v1alpha1/model-serving/${req["id"]}/actions`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
106
+ }
92
107
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@daocloud-proto/hydra",
3
- "version": "v0.1.1",
3
+ "version": "v0.1.2-dev-2",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "license": "ISC"