@daocloud-proto/hydra 0.2.0-dev-3 → 0.2.0-dev-5

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.
@@ -3,6 +3,13 @@
3
3
  /*
4
4
  * This file is a generated Typescript file for GRPC Gateway, DO NOT MODIFY
5
5
  */
6
+
7
+ export enum Mode {
8
+ MODE_UNSPECIFIED = "MODE_UNSPECIFIED",
9
+ CSP = "CSP",
10
+ WS = "WS",
11
+ }
12
+
6
13
  export type NoParamsQuery = {
7
14
  }
8
15
 
@@ -34,7 +41,7 @@ export type AuthResourceAction = {
34
41
 
35
42
  export type Auth = {
36
43
  skipAuth?: boolean
37
- devloper?: AuthResourceAction
44
+ user?: AuthResourceAction
38
45
  operator?: AuthResourceAction
39
46
  }
40
47
 
@@ -21,6 +21,9 @@ export enum ErrorCode {
21
21
  // EN: request params error: %v
22
22
  // ZH: 请求参数错误:%v
23
23
  SYSTEM_PARAMS_ERROR = "SYSTEM-PARAMS_ERROR",
24
+ // EN: Request mode not match
25
+ // ZH: 请求模式不匹配。
26
+ SYSTEM_REQUEST_MODE_ERROR = "SYSTEM-REQUEST_MODE_ERROR",
24
27
  // EN: Requested resource conflicted error: %v
25
28
  // ZH: 请求的资源冲突错误:%v
26
29
  USER_CONFLICT_ERROR = "USER-CONFLICT_ERROR",
@@ -17,6 +17,11 @@ export enum APIKeyEventType {
17
17
  UPDATE = "UPDATE",
18
18
  }
19
19
 
20
+ export enum UsageReportRequestMode {
21
+ MODE_UNSPECIFIED = "MODE_UNSPECIFIED",
22
+ MODE_PER_REQUEST = "MODE_PER_REQUEST",
23
+ }
24
+
20
25
  export type FetchAPIKeyRequest = {
21
26
  key?: string
22
27
  }
@@ -27,9 +32,19 @@ export type APIKeyEvent = {
27
32
  type?: APIKeyEventType
28
33
  }
29
34
 
35
+ export type UsageReportRequestUsageImage = {
36
+ width?: string
37
+ height?: string
38
+ numbers?: string
39
+ quality?: string
40
+ style?: string
41
+ }
42
+
30
43
  export type UsageReportRequestUsage = {
31
44
  inputTokens?: string
32
45
  outputTokens?: string
46
+ inputImages?: UsageReportRequestUsageImage
47
+ outputImages?: UsageReportRequestUsageImage
33
48
  requests?: number
34
49
  }
35
50
 
@@ -40,6 +55,7 @@ export type UsageReportRequest = {
40
55
  usage?: UsageReportRequestUsage
41
56
  firstRequestTime?: GoogleProtobufTimestamp.Timestamp
42
57
  lastRequestTime?: GoogleProtobufTimestamp.Timestamp
58
+ mode?: UsageReportRequestMode
43
59
  }
44
60
 
45
61
  export type UsageReportResponse = {
@@ -29,6 +29,11 @@ export enum ModelServingActionRequestAction {
29
29
  START = "START",
30
30
  }
31
31
 
32
+ export enum WSModelServingActionRequestAction {
33
+ MODEL_SERVING_ACTION_UNSPECIFIED = "MODEL_SERVING_ACTION_UNSPECIFIED",
34
+ START = "START",
35
+ }
36
+
32
37
  export type CreateModelServingRequest = {
33
38
  name?: string
34
39
  modelId?: string
@@ -38,6 +43,15 @@ export type CreateModelServingRequest = {
38
43
  paymentMethods?: PaymentMethod
39
44
  }
40
45
 
46
+ export type CreateWSModelServingRequest = {
47
+ name?: string
48
+ modelId?: string
49
+ workspace?: number
50
+ cluster?: string
51
+ namespace?: string
52
+ replicas?: number
53
+ }
54
+
41
55
  export type ModelServing = {
42
56
  id?: string
43
57
  name?: string
@@ -60,15 +74,45 @@ export type ModelServing = {
60
74
  modelSupportFeature?: HydraManagement_apiModelV1alpha1Model.ModelSupportFeature[]
61
75
  }
62
76
 
77
+ export type WSModelServing = {
78
+ id?: string
79
+ name?: string
80
+ modelId?: string
81
+ modelName?: string
82
+ cluster?: string
83
+ replicas?: number
84
+ status?: ModelServingStatus
85
+ creationTimestamp?: GoogleProtobufTimestamp.Timestamp
86
+ accessModelName?: string
87
+ namespace?: string
88
+ address?: string
89
+ modelAvatar?: string
90
+ modelSupportFeature?: HydraManagement_apiModelV1alpha1Model.ModelSupportFeature[]
91
+ }
92
+
63
93
  export type ListModelServingRequest = {
64
94
  page?: HydraCommonCommon.Pagination
65
95
  }
66
96
 
97
+ export type ListWSModelServingRequest = {
98
+ workspace?: number
99
+ cluster?: string
100
+ namespace?: string
101
+ page?: HydraCommonCommon.Pagination
102
+ }
103
+
67
104
  export type ListModelServingResponse = {
68
105
  items?: ModelServing[]
69
106
  page?: HydraCommonCommon.Pagination
70
107
  }
71
108
 
109
+ export type GetWSModelServingRequest = {
110
+ workspace?: number
111
+ cluster?: string
112
+ namespace?: string
113
+ id?: string
114
+ }
115
+
72
116
  export type GetModelServingRequest = {
73
117
  id?: string
74
118
  }
@@ -77,16 +121,39 @@ export type DeleteModelServingRequest = {
77
121
  id?: string
78
122
  }
79
123
 
124
+ export type DeleteWSModelServingRequest = {
125
+ workspace?: number
126
+ cluster?: string
127
+ namespace?: string
128
+ id?: string
129
+ }
130
+
80
131
  export type UpdateModelServingReplicasRequest = {
81
132
  id?: string
82
133
  replicas?: number
83
134
  }
84
135
 
136
+ export type UpdateWSModelServingReplicasRequest = {
137
+ workspace?: number
138
+ cluster?: string
139
+ namespace?: string
140
+ id?: string
141
+ replicas?: number
142
+ }
143
+
85
144
  export type ModelServingActionRequest = {
86
145
  id?: string
87
146
  action?: ModelServingActionRequestAction
88
147
  }
89
148
 
149
+ export type WSModelServingActionRequest = {
150
+ workspace?: number
151
+ cluster?: string
152
+ namespace?: string
153
+ id?: string
154
+ action?: WSModelServingActionRequestAction
155
+ }
156
+
90
157
  export class ModelServingManagement {
91
158
  static CreateModelServing(req: CreateModelServingRequest, initReq?: fm.InitReq): Promise<ModelServing> {
92
159
  return fm.fetchReq<CreateModelServingRequest, ModelServing>(`/apis/hydra.io/v1alpha1/model-serving`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
@@ -106,4 +173,24 @@ export class ModelServingManagement {
106
173
  static DoModelServingAction(req: ModelServingActionRequest, initReq?: fm.InitReq): Promise<ModelServing> {
107
174
  return fm.fetchReq<ModelServingActionRequest, ModelServing>(`/apis/hydra.io/v1alpha1/model-serving/${req["id"]}/actions`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
108
175
  }
176
+ }
177
+ export class WSModelServingManagement {
178
+ static CreateWSModelServing(req: CreateWSModelServingRequest, initReq?: fm.InitReq): Promise<WSModelServing> {
179
+ return fm.fetchReq<CreateWSModelServingRequest, WSModelServing>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/model-serving`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
180
+ }
181
+ static ListWSModelServing(req: ListWSModelServingRequest, initReq?: fm.InitReq): Promise<ListModelServingResponse> {
182
+ return fm.fetchReq<ListWSModelServingRequest, ListModelServingResponse>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/model-serving?${fm.renderURLSearchParams(req, ["workspace"])}`, {...initReq, method: "GET"})
183
+ }
184
+ static GetWSModelServing(req: GetWSModelServingRequest, initReq?: fm.InitReq): Promise<WSModelServing> {
185
+ return fm.fetchReq<GetWSModelServingRequest, WSModelServing>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/model-serving/${req["id"]}?${fm.renderURLSearchParams(req, ["workspace", "id"])}`, {...initReq, method: "GET"})
186
+ }
187
+ static DeleteWSModelServing(req: DeleteWSModelServingRequest, initReq?: fm.InitReq): Promise<WSModelServing> {
188
+ return fm.fetchReq<DeleteWSModelServingRequest, WSModelServing>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/model-serving/${req["id"]}`, {...initReq, method: "DELETE", body: JSON.stringify(req, fm.replacer)})
189
+ }
190
+ static UpdateWSModelServingReplicas(req: UpdateWSModelServingReplicasRequest, initReq?: fm.InitReq): Promise<WSModelServing> {
191
+ return fm.fetchReq<UpdateWSModelServingReplicasRequest, WSModelServing>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/model-serving/${req["id"]}/replicas`, {...initReq, method: "PATCH", body: JSON.stringify(req, fm.replacer)})
192
+ }
193
+ static DoModelWSServingAction(req: WSModelServingActionRequest, initReq?: fm.InitReq): Promise<WSModelServing> {
194
+ return fm.fetchReq<WSModelServingActionRequest, WSModelServing>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/model-serving/${req["id"]}/actions`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
195
+ }
109
196
  }
@@ -0,0 +1,28 @@
1
+ /* eslint-disable */
2
+ // @ts-nocheck
3
+ /*
4
+ * This file is a generated Typescript file for GRPC Gateway, DO NOT MODIFY
5
+ */
6
+
7
+ import * as HydraCommonCommon from "../../../common/common.pb"
8
+ import * as fm from "../../../fetch.pb"
9
+ export type ListWorkspaceRequest = {
10
+ page?: HydraCommonCommon.Pagination
11
+ cluster?: string
12
+ }
13
+
14
+ export type Workspace = {
15
+ workspaceId?: number
16
+ alias?: string
17
+ }
18
+
19
+ export type ListWorkspacesResponse = {
20
+ items?: Workspace[]
21
+ page?: HydraCommonCommon.Pagination
22
+ }
23
+
24
+ export class WorkspaceService {
25
+ static ListWorkspaces(req: ListWorkspaceRequest, initReq?: fm.InitReq): Promise<ListWorkspacesResponse> {
26
+ return fm.fetchReq<ListWorkspaceRequest, ListWorkspacesResponse>(`/apis/hydra.io/v1alpha1/workspaces?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
27
+ }
28
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@daocloud-proto/hydra",
3
- "version": "v0.2.0-dev-3",
3
+ "version": "v0.2.0-dev-5",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "license": "ISC"