tencentcloud-sdk-nodejs-tokenhub 4.1.253 → 4.1.258
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.
package/package.json
CHANGED
|
@@ -75,9 +75,17 @@ export declare class Client extends TencentCloudCommon.AbstractClient {
|
|
|
75
75
|
/**
|
|
76
76
|
* 查询用量排行列表。
|
|
77
77
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
78
|
+
指标族(MetricType)
|
|
79
|
+
- `tokens`(默认):Token 用量统计。支持 Dimension = apikey / endpoint / model。
|
|
80
|
+
返回指标:TotalToken(总)/ InputTotalToken(输入)/ OutputTotalToken(输出)/ CacheTotalToken(读缓存)。
|
|
81
|
+
- `search`:【待上线】联网搜索用量统计。支持 Dimension = apikey / endpoint / model。
|
|
82
|
+
返回指标:SearchRequestCount(搜索请求数)/ SearchCount(搜索引擎调用次数)。
|
|
83
|
+
|
|
84
|
+
响应内容
|
|
85
|
+
- MetricType 字段用于切换指标族,响应回显 MetricType 与 MetricKeys。
|
|
86
|
+
- TotalStats:时间窗内全部对象的整段聚合值。
|
|
87
|
+
- PageStats:当前翻页内对象的整段聚合值。
|
|
88
|
+
- TopList:按MetricKeys[0]降序的对象列表,含整段聚合值与逐时间点曲线。
|
|
81
89
|
*/
|
|
82
90
|
DescribeUsageRankList(req: DescribeUsageRankListRequest, cb?: (error: string, rep: DescribeUsageRankListResponse) => void): Promise<DescribeUsageRankListResponse>;
|
|
83
91
|
/**
|
|
@@ -119,9 +119,17 @@ class Client extends TencentCloudCommon.AbstractClient {
|
|
|
119
119
|
/**
|
|
120
120
|
* 查询用量排行列表。
|
|
121
121
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
122
|
+
指标族(MetricType)
|
|
123
|
+
- `tokens`(默认):Token 用量统计。支持 Dimension = apikey / endpoint / model。
|
|
124
|
+
返回指标:TotalToken(总)/ InputTotalToken(输入)/ OutputTotalToken(输出)/ CacheTotalToken(读缓存)。
|
|
125
|
+
- `search`:【待上线】联网搜索用量统计。支持 Dimension = apikey / endpoint / model。
|
|
126
|
+
返回指标:SearchRequestCount(搜索请求数)/ SearchCount(搜索引擎调用次数)。
|
|
127
|
+
|
|
128
|
+
响应内容
|
|
129
|
+
- MetricType 字段用于切换指标族,响应回显 MetricType 与 MetricKeys。
|
|
130
|
+
- TotalStats:时间窗内全部对象的整段聚合值。
|
|
131
|
+
- PageStats:当前翻页内对象的整段聚合值。
|
|
132
|
+
- TopList:按MetricKeys[0]降序的对象列表,含整段聚合值与逐时间点曲线。
|
|
125
133
|
*/
|
|
126
134
|
async DescribeUsageRankList(req, cb) {
|
|
127
135
|
return this.request("DescribeUsageRankList", req, cb);
|
|
@@ -471,17 +471,29 @@ export interface DescribeApiKeyListRequest {
|
|
|
471
471
|
*/
|
|
472
472
|
export interface UsageSeries {
|
|
473
473
|
/**
|
|
474
|
-
* 总 token 数用量时间周期内的 JSON 字符串形式,如
|
|
474
|
+
* <p>[tokens 族]总 token 数用量时间周期内的 JSON 字符串形式,如 <code>"[12,null,15]"</code>。</p>
|
|
475
475
|
*/
|
|
476
476
|
TotalToken?: string;
|
|
477
477
|
/**
|
|
478
|
-
* 输入 token 数用量时间周期内的 JSON 字符串形式,如
|
|
478
|
+
* <p>[tokens 族]输入 token 数用量时间周期内的 JSON 字符串形式,如 <code>"[7,null,9]"</code>。</p>
|
|
479
479
|
*/
|
|
480
480
|
InputTotalToken?: string;
|
|
481
481
|
/**
|
|
482
|
-
* 输出 token 数用量时间周期内的 JSON 字符串形式,如
|
|
482
|
+
* <p>[tokens 族]输出 token 数用量时间周期内的 JSON 字符串形式,如 <code>"[5,null,6]"</code>。</p>
|
|
483
483
|
*/
|
|
484
484
|
OutputTotalToken?: string;
|
|
485
|
+
/**
|
|
486
|
+
* <p>[tokens 族]读缓存 token 数用量时间周期内的 JSON 字符串形式,如<code>"[5,null,6]"</code>。</p>
|
|
487
|
+
*/
|
|
488
|
+
CacheTotalToken?: string;
|
|
489
|
+
/**
|
|
490
|
+
* <p>[search 族] 搜索请求数用量时间周期内的 JSON 字符串形式,如<code>"[5,null,6]"</code>。</p>
|
|
491
|
+
*/
|
|
492
|
+
SearchRequestCount?: string;
|
|
493
|
+
/**
|
|
494
|
+
* <p>[search 族] 搜索引擎调用次数用量时间周期内的 JSON 字符串形式,如<code>"[5,null,6]"</code>。</p>
|
|
495
|
+
*/
|
|
496
|
+
SearchCount?: string;
|
|
485
497
|
}
|
|
486
498
|
/**
|
|
487
499
|
* CreateGlossary请求参数结构体
|
|
@@ -963,39 +975,35 @@ export interface UpgradeTokenPlanTeamOrderRequest {
|
|
|
963
975
|
*/
|
|
964
976
|
export interface DescribeUsageRankListRequest {
|
|
965
977
|
/**
|
|
966
|
-
*
|
|
978
|
+
* <p>统计维度。取值:apikey(按 APIKey 统计)、endpoint(按接入点统计)、model(按模型统计)。</p>
|
|
967
979
|
*/
|
|
968
980
|
Dimension: string;
|
|
969
981
|
/**
|
|
970
|
-
*
|
|
982
|
+
* <p>起始时间(闭区间),RFC3339 格式。</p>
|
|
971
983
|
*/
|
|
972
984
|
StartTime: string;
|
|
973
985
|
/**
|
|
974
|
-
*
|
|
986
|
+
* <p>结束时间(开区间),RFC3339 格式。与 StartTime 的跨度最大 90 天。</p>
|
|
975
987
|
*/
|
|
976
988
|
EndTime: string;
|
|
977
989
|
/**
|
|
978
|
-
*
|
|
990
|
+
* <p>指标族切换字段。</p><ul><li>tokens(默认):Token 消耗图(statistics=sum),支持 Dimension = apikey/endpoint/model</li><li>search【待上线】:联网搜索调用次数(statistics=sum),仅支持 Dimension = model</li><li>其他值返回 InvalidParameter。</li></ul><p>枚举值:</p><ul><li>tokens: tokens</li></ul>
|
|
979
991
|
*/
|
|
980
992
|
MetricType?: string;
|
|
981
993
|
/**
|
|
982
|
-
*
|
|
994
|
+
* <p>维度过滤值。空字符串表示查询全部对象,非空时仅查询指定单个对象(如指定 APIKey ID)。最大 256 字符。</p>
|
|
983
995
|
*/
|
|
984
996
|
Target?: string;
|
|
985
997
|
/**
|
|
986
|
-
*
|
|
998
|
+
* <p>统计粒度(秒)。取值:60、300、3600、86400。必须不小于跨度对应下限:跨度 ≤ 1 天 → 60;1 ~ 5 天 → 300;5 ~ 10 天 → 3600;> 10 天 → 86400。仅 ShowAll=false 时使用。</p>
|
|
987
999
|
*/
|
|
988
1000
|
Period?: number;
|
|
989
1001
|
/**
|
|
990
|
-
*
|
|
1002
|
+
* <p>翻页起点,从 0 起,默认 0。ShowAll=true 时忽略。页大小固定为 10。</p>
|
|
991
1003
|
*/
|
|
992
1004
|
Offset?: number;
|
|
993
1005
|
/**
|
|
994
|
-
*
|
|
995
|
-
- false(默认):按 Offset 分页返回 TopList(每页 10 条),每个对象包含
|
|
996
|
-
Series 时序点用于绘制曲线。
|
|
997
|
-
- true:忽略 Offset,返回全量对象列表,不返回 Series(CSV 导出场景)。
|
|
998
|
-
|
|
1006
|
+
* <p>是否返回全量结果。</p><ul><li>false(默认):按 Offset 分页返回 TopList(每页 10 条),每个对象包含<br>Series 时序点用于绘制曲线。</li><li>true:忽略 Offset,返回全量对象列表,不返回 Series(CSV 导出场景)。</li></ul>
|
|
999
1007
|
*/
|
|
1000
1008
|
ShowAll?: boolean;
|
|
1001
1009
|
}
|
|
@@ -1439,80 +1447,92 @@ export interface CreateTokenPlanApiKeysRequest {
|
|
|
1439
1447
|
TPM?: number;
|
|
1440
1448
|
}
|
|
1441
1449
|
/**
|
|
1442
|
-
* 时间周期内的统计聚合值(按 metric key
|
|
1450
|
+
* 时间周期内的统计聚合值(按 metric key 索引)。声明 tokens / search 两族字段都在本 schema 中,按 MetricKeys 实际返回取值,参见响应顶层 `MetricKeys` 字段。
|
|
1443
1451
|
*/
|
|
1444
1452
|
export interface UsageStats {
|
|
1445
1453
|
/**
|
|
1446
|
-
* 时间周期内的累计总 token
|
|
1454
|
+
* <p>[tokens 族] 时间周期内的累计总 token 数。</p>
|
|
1447
1455
|
*/
|
|
1448
1456
|
TotalToken?: number;
|
|
1449
1457
|
/**
|
|
1450
|
-
* 时间周期内的累计输入 token
|
|
1458
|
+
* <p>[tokens 族] 时间周期内的累计输入 token 数。</p>
|
|
1451
1459
|
*/
|
|
1452
1460
|
InputTotalToken?: number;
|
|
1453
1461
|
/**
|
|
1454
|
-
* 时间周期内的累计输出 token
|
|
1462
|
+
* <p>[tokens 族] 时间周期内的累计输出 token 数。</p>
|
|
1455
1463
|
*/
|
|
1456
1464
|
OutputTotalToken?: number;
|
|
1465
|
+
/**
|
|
1466
|
+
* <p>[tokens 族] 时间周期内的累计读缓存 token 数(命中缓存部分)</p>
|
|
1467
|
+
*/
|
|
1468
|
+
CacheTotalToken?: number;
|
|
1469
|
+
/**
|
|
1470
|
+
* <p>[search 族] 整段累计联网搜索请求数</p>
|
|
1471
|
+
*/
|
|
1472
|
+
SearchRequestCount?: number;
|
|
1473
|
+
/**
|
|
1474
|
+
* <p>[search 族] 整段累计搜索引擎调用次数</p>
|
|
1475
|
+
*/
|
|
1476
|
+
SearchCount?: number;
|
|
1457
1477
|
}
|
|
1458
1478
|
/**
|
|
1459
1479
|
* DescribeUsageRankList返回参数结构体
|
|
1460
1480
|
*/
|
|
1461
1481
|
export interface DescribeUsageRankListResponse {
|
|
1462
1482
|
/**
|
|
1463
|
-
*
|
|
1483
|
+
* <p>回填请求的统计维度。</p>
|
|
1464
1484
|
*/
|
|
1465
1485
|
Dimension?: string;
|
|
1466
1486
|
/**
|
|
1467
|
-
*
|
|
1487
|
+
* <p>回填请求的指标族:tokens / search 。</p>
|
|
1468
1488
|
*/
|
|
1469
1489
|
MetricType?: string;
|
|
1470
1490
|
/**
|
|
1471
|
-
*
|
|
1491
|
+
* <p>本次响应中 Stats / Series / PageStats / TotalStats 实际包含的 metric key 列表,按MetricType 区分:tokens=[Total,Input,Output,Cache]、search=[SearchRequestCount,SearchCount]</p>
|
|
1472
1492
|
*/
|
|
1473
1493
|
MetricKeys?: Array<string>;
|
|
1474
1494
|
/**
|
|
1475
|
-
*
|
|
1495
|
+
* <p>视图(数据来源)</p>
|
|
1476
1496
|
*/
|
|
1477
1497
|
ViewName?: string;
|
|
1478
1498
|
/**
|
|
1479
|
-
*
|
|
1499
|
+
* <p>回填请求的统计粒度(秒)。ShowAll=true 时为 0。</p>
|
|
1480
1500
|
*/
|
|
1481
1501
|
Period?: number;
|
|
1482
1502
|
/**
|
|
1483
|
-
*
|
|
1503
|
+
* <p>回填请求的起始时间。</p>
|
|
1484
1504
|
*/
|
|
1485
1505
|
StartTime?: string;
|
|
1486
1506
|
/**
|
|
1487
|
-
*
|
|
1507
|
+
* <p>回填请求的结束时间。</p>
|
|
1488
1508
|
*/
|
|
1489
1509
|
EndTime?: string;
|
|
1490
1510
|
/**
|
|
1491
|
-
*
|
|
1511
|
+
* <p>全量对象数。</p>
|
|
1492
1512
|
*/
|
|
1493
1513
|
Total?: number;
|
|
1494
1514
|
/**
|
|
1495
|
-
*
|
|
1515
|
+
* <p>回填请求的翻页起点。ShowAll=true 时为 0。</p>
|
|
1496
1516
|
*/
|
|
1497
1517
|
Offset?: number;
|
|
1498
1518
|
/**
|
|
1499
|
-
*
|
|
1519
|
+
* <p>页大小,恒为 10。ShowAll=true 时为 Total。</p>
|
|
1500
1520
|
*/
|
|
1501
1521
|
Limit?: number;
|
|
1502
1522
|
/**
|
|
1503
|
-
* Series 数组对应的时间戳序列(Unix 秒)。ShowAll=true
|
|
1523
|
+
* <p>Series 数组对应的时间戳序列(Unix 秒)。ShowAll=true 时为空数组。</p>
|
|
1504
1524
|
*/
|
|
1505
1525
|
Timestamps?: Array<number | bigint>;
|
|
1506
1526
|
/**
|
|
1507
|
-
*
|
|
1527
|
+
* <p>对象排行列表,按<code>MetricKeys[0]</code>降序排序。ShowAll=false 时为当前页 10 个对象(含 Series);ShowAll=true 时为全量对象(不含 Series,用于 CSV 导出)。</p>
|
|
1508
1528
|
*/
|
|
1509
1529
|
TopList?: Array<UsageRankItem>;
|
|
1510
1530
|
/**
|
|
1511
|
-
*
|
|
1531
|
+
* <p>分页统计结果</p>
|
|
1512
1532
|
*/
|
|
1513
1533
|
PageStats?: UsageStats;
|
|
1514
1534
|
/**
|
|
1515
|
-
*
|
|
1535
|
+
* <p>总统计结果</p>
|
|
1516
1536
|
*/
|
|
1517
1537
|
TotalStats?: UsageStats;
|
|
1518
1538
|
/**
|