@daocloud-proto/hydra 0.2.0-dev-8 → 0.2.0-dev-10
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.
|
@@ -22,7 +22,7 @@ export enum ModelSupportFeature {
|
|
|
22
22
|
AUDIO_TO_TEXT = "AUDIO_TO_TEXT",
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
export enum
|
|
25
|
+
export enum PublicModelConfigRateLimitLimitedBy {
|
|
26
26
|
LIMITED_BY_UNSPECIFIED = "LIMITED_BY_UNSPECIFIED",
|
|
27
27
|
USER_ID = "USER_ID",
|
|
28
28
|
API_KEY = "API_KEY",
|
|
@@ -34,16 +34,6 @@ export type ModelPrice = {
|
|
|
34
34
|
perImage?: string
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
export type ModelPublibModelConfigRateLimit = {
|
|
38
|
-
limitedBy?: ModelPublibModelConfigRateLimitLimitedBy
|
|
39
|
-
limit?: string
|
|
40
|
-
duration?: string
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export type ModelPublibModelConfig = {
|
|
44
|
-
rateLimit?: ModelPublibModelConfigRateLimit
|
|
45
|
-
}
|
|
46
|
-
|
|
47
37
|
export type Model = {
|
|
48
38
|
modelId?: string
|
|
49
39
|
modelAvatar?: string
|
|
@@ -60,7 +50,7 @@ export type Model = {
|
|
|
60
50
|
publicAccessModelName?: string
|
|
61
51
|
publicModelPrice?: ModelPrice
|
|
62
52
|
readme?: HydraCommonCommon.I18nName
|
|
63
|
-
publicModelConfig?:
|
|
53
|
+
publicModelConfig?: PublicModelConfig
|
|
64
54
|
}
|
|
65
55
|
|
|
66
56
|
export type ListModelRequest = {
|
|
@@ -77,6 +67,49 @@ export type SingleModelRequest = {
|
|
|
77
67
|
modelId?: string
|
|
78
68
|
}
|
|
79
69
|
|
|
70
|
+
export type PublicModelConfigRateLimit = {
|
|
71
|
+
limitedBy?: PublicModelConfigRateLimitLimitedBy
|
|
72
|
+
limit?: string
|
|
73
|
+
duration?: string
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export type PublicModelConfig = {
|
|
77
|
+
rateLimit?: PublicModelConfigRateLimit
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export type ListWSModelRequest = {
|
|
81
|
+
workspace?: number
|
|
82
|
+
page?: HydraCommonCommon.Pagination
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export type ListWSModelResponse = {
|
|
86
|
+
items?: WSModel[]
|
|
87
|
+
page?: HydraCommonCommon.Pagination
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export type SingleWSModelRequest = {
|
|
91
|
+
workspace?: number
|
|
92
|
+
modelId?: string
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export type WSModel = {
|
|
96
|
+
modelId?: string
|
|
97
|
+
modelAvatar?: string
|
|
98
|
+
modelName?: string
|
|
99
|
+
providerId?: string
|
|
100
|
+
providerName?: HydraCommonCommon.I18nName
|
|
101
|
+
modelDescription?: HydraCommonCommon.I18nName
|
|
102
|
+
finetune?: boolean
|
|
103
|
+
modelSupportFeature?: ModelSupportFeature[]
|
|
104
|
+
creationTimestamp?: GoogleProtobufTimestamp.Timestamp
|
|
105
|
+
updateTimestamp?: GoogleProtobufTimestamp.Timestamp
|
|
106
|
+
publicEndpointEnabled?: boolean
|
|
107
|
+
publicEndpointBaseUrl?: string
|
|
108
|
+
publicAccessModelName?: string
|
|
109
|
+
readme?: HydraCommonCommon.I18nName
|
|
110
|
+
publicModelConfig?: PublicModelConfig
|
|
111
|
+
}
|
|
112
|
+
|
|
80
113
|
export class ModelManagement {
|
|
81
114
|
static GetModel(req: SingleModelRequest, initReq?: fm.InitReq): Promise<Model> {
|
|
82
115
|
return fm.fetchReq<SingleModelRequest, Model>(`/apis/hydra.io/v1alpha1/models/${req["modelId"]}?${fm.renderURLSearchParams(req, ["modelId"])}`, {...initReq, method: "GET"})
|
|
@@ -84,4 +117,12 @@ export class ModelManagement {
|
|
|
84
117
|
static ListModels(req: ListModelRequest, initReq?: fm.InitReq): Promise<ListModelResponse> {
|
|
85
118
|
return fm.fetchReq<ListModelRequest, ListModelResponse>(`/apis/hydra.io/v1alpha1/models?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
86
119
|
}
|
|
120
|
+
}
|
|
121
|
+
export class WSModelManagement {
|
|
122
|
+
static GetWSModel(req: SingleWSModelRequest, initReq?: fm.InitReq): Promise<WSModel> {
|
|
123
|
+
return fm.fetchReq<SingleWSModelRequest, WSModel>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/models/${req["modelId"]}?${fm.renderURLSearchParams(req, ["workspace", "modelId"])}`, {...initReq, method: "GET"})
|
|
124
|
+
}
|
|
125
|
+
static ListWSModels(req: ListWSModelRequest, initReq?: fm.InitReq): Promise<ListWSModelResponse> {
|
|
126
|
+
return fm.fetchReq<ListWSModelRequest, ListWSModelResponse>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/models?${fm.renderURLSearchParams(req, ["workspace"])}`, {...initReq, method: "GET"})
|
|
127
|
+
}
|
|
87
128
|
}
|
|
@@ -94,6 +94,11 @@ export type ListModelServingRequest = {
|
|
|
94
94
|
page?: HydraCommonCommon.Pagination
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
+
export type ListModelServingResponse = {
|
|
98
|
+
items?: ModelServing[]
|
|
99
|
+
page?: HydraCommonCommon.Pagination
|
|
100
|
+
}
|
|
101
|
+
|
|
97
102
|
export type ListWSModelServingRequest = {
|
|
98
103
|
workspace?: number
|
|
99
104
|
cluster?: string
|
|
@@ -101,8 +106,8 @@ export type ListWSModelServingRequest = {
|
|
|
101
106
|
page?: HydraCommonCommon.Pagination
|
|
102
107
|
}
|
|
103
108
|
|
|
104
|
-
export type
|
|
105
|
-
items?:
|
|
109
|
+
export type ListWSModelServingResponse = {
|
|
110
|
+
items?: WSModelServing[]
|
|
106
111
|
page?: HydraCommonCommon.Pagination
|
|
107
112
|
}
|
|
108
113
|
|
|
@@ -178,8 +183,8 @@ export class WSModelServingManagement {
|
|
|
178
183
|
static CreateWSModelServing(req: CreateWSModelServingRequest, initReq?: fm.InitReq): Promise<WSModelServing> {
|
|
179
184
|
return fm.fetchReq<CreateWSModelServingRequest, WSModelServing>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/model-serving`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
180
185
|
}
|
|
181
|
-
static ListWSModelServing(req: ListWSModelServingRequest, initReq?: fm.InitReq): Promise<
|
|
182
|
-
return fm.fetchReq<ListWSModelServingRequest,
|
|
186
|
+
static ListWSModelServing(req: ListWSModelServingRequest, initReq?: fm.InitReq): Promise<ListWSModelServingResponse> {
|
|
187
|
+
return fm.fetchReq<ListWSModelServingRequest, ListWSModelServingResponse>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/model-serving?${fm.renderURLSearchParams(req, ["workspace"])}`, {...initReq, method: "GET"})
|
|
183
188
|
}
|
|
184
189
|
static GetWSModelServing(req: GetWSModelServingRequest, initReq?: fm.InitReq): Promise<WSModelServing> {
|
|
185
190
|
return fm.fetchReq<GetWSModelServingRequest, WSModelServing>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/model-serving/${req["id"]}?${fm.renderURLSearchParams(req, ["workspace", "id"])}`, {...initReq, method: "GET"})
|