@daocloud-proto/hydra 0.2.0-dev-8 → 0.2.0-dev-9
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
|
}
|