@daocloud-proto/hydra 0.5.0 → 0.9.0

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.
@@ -0,0 +1,23 @@
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
+ import * as HydraManagement_apiWorkspaceV1alpha1Workspace from "../../../management-api/workspace/v1alpha1/workspace.pb"
10
+ export type ListClusterRequest = {
11
+ page?: HydraCommonCommon.Pagination
12
+ }
13
+
14
+ export type ListClusterResponse = {
15
+ items?: HydraManagement_apiWorkspaceV1alpha1Workspace.Cluster[]
16
+ page?: HydraCommonCommon.Pagination
17
+ }
18
+
19
+ export class CoreService {
20
+ static AdminListCluster(req: ListClusterRequest, initReq?: fm.InitReq): Promise<ListClusterResponse> {
21
+ return fm.fetchReq<ListClusterRequest, ListClusterResponse>(`/apis/admin.hydra.io/v1alpha1/clusters?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
22
+ }
23
+ }
@@ -0,0 +1,131 @@
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
+ import * as GoogleProtobufTimestamp from "../../../google/protobuf/timestamp.pb"
10
+ import * as HydraAdmin_apiModelV1alpha1Model from "../../model/v1alpha1/model.pb"
11
+
12
+ export enum LoadBalanceStrategy {
13
+ LOAD_BALANCE_STRATEGY_UNSPECIFIED = "LOAD_BALANCE_STRATEGY_UNSPECIFIED",
14
+ LOAD_BALANCE_STRATEGY_ROUND_ROBIN = "LOAD_BALANCE_STRATEGY_ROUND_ROBIN",
15
+ LOAD_BALANCE_STRATEGY_RANDOM = "LOAD_BALANCE_STRATEGY_RANDOM",
16
+ LOAD_BALANCE_STRATEGY_WEIGHTED = "LOAD_BALANCE_STRATEGY_WEIGHTED",
17
+ }
18
+
19
+ export enum RateLimitBaseOn {
20
+ RATE_LIMIT_BASE_ON_UNSPECIFIED = "RATE_LIMIT_BASE_ON_UNSPECIFIED",
21
+ RATE_LIMIT_BASE_ON_API_KEY = "RATE_LIMIT_BASE_ON_API_KEY",
22
+ RATE_LIMIT_BASE_ON_WS = "RATE_LIMIT_BASE_ON_WS",
23
+ }
24
+
25
+ export enum MAASModelGatewayStatus {
26
+ GATEWAY_STATUS_UNSPECIFIED = "GATEWAY_STATUS_UNSPECIFIED",
27
+ GATEWAY_STATUS_HEALTHY = "GATEWAY_STATUS_HEALTHY",
28
+ GATEWAY_STATUS_FAILED = "GATEWAY_STATUS_FAILED",
29
+ }
30
+
31
+ export enum UpstreamModelStatus {
32
+ STATUS_UNSPECIFIED = "STATUS_UNSPECIFIED",
33
+ STATUS_HEALTHY = "STATUS_HEALTHY",
34
+ STATUS_FAILED = "STATUS_FAILED",
35
+ }
36
+
37
+ export type CreateMAASModelRequest = {
38
+ modelId?: string
39
+ upstreamModels?: UpstreamModel[]
40
+ cluster?: string
41
+ ratelimitConfig?: RatelimitConfig
42
+ loadBalanceConfig?: LoadBalanceConfig
43
+ }
44
+
45
+ export type MAASModel = {
46
+ model?: HydraAdmin_apiModelV1alpha1Model.Model
47
+ upstreamModels?: UpstreamModel[]
48
+ cluster?: string
49
+ ratelimitConfig?: RatelimitConfig
50
+ loadBalanceConfig?: LoadBalanceConfig
51
+ creationTimestamp?: GoogleProtobufTimestamp.Timestamp
52
+ gatewayStatus?: MAASModelGatewayStatus
53
+ enabled?: boolean
54
+ }
55
+
56
+ export type LoadBalanceConfig = {
57
+ strategy?: LoadBalanceStrategy
58
+ weightedConfig?: WeightedLoadBalanceConfig
59
+ }
60
+
61
+ export type WeightedLoadBalanceConfig = {
62
+ endpoints?: WeightedEndpoint[]
63
+ }
64
+
65
+ export type WeightedEndpoint = {
66
+ modelId?: string
67
+ weight?: number
68
+ }
69
+
70
+ export type RatelimitConfig = {
71
+ enabled?: boolean
72
+ rules?: RateLimitRule[]
73
+ }
74
+
75
+ export type RateLimitRule = {
76
+ baseOn?: RateLimitBaseOn
77
+ limit?: number
78
+ duration?: number
79
+ workspace?: number
80
+ apiKey?: string
81
+ }
82
+
83
+ export type UpstreamModel = {
84
+ modelId?: string
85
+ apiKey?: string
86
+ endpoint?: string
87
+ status?: UpstreamModelStatus
88
+ }
89
+
90
+ export type ListMAASModelRequest = {
91
+ page?: HydraCommonCommon.Pagination
92
+ }
93
+
94
+ export type ListMAASModelResponse = {
95
+ items?: MAASModel[]
96
+ page?: HydraCommonCommon.Pagination
97
+ }
98
+
99
+ export type UpdateMAASModelRequest = {
100
+ modelId?: string
101
+ ratelimitConfig?: RatelimitConfig
102
+ loadBalanceConfig?: LoadBalanceConfig
103
+ upstreamModels?: UpstreamModel[]
104
+ }
105
+
106
+ export type UpdateMAASModelStatusRequest = {
107
+ modelId?: string
108
+ enable?: boolean
109
+ }
110
+
111
+ export type GetMAASModelRequest = {
112
+ modelId?: string
113
+ }
114
+
115
+ export class MAASService {
116
+ static GetMAASModel(req: GetMAASModelRequest, initReq?: fm.InitReq): Promise<MAASModel> {
117
+ return fm.fetchReq<GetMAASModelRequest, MAASModel>(`/apis/admin.hydra.io/v1alpha1/maas-models/${req["modelId"]}?${fm.renderURLSearchParams(req, ["modelId"])}`, {...initReq, method: "GET"})
118
+ }
119
+ static CreateMAASModel(req: CreateMAASModelRequest, initReq?: fm.InitReq): Promise<MAASModel> {
120
+ return fm.fetchReq<CreateMAASModelRequest, MAASModel>(`/apis/admin.hydra.io/v1alpha1/maas-models`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
121
+ }
122
+ static ListMAASModels(req: ListMAASModelRequest, initReq?: fm.InitReq): Promise<ListMAASModelResponse> {
123
+ return fm.fetchReq<ListMAASModelRequest, ListMAASModelResponse>(`/apis/admin.hydra.io/v1alpha1/maas-models?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
124
+ }
125
+ static UpdateMAASModel(req: UpdateMAASModelRequest, initReq?: fm.InitReq): Promise<MAASModel> {
126
+ return fm.fetchReq<UpdateMAASModelRequest, MAASModel>(`/apis/admin.hydra.io/v1alpha1/maas-models/${req["modelId"]}`, {...initReq, method: "PUT", body: JSON.stringify(req, fm.replacer)})
127
+ }
128
+ static UpdateMAASModelStatus(req: UpdateMAASModelStatusRequest, initReq?: fm.InitReq): Promise<MAASModel> {
129
+ return fm.fetchReq<UpdateMAASModelStatusRequest, MAASModel>(`/apis/admin.hydra.io/v1alpha1/maas-models/${req["modelId"]}/status`, {...initReq, method: "PUT", body: JSON.stringify(req, fm.replacer)})
130
+ }
131
+ }
@@ -0,0 +1,163 @@
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
+ import * as GoogleProtobufTimestamp from "../../../google/protobuf/timestamp.pb"
10
+ import * as HydraManagement_apiModelV1alpha1Model from "../../../management-api/model/v1alpha1/model.pb"
11
+
12
+ type Absent<T, K extends keyof T> = { [k in Exclude<keyof T, K>]?: undefined };
13
+ type OneOf<T> =
14
+ | { [k in keyof T]?: undefined }
15
+ | (
16
+ keyof T extends infer K ?
17
+ (K extends string & keyof T ? { [k in K]: T[K] } & Absent<T, K>
18
+ : never)
19
+ : never);
20
+
21
+ export enum ListModelRequestModelListSelector {
22
+ ALL = "ALL",
23
+ HAS_DEPLOY_TEMPLATE = "HAS_DEPLOY_TEMPLATE",
24
+ NO_DEPLOY_TEMPLATE = "NO_DEPLOY_TEMPLATE",
25
+ }
26
+
27
+ export type CreateModelRequest = {
28
+ modelId?: string
29
+ modelAvatar?: string
30
+ modelName?: string
31
+ providerId?: string
32
+ modelDescription?: HydraCommonCommon.I18nName
33
+ modelSupportFeature?: HydraManagement_apiModelV1alpha1Model.ModelSupportFeature[]
34
+ publicEndpointEnabled?: boolean
35
+ publicEndpointBaseUrl?: string
36
+ publicAccessModelName?: string
37
+ readme?: HydraCommonCommon.I18nName
38
+ publicModelConfig?: HydraManagement_apiModelV1alpha1Model.PublicModelConfig
39
+ servingSpec?: HydraManagement_apiModelV1alpha1Model.ModelServingSpec
40
+ hidden?: boolean
41
+ providerName?: HydraCommonCommon.I18nName
42
+ }
43
+
44
+ export type Model = {
45
+ modelId?: string
46
+ modelAvatar?: string
47
+ modelName?: string
48
+ providerId?: string
49
+ providerName?: HydraCommonCommon.I18nName
50
+ modelDescription?: HydraCommonCommon.I18nName
51
+ modelSupportFeature?: HydraManagement_apiModelV1alpha1Model.ModelSupportFeature[]
52
+ creationTimestamp?: GoogleProtobufTimestamp.Timestamp
53
+ updateTimestamp?: GoogleProtobufTimestamp.Timestamp
54
+ publicEndpointEnabled?: boolean
55
+ publicEndpointBaseUrl?: string
56
+ publicAccessModelName?: string
57
+ readme?: HydraCommonCommon.I18nName
58
+ publicModelConfig?: HydraManagement_apiModelV1alpha1Model.PublicModelConfig
59
+ servingSpec?: HydraManagement_apiModelV1alpha1Model.ModelServingSpec
60
+ hidden?: boolean
61
+ }
62
+
63
+ export type UpdateModelRequest = {
64
+ modelId?: string
65
+ modelAvatar?: string
66
+ modelName?: string
67
+ providerId?: string
68
+ modelDescription?: HydraCommonCommon.I18nName
69
+ modelSupportFeature?: HydraManagement_apiModelV1alpha1Model.ModelSupportFeature[]
70
+ publicEndpointEnabled?: boolean
71
+ publicEndpointBaseUrl?: string
72
+ publicAccessModelName?: string
73
+ readme?: HydraCommonCommon.I18nName
74
+ publicModelConfig?: HydraManagement_apiModelV1alpha1Model.PublicModelConfig
75
+ servingSpec?: HydraManagement_apiModelV1alpha1Model.ModelServingSpec
76
+ hidden?: boolean
77
+ }
78
+
79
+ export type ListModelRequest = {
80
+ page?: HydraCommonCommon.Pagination
81
+ showDeployTemplate?: boolean
82
+ selector?: ListModelRequestModelListSelector
83
+ }
84
+
85
+ export type ListModelResponse = {
86
+ items?: Model[]
87
+ page?: HydraCommonCommon.Pagination
88
+ }
89
+
90
+ export type SingleModelRequest = {
91
+ modelId?: string
92
+ }
93
+
94
+
95
+ type BaseParseModelSpecsRequest = {
96
+ }
97
+
98
+ export type ParseModelSpecsRequest = BaseParseModelSpecsRequest
99
+ & OneOf<{ yAML: string; uRL: string }>
100
+
101
+ export type ParsedModel = {
102
+ model?: Model
103
+ exist?: boolean
104
+ error?: string
105
+ }
106
+
107
+ export type ParseModelSpecsResponse = {
108
+ items?: ParsedModel[]
109
+ }
110
+
111
+ export type BatchCreateModelsRequest = {
112
+ models?: CreateModelRequest[]
113
+ }
114
+
115
+ export type BatchCreateModelsResponse = {
116
+ items?: Model[]
117
+ }
118
+
119
+ export type AddDeployTemplatesRequest = {
120
+ modelId?: string
121
+ deployTemplates?: HydraManagement_apiModelV1alpha1Model.DeployTemplate[]
122
+ }
123
+
124
+ export type UpdateDeployTemplatesRequest = {
125
+ modelId?: string
126
+ deployTemplates?: HydraManagement_apiModelV1alpha1Model.DeployTemplate[]
127
+ }
128
+
129
+ export class AdminModelManagement {
130
+ static CreateModel(req: CreateModelRequest, initReq?: fm.InitReq): Promise<Model> {
131
+ return fm.fetchReq<CreateModelRequest, Model>(`/apis/admin.hydra.io/v1alpha1/models`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
132
+ }
133
+ static GetModel(req: SingleModelRequest, initReq?: fm.InitReq): Promise<Model> {
134
+ return fm.fetchReq<SingleModelRequest, Model>(`/apis/admin.hydra.io/v1alpha1/models/${req["modelId"]}?${fm.renderURLSearchParams(req, ["modelId"])}`, {...initReq, method: "GET"})
135
+ }
136
+ static ListModels(req: ListModelRequest, initReq?: fm.InitReq): Promise<ListModelResponse> {
137
+ return fm.fetchReq<ListModelRequest, ListModelResponse>(`/apis/admin.hydra.io/v1alpha1/models?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
138
+ }
139
+ static UpdateModel(req: UpdateModelRequest, initReq?: fm.InitReq): Promise<Model> {
140
+ return fm.fetchReq<UpdateModelRequest, Model>(`/apis/admin.hydra.io/v1alpha1/models/${req["modelId"]}`, {...initReq, method: "PUT", body: JSON.stringify(req, fm.replacer)})
141
+ }
142
+ static DeleteModel(req: SingleModelRequest, initReq?: fm.InitReq): Promise<Model> {
143
+ return fm.fetchReq<SingleModelRequest, Model>(`/apis/admin.hydra.io/v1alpha1/models/${req["modelId"]}`, {...initReq, method: "DELETE"})
144
+ }
145
+ static ParseModelSpecs(req: ParseModelSpecsRequest, initReq?: fm.InitReq): Promise<ParseModelSpecsResponse> {
146
+ return fm.fetchReq<ParseModelSpecsRequest, ParseModelSpecsResponse>(`/apis/admin.hydra.io/v1alpha1/models:parse`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
147
+ }
148
+ static BatchCreateModels(req: BatchCreateModelsRequest, initReq?: fm.InitReq): Promise<BatchCreateModelsResponse> {
149
+ return fm.fetchReq<BatchCreateModelsRequest, BatchCreateModelsResponse>(`/apis/admin.hydra.io/v1alpha1/models:batch_create`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
150
+ }
151
+ static PublishModel(req: SingleModelRequest, initReq?: fm.InitReq): Promise<Model> {
152
+ return fm.fetchReq<SingleModelRequest, Model>(`/apis/admin.hydra.io/v1alpha1/models/${req["modelId"]}:publish`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
153
+ }
154
+ static UnpublishModel(req: SingleModelRequest, initReq?: fm.InitReq): Promise<Model> {
155
+ return fm.fetchReq<SingleModelRequest, Model>(`/apis/admin.hydra.io/v1alpha1/models/${req["modelId"]}:unpublish`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
156
+ }
157
+ static AddDeployTemplates(req: AddDeployTemplatesRequest, initReq?: fm.InitReq): Promise<Model> {
158
+ return fm.fetchReq<AddDeployTemplatesRequest, Model>(`/apis/admin.hydra.io/v1alpha1/models/${req["modelId"]}/deploy_templates`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
159
+ }
160
+ static UpdateDeployTemplates(req: UpdateDeployTemplatesRequest, initReq?: fm.InitReq): Promise<Model> {
161
+ return fm.fetchReq<UpdateDeployTemplatesRequest, Model>(`/apis/admin.hydra.io/v1alpha1/models/${req["modelId"]}/deploy_templates`, {...initReq, method: "PUT", body: JSON.stringify(req, fm.replacer)})
162
+ }
163
+ }
@@ -0,0 +1,59 @@
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 CreateProviderRequest = {
10
+ providerId?: string
11
+ providerName?: HydraCommonCommon.I18nName
12
+ providerDescription?: HydraCommonCommon.I18nName
13
+ providerAvatar?: string
14
+ }
15
+
16
+ export type Provider = {
17
+ providerId?: string
18
+ providerName?: HydraCommonCommon.I18nName
19
+ providerDescription?: HydraCommonCommon.I18nName
20
+ providerAvatar?: string
21
+ }
22
+
23
+ export type UpdateProviderRequest = {
24
+ providerId?: string
25
+ providerName?: HydraCommonCommon.I18nName
26
+ providerDescription?: HydraCommonCommon.I18nName
27
+ providerAvatar?: string
28
+ }
29
+
30
+ export type ListProviderRequest = {
31
+ page?: HydraCommonCommon.Pagination
32
+ }
33
+
34
+ export type ListProviderResponse = {
35
+ items?: Provider[]
36
+ page?: HydraCommonCommon.Pagination
37
+ }
38
+
39
+ export type SingleProviderRequest = {
40
+ providerId?: string
41
+ }
42
+
43
+ export class AdminProviderManagement {
44
+ static CreateProvider(req: CreateProviderRequest, initReq?: fm.InitReq): Promise<Provider> {
45
+ return fm.fetchReq<CreateProviderRequest, Provider>(`/apis/admin.hydra.io/v1alpha1/providers`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
46
+ }
47
+ static GetProvider(req: SingleProviderRequest, initReq?: fm.InitReq): Promise<Provider> {
48
+ return fm.fetchReq<SingleProviderRequest, Provider>(`/apis/admin.hydra.io/v1alpha1/providers/${req["providerId"]}?${fm.renderURLSearchParams(req, ["providerId"])}`, {...initReq, method: "GET"})
49
+ }
50
+ static ListProviders(req: ListProviderRequest, initReq?: fm.InitReq): Promise<ListProviderResponse> {
51
+ return fm.fetchReq<ListProviderRequest, ListProviderResponse>(`/apis/admin.hydra.io/v1alpha1/providers?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
52
+ }
53
+ static UpdateProvider(req: UpdateProviderRequest, initReq?: fm.InitReq): Promise<Provider> {
54
+ return fm.fetchReq<UpdateProviderRequest, Provider>(`/apis/admin.hydra.io/v1alpha1/providers/${req["providerId"]}`, {...initReq, method: "PUT", body: JSON.stringify(req, fm.replacer)})
55
+ }
56
+ static DeleteProvider(req: SingleProviderRequest, initReq?: fm.InitReq): Promise<Provider> {
57
+ return fm.fetchReq<SingleProviderRequest, Provider>(`/apis/admin.hydra.io/v1alpha1/providers/${req["providerId"]}`, {...initReq, method: "DELETE"})
58
+ }
59
+ }
@@ -4,10 +4,29 @@
4
4
  * This file is a generated Typescript file for GRPC Gateway, DO NOT MODIFY
5
5
  */
6
6
 
7
+ export enum DBType {
8
+ DB_TYPE_UNSPECIFIED = "DB_TYPE_UNSPECIFIED",
9
+ MYSQL = "MYSQL",
10
+ POSTGRESQL = "POSTGRESQL",
11
+ SQLITE = "SQLITE",
12
+ }
13
+
7
14
  export enum Mode {
8
15
  MODE_UNSPECIFIED = "MODE_UNSPECIFIED",
9
16
  CSP = "CSP",
10
17
  WS = "WS",
18
+ Any = "Any",
19
+ }
20
+
21
+ export enum SearchIndexFieldBuilderType {
22
+ FIELD_TYPE_UNSPECIFIED = "FIELD_TYPE_UNSPECIFIED",
23
+ FILED = "FILED",
24
+ JSON_FILED_PATH = "JSON_FILED_PATH",
25
+ CONST = "CONST",
26
+ I18N_FIELD = "I18N_FIELD",
27
+ SUBQUERY = "SUBQUERY",
28
+ FUNC_REPLACE = "FUNC_REPLACE",
29
+ FUNC_CONCAT = "FUNC_CONCAT",
11
30
  }
12
31
 
13
32
  export type NoParamsQuery = {
@@ -26,12 +45,21 @@ export type I18nName = {
26
45
  enUs?: string
27
46
  }
28
47
 
48
+ export type SearchIndexFieldBuilderFuncCall = {
49
+ fields?: SearchIndexFieldBuilder[]
50
+ }
51
+
52
+ export type SearchIndexFieldBuilder = {
53
+ type?: SearchIndexFieldBuilderType
54
+ fieldName?: string
55
+ jsonFieldPath?: string[]
56
+ constValue?: string
57
+ funcCall?: SearchIndexFieldBuilderFuncCall
58
+ }
59
+
29
60
  export type SearchIndex = {
30
61
  searchKey?: string
31
- objectPath?: string
32
- customPath?: string
33
- dbPath?: string
34
- dbI18N?: boolean
62
+ fieldBuilder?: SearchIndexFieldBuilder
35
63
  }
36
64
 
37
65
  export type AuthResourceAction = {
@@ -9,6 +9,9 @@ export enum ErrorCode {
9
9
  // EN: resource not found: %v
10
10
  // ZH: 资源未找到:%v
11
11
  SYSTEM_NOT_FOUND_ERROR = "SYSTEM-NOT_FOUND_ERROR",
12
+ // EN: user is no real-name authentication
13
+ // ZH: 用户未实名认证
14
+ SYSTEM_NOT_VERIFIED_ERROR = "SYSTEM-NOT_VERIFIED_ERROR",
12
15
  // EN: order system error: %v
13
16
  // ZH: 订单系统错误:%v
14
17
  SYSTEM_ORDER_SYSTEM_ERROR = "SYSTEM-ORDER_SYSTEM_ERROR",
@@ -27,6 +30,9 @@ export enum ErrorCode {
27
30
  // EN: Requested resource conflicted error: %v
28
31
  // ZH: 请求的资源冲突错误:%v
29
32
  USER_CONFLICT_ERROR = "USER-CONFLICT_ERROR",
33
+ // EN: Failed precondition error: %v
34
+ // ZH: 前置条件错误:%v
35
+ USER_FAILED_PRECONDITION_ERROR = "USER-FAILED_PRECONDITION_ERROR",
30
36
  // EN: out of page: %v
31
37
  // ZH: 分页错误:%v
32
38
  USER_OUT_OF_PAGE = "USER-OUT_OF_PAGE",
@@ -105,7 +105,7 @@ export class APIKeyManagement {
105
105
  return fm.fetchReq<DeleteAPIKeyRequest, APIKey>(`/apis/hydra.io/v1alpha1/apikeys/${req["id"]}`, {...initReq, method: "DELETE", body: JSON.stringify(req, fm.replacer)})
106
106
  }
107
107
  static GetAPIKeyUsageStatistics(req: APIKeyUsageStatisticsRequest, initReq?: fm.InitReq): Promise<APIKeyUsageStatisticsResponse> {
108
- return fm.fetchReq<APIKeyUsageStatisticsRequest, APIKeyUsageStatisticsResponse>(`/apis/hydra.io/v1alpha1/apikeys-stats?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
108
+ return fm.fetchReq<APIKeyUsageStatisticsRequest, APIKeyUsageStatisticsResponse>(`/apis/hydra.io/v1alpha1/apikeys-stats`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
109
109
  }
110
110
  }
111
111
  export class WSAPIKeyManagement {
@@ -119,6 +119,6 @@ export class WSAPIKeyManagement {
119
119
  return fm.fetchReq<DeleteWSAPIKeyRequest, APIKey>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/apikeys/${req["id"]}`, {...initReq, method: "DELETE", body: JSON.stringify(req, fm.replacer)})
120
120
  }
121
121
  static GetAPIKeyUsageStatistics(req: WSAPIKeyUsageStatisticsRequest, initReq?: fm.InitReq): Promise<APIKeyUsageStatisticsResponse> {
122
- return fm.fetchReq<WSAPIKeyUsageStatisticsRequest, APIKeyUsageStatisticsResponse>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/apikeys-stats?${fm.renderURLSearchParams(req, ["workspace"])}`, {...initReq, method: "GET"})
122
+ return fm.fetchReq<WSAPIKeyUsageStatisticsRequest, APIKeyUsageStatisticsResponse>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/apikeys-stats`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
123
123
  }
124
124
  }
@@ -0,0 +1,37 @@
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 fm from "../../../fetch.pb"
8
+ export type GetWebSearchAgentConfigRequest = {
9
+ }
10
+
11
+ export type WebSearchAgentConfig = {
12
+ address?: string
13
+ }
14
+
15
+ export type GetWebSearchAgentConfigResponse = {
16
+ config?: WebSearchAgentConfig
17
+ }
18
+
19
+ export type ListInferenceRuntimesRequest = {
20
+ }
21
+
22
+ export type ListInferenceRuntimesResponse = {
23
+ items?: InferenceRuntime[]
24
+ }
25
+
26
+ export type InferenceRuntime = {
27
+ name?: string
28
+ }
29
+
30
+ export class Management {
31
+ static GetWebSearchAgentConfig(req: GetWebSearchAgentConfigRequest, initReq?: fm.InitReq): Promise<GetWebSearchAgentConfigResponse> {
32
+ return fm.fetchReq<GetWebSearchAgentConfigRequest, GetWebSearchAgentConfigResponse>(`/apis/hydra.io/v1alpha1/web-search-agent/config?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
33
+ }
34
+ static ListInferenceRuntimes(req: ListInferenceRuntimesRequest, initReq?: fm.InitReq): Promise<ListInferenceRuntimesResponse> {
35
+ return fm.fetchReq<ListInferenceRuntimesRequest, ListInferenceRuntimesResponse>(`/apis/hydra.io/v1alpha1/inference-runtimes?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
36
+ }
37
+ }
@@ -20,6 +20,7 @@ export enum ModelSupportFeature {
20
20
  RERANK_MODEL = "RERANK_MODEL",
21
21
  AUDIO_TO_AUDIO = "AUDIO_TO_AUDIO",
22
22
  AUDIO_TO_TEXT = "AUDIO_TO_TEXT",
23
+ TOOLS = "TOOLS",
23
24
  }
24
25
 
25
26
  export enum PublicModelConfigRateLimitLimitedBy {
@@ -28,6 +29,21 @@ export enum PublicModelConfigRateLimitLimitedBy {
28
29
  API_KEY = "API_KEY",
29
30
  }
30
31
 
32
+ export enum DeployTemplateGPUType {
33
+ GPU_TYPE_UNSPECIFIED = "GPU_TYPE_UNSPECIFIED",
34
+ NVIDIA_GPU = "NVIDIA_GPU",
35
+ NVIDIA_vGPU = "NVIDIA_vGPU",
36
+ NO_GPU = "NO_GPU",
37
+ METAX_GPU = "METAX_GPU",
38
+ }
39
+
40
+ export enum DeployTemplateInferenceRuntime {
41
+ INFERENCE_RUNTIME_UNSPECIFIED = "INFERENCE_RUNTIME_UNSPECIFIED",
42
+ VLLM = "VLLM",
43
+ SGLANG = "SGLANG",
44
+ IMAGE_GEN = "IMAGE_GEN",
45
+ }
46
+
31
47
  export type ModelPrice = {
32
48
  inputPerKTokens?: string
33
49
  outputPerKTokens?: string
@@ -51,6 +67,7 @@ export type Model = {
51
67
  publicModelPrice?: ModelPrice
52
68
  readme?: HydraCommonCommon.I18nName
53
69
  publicModelConfig?: PublicModelConfig
70
+ modelDeploymentsExists?: boolean
54
71
  }
55
72
 
56
73
  export type ListModelRequest = {
@@ -77,6 +94,32 @@ export type PublicModelConfig = {
77
94
  rateLimit?: PublicModelConfigRateLimit
78
95
  }
79
96
 
97
+ export type ModelServingSpec = {
98
+ deployTemplates?: DeployTemplate[]
99
+ }
100
+
101
+ export type DeployTemplateResourcesRequirements = {
102
+ cpu?: number
103
+ memory?: number
104
+ gpuType?: DeployTemplateGPUType
105
+ gpuCount?: number
106
+ perGpuMemory?: number
107
+ }
108
+
109
+ export type DeployTemplate = {
110
+ resourcesRequirements?: DeployTemplateResourcesRequirements
111
+ runtime?: DeployTemplateInferenceRuntime
112
+ versionRequired?: string
113
+ customDeployArgs?: string[]
114
+ env?: EnvVar[]
115
+ inferenceRuntime?: string
116
+ }
117
+
118
+ export type EnvVar = {
119
+ name?: string
120
+ value?: string
121
+ }
122
+
80
123
  export type ListWSModelRequest = {
81
124
  workspace?: number
82
125
  page?: HydraCommonCommon.Pagination
@@ -108,6 +151,7 @@ export type WSModel = {
108
151
  publicAccessModelName?: string
109
152
  readme?: HydraCommonCommon.I18nName
110
153
  publicModelConfig?: PublicModelConfig
154
+ modelDeploymentsExists?: boolean
111
155
  }
112
156
 
113
157
  export class ModelManagement {
@@ -7,11 +7,6 @@
7
7
  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
- export type CreateProviderRequest = {
11
- providerName?: string
12
- providerAvatar?: string
13
- }
14
-
15
10
  export type Provider = {
16
11
  providerId?: string
17
12
  providerName?: HydraCommonCommon.I18nName
@@ -32,17 +27,42 @@ export type SingleProviderRequest = {
32
27
  id?: string
33
28
  }
34
29
 
30
+ export type ListWSProviderRequest = {
31
+ page?: HydraCommonCommon.Pagination
32
+ workspace?: number
33
+ }
34
+
35
+ export type ListWSProviderResponse = {
36
+ items?: WSProvider[]
37
+ page?: HydraCommonCommon.Pagination
38
+ }
39
+
40
+ export type WSProvider = {
41
+ providerId?: string
42
+ providerName?: HydraCommonCommon.I18nName
43
+ providerAvatar?: string
44
+ creationTimestamp?: GoogleProtobufTimestamp.Timestamp
45
+ workspace?: number
46
+ }
47
+
48
+ export type SingleWSProviderRequest = {
49
+ id?: string
50
+ workspace?: number
51
+ }
52
+
35
53
  export class ProviderManagement {
36
- static CreateProvider(req: CreateProviderRequest, initReq?: fm.InitReq): Promise<Provider> {
37
- return fm.fetchReq<CreateProviderRequest, Provider>(`/apis/hydra.io/v1alpha1/providers`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
38
- }
39
54
  static GetProvider(req: SingleProviderRequest, initReq?: fm.InitReq): Promise<Provider> {
40
55
  return fm.fetchReq<SingleProviderRequest, Provider>(`/apis/hydra.io/v1alpha1/providers/${req["id"]}?${fm.renderURLSearchParams(req, ["id"])}`, {...initReq, method: "GET"})
41
56
  }
42
57
  static ListProvider(req: ListProviderRequest, initReq?: fm.InitReq): Promise<ListProviderResponse> {
43
58
  return fm.fetchReq<ListProviderRequest, ListProviderResponse>(`/apis/hydra.io/v1alpha1/providers?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
44
59
  }
45
- static DeleteProvider(req: SingleProviderRequest, initReq?: fm.InitReq): Promise<Provider> {
46
- return fm.fetchReq<SingleProviderRequest, Provider>(`/apis/hydra.io/v1alpha1/providers/${req["id"]}`, {...initReq, method: "DELETE", body: JSON.stringify(req, fm.replacer)})
60
+ }
61
+ export class WSProviderManagement {
62
+ static GetWSProvider(req: SingleWSProviderRequest, initReq?: fm.InitReq): Promise<WSProvider> {
63
+ return fm.fetchReq<SingleWSProviderRequest, WSProvider>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/providers/${req["id"]}?${fm.renderURLSearchParams(req, ["workspace", "id"])}`, {...initReq, method: "GET"})
64
+ }
65
+ static ListWSProvider(req: ListWSProviderRequest, initReq?: fm.InitReq): Promise<ListWSProviderResponse> {
66
+ return fm.fetchReq<ListWSProviderRequest, ListWSProviderResponse>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/providers?${fm.renderURLSearchParams(req, ["workspace"])}`, {...initReq, method: "GET"})
47
67
  }
48
68
  }
@@ -24,6 +24,12 @@ export enum ModelServingStatus {
24
24
  STOPPED = "STOPPED",
25
25
  }
26
26
 
27
+ export enum DeployDetectConditionType {
28
+ DEPLOY_DETECT_CONDITION_TYPE_UNSPECIFIED = "DEPLOY_DETECT_CONDITION_TYPE_UNSPECIFIED",
29
+ CLUSTER_RESOURCE_AVAILABLE = "CLUSTER_RESOURCE_AVAILABLE",
30
+ MODEL_IMAGE_DOWNLOADED = "MODEL_IMAGE_DOWNLOADED",
31
+ }
32
+
27
33
  export enum ModelServingActionRequestAction {
28
34
  MODEL_SERVING_ACTION_UNSPECIFIED = "MODEL_SERVING_ACTION_UNSPECIFIED",
29
35
  START = "START",
@@ -32,6 +38,7 @@ export enum ModelServingActionRequestAction {
32
38
  export enum WSModelServingActionRequestAction {
33
39
  MODEL_SERVING_ACTION_UNSPECIFIED = "MODEL_SERVING_ACTION_UNSPECIFIED",
34
40
  START = "START",
41
+ STOP = "STOP",
35
42
  }
36
43
 
37
44
  export type CreateModelServingRequest = {
@@ -159,6 +166,24 @@ export type WSModelServingActionRequest = {
159
166
  action?: WSModelServingActionRequestAction
160
167
  }
161
168
 
169
+ export type WSModelServingDeployDetectionRequest = {
170
+ workspace?: number
171
+ modelId?: string
172
+ cluster?: string
173
+ namespace?: string
174
+ }
175
+
176
+ export type ModelServingDeployDetectionResponse = {
177
+ ready?: boolean
178
+ conditions?: DeployDetectCondition[]
179
+ }
180
+
181
+ export type DeployDetectCondition = {
182
+ type?: DeployDetectConditionType
183
+ ready?: boolean
184
+ message?: string
185
+ }
186
+
162
187
  export class ModelServingManagement {
163
188
  static CreateModelServing(req: CreateModelServingRequest, initReq?: fm.InitReq): Promise<ModelServing> {
164
189
  return fm.fetchReq<CreateModelServingRequest, ModelServing>(`/apis/hydra.io/v1alpha1/model-serving`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
@@ -180,6 +205,9 @@ export class ModelServingManagement {
180
205
  }
181
206
  }
182
207
  export class WSModelServingManagement {
208
+ static DetectWSModelServing(req: WSModelServingDeployDetectionRequest, initReq?: fm.InitReq): Promise<ModelServingDeployDetectionResponse> {
209
+ return fm.fetchReq<WSModelServingDeployDetectionRequest, ModelServingDeployDetectionResponse>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/model-serving/detect`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
210
+ }
183
211
  static CreateWSModelServing(req: CreateWSModelServingRequest, initReq?: fm.InitReq): Promise<WSModelServing> {
184
212
  return fm.fetchReq<CreateWSModelServingRequest, WSModelServing>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/model-serving`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
185
213
  }
@@ -0,0 +1,24 @@
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 fm from "../../../fetch.pb"
8
+ export type CurrentUserRequest = {
9
+ }
10
+
11
+ export type UserInfo = {
12
+ id?: string
13
+ username?: string
14
+ balance?: string
15
+ amount?: string
16
+ idVerified?: boolean
17
+ isMain?: boolean
18
+ }
19
+
20
+ export class UserService {
21
+ static CurrentUser(req: CurrentUserRequest, initReq?: fm.InitReq): Promise<UserInfo> {
22
+ return fm.fetchReq<CurrentUserRequest, UserInfo>(`/apis/hydra.io/v1alpha1/current-user?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
23
+ }
24
+ }
@@ -0,0 +1,19 @@
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 fm from "../../../fetch.pb"
8
+ export type GetAgentAddressRequest = {
9
+ }
10
+
11
+ export type GetAgentAddressResponse = {
12
+ address?: string
13
+ }
14
+
15
+ export class WebSearchAgentService {
16
+ static GetAgentAddress(req: GetAgentAddressRequest, initReq?: fm.InitReq): Promise<GetAgentAddressResponse> {
17
+ return fm.fetchReq<GetAgentAddressRequest, GetAgentAddressResponse>(`/apis/hydra.io/v1alpha1/web-search-agent/address?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
18
+ }
19
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@daocloud-proto/hydra",
3
- "version": "v0.5.0",
3
+ "version": "v0.9.0",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "license": "ISC"