@daocloud-proto/hydra 0.0.0-dev-87f727ca → 0.0.0-dev-8c334a47

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.
@@ -9,12 +9,22 @@ import * as GoogleProtobufEmpty from "../../../google/protobuf/empty.pb"
9
9
  import * as GoogleProtobufTimestamp from "../../../google/protobuf/timestamp.pb"
10
10
  import * as HydraManagement_apiApikeyV1alpha1Apikey from "../../apikey/v1alpha1/apikey.pb"
11
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
+
12
21
  export enum APIKeyEventType {
13
22
  UNKNOWN = "UNKNOWN",
14
23
  DELETE = "DELETE",
15
24
  OUT_OF_QUOTA = "OUT_OF_QUOTA",
16
25
  RECOVERY = "RECOVERY",
17
26
  UPDATE = "UPDATE",
27
+ CREATE = "CREATE",
18
28
  }
19
29
 
20
30
  export enum UsageReportRequestMode {
@@ -62,6 +72,33 @@ export type UsageReportResponse = {
62
72
  accepted?: boolean
63
73
  }
64
74
 
75
+
76
+ /* hydra modified */ export type BaseMetricPoint = {
77
+ currentSteps?: number
78
+ totalSteps?: number
79
+ }
80
+
81
+ export type MetricPoint = BaseMetricPoint
82
+ & OneOf<{ loss: number }>
83
+ & OneOf<{ evalLoss: number }>
84
+ & OneOf<{ predictLoss: number }>
85
+ & OneOf<{ reward: number }>
86
+ & OneOf<{ accuracy: number }>
87
+ & OneOf<{ lr: number }>
88
+ & OneOf<{ epoch: number }>
89
+ & OneOf<{ percentage: number }>
90
+ & OneOf<{ elapsedTime: string }>
91
+ & OneOf<{ remainingTime: string }>
92
+
93
+ export type ReportFineTuneMetricsRequest = {
94
+ jobId?: string
95
+ metric?: MetricPoint
96
+ }
97
+
98
+ export type ReportFineTuneMetricsResponse = {
99
+ accepted?: boolean
100
+ }
101
+
65
102
  export class AgentCommunicationService {
66
103
  static FetchAPIKeyByKey(req: FetchAPIKeyRequest, initReq?: fm.InitReq): Promise<HydraManagement_apiApikeyV1alpha1Apikey.APIKey> {
67
104
  return fm.fetchReq<FetchAPIKeyRequest, HydraManagement_apiApikeyV1alpha1Apikey.APIKey>(`/hydra.management_api.agent.v1alpha1.AgentCommunicationService/FetchAPIKeyByKey`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
@@ -72,4 +109,7 @@ export class AgentCommunicationService {
72
109
  static UsageReport(req: UsageReportRequest, initReq?: fm.InitReq): Promise<UsageReportResponse> {
73
110
  return fm.fetchReq<UsageReportRequest, UsageReportResponse>(`/hydra.management_api.agent.v1alpha1.AgentCommunicationService/UsageReport`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
74
111
  }
112
+ static ReportFineTuneMetrics(req: ReportFineTuneMetricsRequest, initReq?: fm.InitReq): Promise<ReportFineTuneMetricsResponse> {
113
+ return fm.fetchReq<ReportFineTuneMetricsRequest, ReportFineTuneMetricsResponse>(`/apis/hydra.io/v1alpha1/agent/fine-tune-metrics:report`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
114
+ }
75
115
  }
@@ -8,6 +8,22 @@ 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
 
11
+ type Absent<T, K extends keyof T> = { [k in Exclude<keyof T, K>]?: undefined };
12
+ type OneOf<T> =
13
+ | { [k in keyof T]?: undefined }
14
+ | (
15
+ keyof T extends infer K ?
16
+ (K extends string & keyof T ? { [k in K]: T[K] } & Absent<T, K>
17
+ : never)
18
+ : never);
19
+
20
+ export enum APIKeyStatus {
21
+ API_KEY_STATUS_UNSPECIFIED = "API_KEY_STATUS_UNSPECIFIED",
22
+ API_KEY_STATUS_ACTIVE = "API_KEY_STATUS_ACTIVE",
23
+ API_KEY_STATUS_DISABLED = "API_KEY_STATUS_DISABLED",
24
+ API_KEY_STATUS_EXPIRED = "API_KEY_STATUS_EXPIRED",
25
+ }
26
+
11
27
  export enum TimePeriod {
12
28
  TIME_PERIOD_UNSPECIFIED = "TIME_PERIOD_UNSPECIFIED",
13
29
  TIME_PERIOD_HOUR = "TIME_PERIOD_HOUR",
@@ -16,15 +32,25 @@ export enum TimePeriod {
16
32
  TIME_PERIOD_MONTH = "TIME_PERIOD_MONTH",
17
33
  }
18
34
 
19
- export type CreateWSAPIKeyRequest = {
35
+
36
+ /* hydra modified */ export type BaseCreateWSAPIKeyRequest = {
20
37
  name?: string
21
38
  workspace?: number
39
+ quota?: string
40
+ unlimitedQuota?: boolean
22
41
  }
23
42
 
24
- export type CreateAPIKeyRequest = {
43
+ export type CreateWSAPIKeyRequest = BaseCreateWSAPIKeyRequest
44
+ & OneOf<{ expireTime: GoogleProtobufTimestamp.Timestamp }>
45
+
46
+
47
+ /* hydra modified */ export type BaseCreateAPIKeyRequest = {
25
48
  name?: string
26
49
  }
27
50
 
51
+ export type CreateAPIKeyRequest = BaseCreateAPIKeyRequest
52
+ & OneOf<{ expireTime: GoogleProtobufTimestamp.Timestamp }>
53
+
28
54
  export type APIKey = {
29
55
  id?: string
30
56
  key?: string
@@ -35,6 +61,13 @@ export type APIKey = {
35
61
  denyModels?: string[]
36
62
  workspace?: number
37
63
  createBy?: string
64
+ quota?: string
65
+ expireTime?: GoogleProtobufTimestamp.Timestamp
66
+ remainingQuota?: string
67
+ remainingQuotaSyncedAt?: GoogleProtobufTimestamp.Timestamp
68
+ status?: APIKeyStatus
69
+ unlimitedQuota?: boolean
70
+ usedQuota?: string
38
71
  }
39
72
 
40
73
  export type ListWSAPIKeyRequest = {
@@ -0,0 +1,14 @@
1
+ /* eslint-disable */
2
+ // @ts-nocheck
3
+ /*
4
+ * This file is a generated Typescript file for GRPC Gateway, DO NOT MODIFY
5
+ */
6
+
7
+ export enum JobStatus {
8
+ UNKNOWN = "UNKNOWN",
9
+ PENDING = "PENDING",
10
+ RUNNING = "RUNNING",
11
+ COMPLETED = "COMPLETED",
12
+ FAILED = "FAILED",
13
+ DELETING = "DELETING",
14
+ }
@@ -0,0 +1,100 @@
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 GoogleProtobufEmpty from "../../../google/protobuf/empty.pb"
10
+ import * as GoogleProtobufStruct from "../../../google/protobuf/struct.pb"
11
+ import * as GoogleProtobufTimestamp from "../../../google/protobuf/timestamp.pb"
12
+ import * as HydraManagement_apiFinetuneV1alpha1Common from "./common.pb"
13
+ import * as HydraManagement_apiFinetuneV1alpha1Finetuneconfig from "./finetuneconfig.pb"
14
+
15
+ type Absent<T, K extends keyof T> = { [k in Exclude<keyof T, K>]?: undefined };
16
+ type OneOf<T> =
17
+ | { [k in keyof T]?: undefined }
18
+ | (
19
+ keyof T extends infer K ?
20
+ (K extends string & keyof T ? { [k in K]: T[K] } & Absent<T, K>
21
+ : never)
22
+ : never);
23
+
24
+ /* hydra modified */ export type BaseMetricPoint = {
25
+ currentSteps?: number
26
+ totalSteps?: number
27
+ }
28
+
29
+ export type MetricPoint = BaseMetricPoint
30
+ & OneOf<{ loss: number }>
31
+ & OneOf<{ evalLoss: number }>
32
+ & OneOf<{ predictLoss: number }>
33
+ & OneOf<{ reward: number }>
34
+ & OneOf<{ accuracy: number }>
35
+ & OneOf<{ lr: number }>
36
+ & OneOf<{ epoch: number }>
37
+ & OneOf<{ percentage: number }>
38
+ & OneOf<{ elapsedTime: string }>
39
+ & OneOf<{ remainingTime: string }>
40
+
41
+ export type FineTuneJob = {
42
+ id?: string
43
+ name?: string
44
+ configName?: string
45
+ status?: HydraManagement_apiFinetuneV1alpha1Common.JobStatus
46
+ cluster?: string
47
+ namespace?: string
48
+ storageSpec?: GoogleProtobufStruct.Struct
49
+ runtimeType?: string
50
+ resourceConfig?: HydraManagement_apiFinetuneV1alpha1Finetuneconfig.ResourceConfig
51
+ creationTimestamp?: GoogleProtobufTimestamp.Timestamp
52
+ completionTimestamp?: GoogleProtobufTimestamp.Timestamp
53
+ metrics?: MetricPoint[]
54
+ }
55
+
56
+ export type CreateWSFineTuneJobRequest = {
57
+ workspace?: number
58
+ namespace?: string
59
+ name?: string
60
+ configName?: string
61
+ runtimeType?: string
62
+ resourceConfig?: HydraManagement_apiFinetuneV1alpha1Finetuneconfig.ResourceConfig
63
+ }
64
+
65
+ export type GetWSFineTuneJobRequest = {
66
+ workspace?: number
67
+ id?: string
68
+ }
69
+
70
+ export type ListWSFineTuneJobsRequest = {
71
+ workspace?: number
72
+ cluster?: string
73
+ namespace?: string
74
+ page?: HydraCommonCommon.Pagination
75
+ }
76
+
77
+ export type ListWSFineTuneJobsResponse = {
78
+ items?: FineTuneJob[]
79
+ page?: HydraCommonCommon.Pagination
80
+ }
81
+
82
+ export type DeleteWSFineTuneJobRequest = {
83
+ workspace?: number
84
+ id?: string
85
+ }
86
+
87
+ export class WSFineTuneJobManagement {
88
+ static CreateWSFineTuneJob(req: CreateWSFineTuneJobRequest, initReq?: fm.InitReq): Promise<FineTuneJob> {
89
+ return fm.fetchReq<CreateWSFineTuneJobRequest, FineTuneJob>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/finetune/jobs`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
90
+ }
91
+ static GetWSFineTuneJob(req: GetWSFineTuneJobRequest, initReq?: fm.InitReq): Promise<FineTuneJob> {
92
+ return fm.fetchReq<GetWSFineTuneJobRequest, FineTuneJob>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/finetune/jobs/${req["id"]}?${fm.renderURLSearchParams(req, ["workspace", "id"])}`, {...initReq, method: "GET"})
93
+ }
94
+ static ListWSFineTuneJobs(req: ListWSFineTuneJobsRequest, initReq?: fm.InitReq): Promise<ListWSFineTuneJobsResponse> {
95
+ return fm.fetchReq<ListWSFineTuneJobsRequest, ListWSFineTuneJobsResponse>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/finetune/jobs?${fm.renderURLSearchParams(req, ["workspace"])}`, {...initReq, method: "GET"})
96
+ }
97
+ static DeleteWSFineTuneJob(req: DeleteWSFineTuneJobRequest, initReq?: fm.InitReq): Promise<GoogleProtobufEmpty.Empty> {
98
+ return fm.fetchReq<DeleteWSFineTuneJobRequest, GoogleProtobufEmpty.Empty>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/finetune/jobs/${req["id"]}`, {...initReq, method: "DELETE"})
99
+ }
100
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@daocloud-proto/hydra",
3
- "version": "v0.0.0-dev-87f727ca",
3
+ "version": "v0.0.0-dev-8c334a47",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "license": "ISC"