@daocloud-proto/hydra 0.1.0 → 0.1.1-dev-1

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.
@@ -27,8 +27,8 @@ export type APIKeyEvent = {
27
27
  }
28
28
 
29
29
  export type UsageReportRequestUsage = {
30
- inputTokens?: number
31
- outputTokens?: number
30
+ inputTokens?: string
31
+ outputTokens?: string
32
32
  requests?: number
33
33
  }
34
34
 
@@ -8,7 +8,6 @@ import * as HydraCommonCommon from "../../../common/common.pb"
8
8
  import * as fm from "../../../fetch.pb"
9
9
  import * as GoogleProtobufTimestamp from "../../../google/protobuf/timestamp.pb"
10
10
  export type CreateAPIKeyRequest = {
11
- allowModels?: string[]
12
11
  name?: string
13
12
  }
14
13
 
@@ -19,6 +18,7 @@ export type APIKey = {
19
18
  allowModels?: string[]
20
19
  creationTimestamp?: GoogleProtobufTimestamp.Timestamp
21
20
  name?: string
21
+ denyModels?: string[]
22
22
  }
23
23
 
24
24
  export type ListAPIKeyRequest = {
@@ -28,7 +28,6 @@ export type Model = {
28
28
  modelName?: string
29
29
  providerId?: string
30
30
  providerName?: HydraCommonCommon.I18nName
31
- gpuSupport?: string[]
32
31
  modelDescription?: HydraCommonCommon.I18nName
33
32
  finetune?: boolean
34
33
  modelSupportFeature?: ModelSupportFeature[]
@@ -16,13 +16,18 @@ export enum PaymentMethod {
16
16
  export enum ModelServingStatus {
17
17
  STATUS_UNSPECIFIED = "STATUS_UNSPECIFIED",
18
18
  DEPLOYING = "DEPLOYING",
19
- DEPLOY_FAILED = "DEPLOY_FAILED",
19
+ FAILED = "FAILED",
20
20
  RUNNING = "RUNNING",
21
- UPDATING = "UPDATING",
21
+ SCALING = "SCALING",
22
22
  DELETING = "DELETING",
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
@@ -43,7 +48,12 @@ export type ModelServing = {
43
48
  paymentMethods?: PaymentMethod
44
49
  status?: ModelServingStatus
45
50
  creationTimestamp?: GoogleProtobufTimestamp.Timestamp
51
+ outBill?: boolean
46
52
  accessModelName?: string
53
+ namespace?: string
54
+ stop?: string[]
55
+ stopTokenIds?: number[]
56
+ address?: string
47
57
  }
48
58
 
49
59
  export type ListModelServingRequest = {
@@ -51,8 +61,8 @@ export type ListModelServingRequest = {
51
61
  }
52
62
 
53
63
  export type ListModelServingResponse = {
54
- page?: HydraCommonCommon.Pagination
55
64
  items?: ModelServing[]
65
+ page?: HydraCommonCommon.Pagination
56
66
  }
57
67
 
58
68
  export type GetModelServingRequest = {
@@ -68,6 +78,11 @@ export type UpdateModelServingReplicasRequest = {
68
78
  replicas?: number
69
79
  }
70
80
 
81
+ export type ModelServingActionRequest = {
82
+ id?: string
83
+ action?: ModelServingActionRequestAction
84
+ }
85
+
71
86
  export class ModelServingManagement {
72
87
  static CreateModelServing(req: CreateModelServingRequest, initReq?: fm.InitReq): Promise<ModelServing> {
73
88
  return fm.fetchReq<CreateModelServingRequest, ModelServing>(`/apis/hydra.io/v1alpha1/model-serving`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
@@ -82,6 +97,9 @@ export class ModelServingManagement {
82
97
  return fm.fetchReq<DeleteModelServingRequest, ModelServing>(`/apis/hydra.io/v1alpha1/model-serving/${req["id"]}`, {...initReq, method: "DELETE", body: JSON.stringify(req, fm.replacer)})
83
98
  }
84
99
  static UpdateModelServingReplicas(req: UpdateModelServingReplicasRequest, initReq?: fm.InitReq): Promise<ModelServing> {
85
- return fm.fetchReq<UpdateModelServingReplicasRequest, ModelServing>(`/apis/hydra.io/v1alpha1/model-serving/${req["id"]}`, {...initReq, method: "PATCH", body: JSON.stringify(req, fm.replacer)})
100
+ return fm.fetchReq<UpdateModelServingReplicasRequest, ModelServing>(`/apis/hydra.io/v1alpha1/model-serving/${req["id"]}/replicas`, {...initReq, method: "PATCH", body: JSON.stringify(req, fm.replacer)})
101
+ }
102
+ static DoModelServingAction(req: ModelServingActionRequest, initReq?: fm.InitReq): Promise<ModelServing> {
103
+ return fm.fetchReq<ModelServingActionRequest, ModelServing>(`/apis/hydra.io/v1alpha1/model-serving/${req["id"]}/actions`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
86
104
  }
87
105
  }
@@ -9,8 +9,7 @@ import * as fm from "../../../fetch.pb"
9
9
 
10
10
  export enum SKUPaymentMethod {
11
11
  PAYMENT_METHOD_UNSPECIFIED = "PAYMENT_METHOD_UNSPECIFIED",
12
- POSTPAID = "POSTPAID",
13
- PREPAID = "PREPAID",
12
+ PAY_AS_YOU_GO = "PAY_AS_YOU_GO",
14
13
  }
15
14
 
16
15
  export enum SKUPriceCurrency {
@@ -21,7 +20,7 @@ export enum SKUPriceCurrency {
21
20
 
22
21
  export enum ListSKURequestResourceType {
23
22
  RESOURCE_TYPE_UNSPECIFIED = "RESOURCE_TYPE_UNSPECIFIED",
24
- MODEL_SERVING = "MODEL_SERVING",
23
+ MODEL = "MODEL",
25
24
  }
26
25
 
27
26
  export type Region = {
@@ -40,7 +39,7 @@ export type ListRegionResponse = {
40
39
  }
41
40
 
42
41
  export type GetRegionRequest = {
43
- name?: string
42
+ region?: string
44
43
  }
45
44
 
46
45
  export type SKU = {
@@ -70,7 +69,7 @@ export class SKUManagement {
70
69
  return fm.fetchReq<ListRegionRequest, ListRegionResponse>(`/apis/hydra.io/v1alpha1/regions?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
71
70
  }
72
71
  static GetRegion(req: GetRegionRequest, initReq?: fm.InitReq): Promise<Region> {
73
- return fm.fetchReq<GetRegionRequest, Region>(`/apis/hydra.io/v1alpha1/regions/${req["name"]}?${fm.renderURLSearchParams(req, ["name"])}`, {...initReq, method: "GET"})
72
+ return fm.fetchReq<GetRegionRequest, Region>(`/apis/hydra.io/v1alpha1/regions/${req["region"]}?${fm.renderURLSearchParams(req, ["region"])}`, {...initReq, method: "GET"})
74
73
  }
75
74
  static ListSKUs(req: ListSKURequest, initReq?: fm.InitReq): Promise<ListSKUResponse> {
76
75
  return fm.fetchReq<ListSKURequest, ListSKUResponse>(`/apis/hydra.io/v1alpha1/skus?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@daocloud-proto/hydra",
3
- "version": "v0.1.0",
3
+ "version": "v0.1.1-dev-1",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "license": "ISC"