@lynn123411/dsh-a6api 1.5.0 → 1.5.2
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/README.md +1 -0
- package/lib/client.js +40 -1
- package/lib/client.js.map +2 -2
- package/lib/index.js +233 -142
- package/lib/index.js.map +2 -2
- package/lib/types/server/a6api-client.d.ts +7 -0
- package/lib/types/types.d.ts +2 -0
- package/package.json +1 -1
|
@@ -5,6 +5,13 @@ export declare function cleanBaseUrl(url: string): string;
|
|
|
5
5
|
export declare function formatRelativeTime(timestampSec: number): string;
|
|
6
6
|
/** Format CNY Price */
|
|
7
7
|
export declare function formatCnyPrice(micros: number, exchangeRate?: number): string;
|
|
8
|
+
/**
|
|
9
|
+
* 混合价估算(¥ / 1亿 tokens,供模型卡片徽标展示,换算与口径同官网标注脚本):
|
|
10
|
+
* 输入类 token 占 99.65%,按 24h 实测缓存命中率分为「命中 × 缓存读价」与「未命中 × 输入价」,
|
|
11
|
+
* 输出固定占 0.35% × 输出价。单价按 micros/1e6 × 汇率折算为 ¥/1M;
|
|
12
|
+
* 三类单价全为 0(按次计费等无 token 单价)时返回 undefined,前端不展示。
|
|
13
|
+
*/
|
|
14
|
+
export declare function computeBlendedPrice100m(inMicros: number, cacheReadMicros: number, outMicros: number, cacheHitRatePct: number, exchangeRate: number): number | undefined;
|
|
8
15
|
export declare function buildWebHeaders(userId?: string, accessToken?: string): Record<string, string>;
|
|
9
16
|
/** Fetch User Balance (Real Account Balance Only) */
|
|
10
17
|
export declare function fetchBalance(baseURL: string, apiKey: string, userId?: string, accessToken?: string): Promise<BalanceInfo | null>;
|
package/lib/types/types.d.ts
CHANGED
|
@@ -126,6 +126,8 @@ export interface MerchantChannelInfo {
|
|
|
126
126
|
p50_ttft_ms?: number;
|
|
127
127
|
recent_p50_ms: number;
|
|
128
128
|
cache_hit_rate_pct: number;
|
|
129
|
+
/** 混合价估算(¥ / 1亿 tokens):输入类 99.65% 按 24h 缓存命中率分为命中(缓存读价)/未命中(输入价),输出固定占 0.35%;无 token 单价时缺省不展示 */
|
|
130
|
+
blended_price_100m_cny?: number;
|
|
129
131
|
labels: string[];
|
|
130
132
|
last_success_at: number;
|
|
131
133
|
last_success_text: string;
|