@daocloud-proto/hydra 0.18.0-dev-12 → 0.18.0-dev-14
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.
|
@@ -32,6 +32,12 @@ export enum TimePeriod {
|
|
|
32
32
|
TIME_PERIOD_MONTH = "TIME_PERIOD_MONTH",
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
+
export enum ModelUsageExportFormat {
|
|
36
|
+
MODEL_USAGE_EXPORT_FORMAT_UNSPECIFIED = "MODEL_USAGE_EXPORT_FORMAT_UNSPECIFIED",
|
|
37
|
+
MODEL_USAGE_EXPORT_FORMAT_CSV = "MODEL_USAGE_EXPORT_FORMAT_CSV",
|
|
38
|
+
MODEL_USAGE_EXPORT_FORMAT_EXCEL = "MODEL_USAGE_EXPORT_FORMAT_EXCEL",
|
|
39
|
+
}
|
|
40
|
+
|
|
35
41
|
export enum APIKeyUsageQueryStatus {
|
|
36
42
|
API_KEY_USAGE_QUERY_STATUS_UNSPECIFIED = "API_KEY_USAGE_QUERY_STATUS_UNSPECIFIED",
|
|
37
43
|
API_KEY_USAGE_QUERY_STATUS_COMPLETED = "API_KEY_USAGE_QUERY_STATUS_COMPLETED",
|
|
@@ -236,6 +242,63 @@ export type APIKeyUsageStatisticsResponse = {
|
|
|
236
242
|
warnings?: APIKeyUsageWarning[]
|
|
237
243
|
}
|
|
238
244
|
|
|
245
|
+
export type ExportModelUsageRequest = {
|
|
246
|
+
startTime?: GoogleProtobufTimestamp.Timestamp
|
|
247
|
+
endTime?: GoogleProtobufTimestamp.Timestamp
|
|
248
|
+
apiKeyIds?: string[]
|
|
249
|
+
models?: string[]
|
|
250
|
+
responseCodes?: string[]
|
|
251
|
+
format?: ModelUsageExportFormat
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
export type WSExportModelUsageRequest = {
|
|
255
|
+
startTime?: GoogleProtobufTimestamp.Timestamp
|
|
256
|
+
endTime?: GoogleProtobufTimestamp.Timestamp
|
|
257
|
+
apiKeyIds?: string[]
|
|
258
|
+
models?: string[]
|
|
259
|
+
responseCodes?: string[]
|
|
260
|
+
format?: ModelUsageExportFormat
|
|
261
|
+
workspace?: number
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
export type ListModelUsageRequest = {
|
|
265
|
+
startTime?: GoogleProtobufTimestamp.Timestamp
|
|
266
|
+
endTime?: GoogleProtobufTimestamp.Timestamp
|
|
267
|
+
apiKeyIds?: string[]
|
|
268
|
+
models?: string[]
|
|
269
|
+
page?: HydraCommonCommon.Pagination
|
|
270
|
+
responseCodes?: string[]
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
export type WSListModelUsageRequest = {
|
|
274
|
+
startTime?: GoogleProtobufTimestamp.Timestamp
|
|
275
|
+
endTime?: GoogleProtobufTimestamp.Timestamp
|
|
276
|
+
apiKeyIds?: string[]
|
|
277
|
+
models?: string[]
|
|
278
|
+
page?: HydraCommonCommon.Pagination
|
|
279
|
+
responseCodes?: string[]
|
|
280
|
+
workspace?: number
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
export type ModelUsageItem = {
|
|
284
|
+
requestTime?: GoogleProtobufTimestamp.Timestamp
|
|
285
|
+
requestId?: string
|
|
286
|
+
model?: string
|
|
287
|
+
apiKeyName?: string
|
|
288
|
+
statusCode?: string
|
|
289
|
+
totalTokens?: string
|
|
290
|
+
inputTokens?: string
|
|
291
|
+
outputTokens?: string
|
|
292
|
+
userId?: string
|
|
293
|
+
userName?: string
|
|
294
|
+
apiKeyId?: string
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
export type ListModelUsageResponse = {
|
|
298
|
+
items?: ModelUsageItem[]
|
|
299
|
+
page?: HydraCommonCommon.Pagination
|
|
300
|
+
}
|
|
301
|
+
|
|
239
302
|
export type APIKeyUsageWarning = {
|
|
240
303
|
code?: string
|
|
241
304
|
message?: string
|
|
@@ -297,6 +360,12 @@ export class APIKeyManagement {
|
|
|
297
360
|
static GetAPIKeyUsageStatistics(req: APIKeyUsageStatisticsRequest, initReq?: fm.InitReq): Promise<APIKeyUsageStatisticsResponse> {
|
|
298
361
|
return fm.fetchReq<APIKeyUsageStatisticsRequest, APIKeyUsageStatisticsResponse>(`/apis/hydra.io/v1alpha1/apikeys-stats`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
299
362
|
}
|
|
363
|
+
static ListModelUsage(req: ListModelUsageRequest, initReq?: fm.InitReq): Promise<ListModelUsageResponse> {
|
|
364
|
+
return fm.fetchReq<ListModelUsageRequest, ListModelUsageResponse>(`/apis/hydra.io/v1alpha1/model-usage?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
365
|
+
}
|
|
366
|
+
static ExportModelUsage(req: ExportModelUsageRequest, initReq?: fm.InitReq): Promise<Response> {
|
|
367
|
+
return fm.fetchRawReq(`/apis/hydra.io/v1alpha1/model-usage/export?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
368
|
+
}
|
|
300
369
|
static CheckAPIKeyCreation(req: CheckAPIKeyCreationRequest, initReq?: fm.InitReq): Promise<CheckAPIKeyCreationResponse> {
|
|
301
370
|
return fm.fetchReq<CheckAPIKeyCreationRequest, CheckAPIKeyCreationResponse>(`/apis/hydra.io/v1alpha1/apikeys/check-creation`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
302
371
|
}
|
|
@@ -341,4 +410,10 @@ export class WSAPIKeyManagement {
|
|
|
341
410
|
static GetAPIKeyUsageStatistics(req: WSAPIKeyUsageStatisticsRequest, initReq?: fm.InitReq): Promise<APIKeyUsageStatisticsResponse> {
|
|
342
411
|
return fm.fetchReq<WSAPIKeyUsageStatisticsRequest, APIKeyUsageStatisticsResponse>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/apikeys-stats`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
343
412
|
}
|
|
413
|
+
static ListModelUsage(req: WSListModelUsageRequest, initReq?: fm.InitReq): Promise<ListModelUsageResponse> {
|
|
414
|
+
return fm.fetchReq<WSListModelUsageRequest, ListModelUsageResponse>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/model-usage?${fm.renderURLSearchParams(req, ["workspace"])}`, {...initReq, method: "GET"})
|
|
415
|
+
}
|
|
416
|
+
static ExportModelUsage(req: WSExportModelUsageRequest, initReq?: fm.InitReq): Promise<Response> {
|
|
417
|
+
return fm.fetchRawReq(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/model-usage/export?${fm.renderURLSearchParams(req, ["workspace"])}`, {...initReq, method: "GET"})
|
|
418
|
+
}
|
|
344
419
|
}
|
package/package.json
CHANGED
|
@@ -1,66 +0,0 @@
|
|
|
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
|
-
|
|
11
|
-
export enum ModelUsageExportFormat {
|
|
12
|
-
MODEL_USAGE_EXPORT_FORMAT_UNSPECIFIED = "MODEL_USAGE_EXPORT_FORMAT_UNSPECIFIED",
|
|
13
|
-
MODEL_USAGE_EXPORT_FORMAT_CSV = "MODEL_USAGE_EXPORT_FORMAT_CSV",
|
|
14
|
-
MODEL_USAGE_EXPORT_FORMAT_EXCEL = "MODEL_USAGE_EXPORT_FORMAT_EXCEL",
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export type ExportModelUsageRequest = {
|
|
18
|
-
startTime?: GoogleProtobufTimestamp.Timestamp
|
|
19
|
-
endTime?: GoogleProtobufTimestamp.Timestamp
|
|
20
|
-
apiKeyIds?: string[]
|
|
21
|
-
models?: string[]
|
|
22
|
-
userId?: string
|
|
23
|
-
responseCodes?: string[]
|
|
24
|
-
format?: ModelUsageExportFormat
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export type ListModelUsageRequest = {
|
|
28
|
-
startTime?: GoogleProtobufTimestamp.Timestamp
|
|
29
|
-
endTime?: GoogleProtobufTimestamp.Timestamp
|
|
30
|
-
apiKeyIds?: string[]
|
|
31
|
-
models?: string[]
|
|
32
|
-
userId?: string
|
|
33
|
-
page?: HydraCommonCommon.Pagination
|
|
34
|
-
responseCodes?: string[]
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export type ModelUsageItem = {
|
|
38
|
-
requestTime?: GoogleProtobufTimestamp.Timestamp
|
|
39
|
-
requestId?: string
|
|
40
|
-
model?: string
|
|
41
|
-
apiKeyNameOrId?: string
|
|
42
|
-
statusCode?: string
|
|
43
|
-
totalTokens?: string
|
|
44
|
-
inputTokens?: string
|
|
45
|
-
outputTokens?: string
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export type ModelUsageColumn = {
|
|
49
|
-
field?: string
|
|
50
|
-
title?: string
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
export type ListModelUsageResponse = {
|
|
54
|
-
items?: ModelUsageItem[]
|
|
55
|
-
page?: HydraCommonCommon.Pagination
|
|
56
|
-
columns?: ModelUsageColumn[]
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
export class ModelUsageService {
|
|
60
|
-
static ListModelUsage(req: ListModelUsageRequest, initReq?: fm.InitReq): Promise<ListModelUsageResponse> {
|
|
61
|
-
return fm.fetchReq<ListModelUsageRequest, ListModelUsageResponse>(`/apis/hydra.io/v1alpha1/model-usage?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
62
|
-
}
|
|
63
|
-
static ExportModelUsage(req: ExportModelUsageRequest, initReq?: fm.InitReq): Promise<Response> {
|
|
64
|
-
return fm.fetchRawReq(`/apis/hydra.io/v1alpha1/model-usage/export?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
65
|
-
}
|
|
66
|
-
}
|