@waterplus-ai/waterbuddy 0.1.35 → 0.1.37
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/lib/host/llm-gateway.js +9 -3
- package/package.json +1 -1
package/lib/host/llm-gateway.js
CHANGED
|
@@ -202,9 +202,15 @@ export async function requestDeviceCredential(options) {
|
|
|
202
202
|
return normalizeCredentialPayload(payload)
|
|
203
203
|
}
|
|
204
204
|
|
|
205
|
-
/**
|
|
205
|
+
/**
|
|
206
|
+
* 用登录态换账号档凭证:额度升档。
|
|
207
|
+
*
|
|
208
|
+
* **不并入设备试用额度**(`mergeDeviceQuota: false`)。设备档是按设备发放的,
|
|
209
|
+
* 并入会让「N 台设备登录同一账号」累加成 10 + N×0.1;账号额度保持整齐的初始值。
|
|
210
|
+
* 后端仍保留该能力,需要时显式传 true。
|
|
211
|
+
*/
|
|
206
212
|
export async function requestUserCredential(options) {
|
|
207
|
-
const { baseUrl, token, deviceId, mergeDeviceQuota =
|
|
213
|
+
const { baseUrl, token, deviceId, mergeDeviceQuota = false, transport, timeoutMs = 15000 } = options
|
|
208
214
|
if (!token) throw new Error('llm-bind-missing-token')
|
|
209
215
|
const payload = await callLlmGateway({
|
|
210
216
|
baseUrl,
|
|
@@ -335,7 +341,7 @@ export async function bindLlmCredential(ctx, token, options = {}) {
|
|
|
335
341
|
baseUrl,
|
|
336
342
|
token,
|
|
337
343
|
deviceId,
|
|
338
|
-
mergeDeviceQuota: options.mergeDeviceQuota
|
|
344
|
+
mergeDeviceQuota: options.mergeDeviceQuota === true,
|
|
339
345
|
transport: options.transport,
|
|
340
346
|
})
|
|
341
347
|
await ctx.credentials.set(LLM_GATEWAY_CREDENTIAL_REF, credential.apiKey)
|