@tangle-network/tcloud 0.1.3 → 0.1.4
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/dist/{chunk-YKLHAS4E.js → chunk-KVXWEAK3.js} +111 -1
- package/dist/{chunk-G5LUZZKT.js → chunk-PILYAKCF.js} +1 -1
- package/dist/cli.cjs +111 -1
- package/dist/cli.js +2 -2
- package/dist/index.cjs +111 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/{shielded-xDNVqK4a.d.cts → shielded-BTi_OftW.d.cts} +110 -1
- package/dist/{shielded-xDNVqK4a.d.ts → shielded-BTi_OftW.d.ts} +110 -1
- package/dist/shielded.cjs +111 -1
- package/dist/shielded.d.cts +1 -1
- package/dist/shielded.d.ts +1 -1
- package/dist/shielded.js +1 -1
- package/package.json +1 -1
|
@@ -60,11 +60,14 @@ var TCloudClient = class {
|
|
|
60
60
|
this.limits = config.limits;
|
|
61
61
|
this.headers = {
|
|
62
62
|
"Content-Type": "application/json",
|
|
63
|
-
"X-Tangle-Client": "tcloud-sdk/0.1.
|
|
63
|
+
"X-Tangle-Client": "tcloud-sdk/0.1.4"
|
|
64
64
|
};
|
|
65
65
|
if (this.apiKey) {
|
|
66
66
|
this.headers["Authorization"] = `Bearer ${this.apiKey}`;
|
|
67
67
|
}
|
|
68
|
+
if (config.routing?.mode) {
|
|
69
|
+
this.headers["X-Tangle-Routing"] = config.routing.mode;
|
|
70
|
+
}
|
|
68
71
|
if (config.routing?.prefer) {
|
|
69
72
|
this.headers["X-Tangle-Operator"] = config.routing.prefer;
|
|
70
73
|
}
|
|
@@ -374,6 +377,113 @@ var TCloudClient = class {
|
|
|
374
377
|
this._requestCount++;
|
|
375
378
|
return res.arrayBuffer();
|
|
376
379
|
}
|
|
380
|
+
/** Legacy completions endpoint */
|
|
381
|
+
async completions(options) {
|
|
382
|
+
const res = await proxiedFetch(this.privacy, `${this.baseURL}/completions`, {
|
|
383
|
+
method: "POST",
|
|
384
|
+
headers: this.headers,
|
|
385
|
+
body: JSON.stringify({
|
|
386
|
+
model: options.model || this.model,
|
|
387
|
+
prompt: options.prompt,
|
|
388
|
+
temperature: options.temperature,
|
|
389
|
+
max_tokens: options.maxTokens,
|
|
390
|
+
stop: options.stop,
|
|
391
|
+
top_p: options.topP
|
|
392
|
+
})
|
|
393
|
+
}, false);
|
|
394
|
+
if (!res.ok) {
|
|
395
|
+
const err = await res.json().catch(() => ({ error: res.statusText }));
|
|
396
|
+
throw new TCloudError(res.status, err.error?.message || err.error || res.statusText);
|
|
397
|
+
}
|
|
398
|
+
this._requestCount++;
|
|
399
|
+
return res.json();
|
|
400
|
+
}
|
|
401
|
+
/** Audio transcription (speech-to-text) */
|
|
402
|
+
async transcribe(file, options) {
|
|
403
|
+
const formData = new FormData();
|
|
404
|
+
formData.append("file", file, "audio.webm");
|
|
405
|
+
formData.append("model", options?.model || "whisper-1");
|
|
406
|
+
if (options?.language) formData.append("language", options.language);
|
|
407
|
+
if (options?.prompt) formData.append("prompt", options.prompt);
|
|
408
|
+
const headers = { ...this.headers };
|
|
409
|
+
delete headers["Content-Type"];
|
|
410
|
+
const res = await proxiedFetch(this.privacy, `${this.baseURL}/audio/transcriptions`, {
|
|
411
|
+
method: "POST",
|
|
412
|
+
headers,
|
|
413
|
+
body: formData
|
|
414
|
+
}, false);
|
|
415
|
+
if (!res.ok) {
|
|
416
|
+
const err = await res.json().catch(() => ({ error: res.statusText }));
|
|
417
|
+
throw new TCloudError(res.status, err.error?.message || err.error || res.statusText);
|
|
418
|
+
}
|
|
419
|
+
this._requestCount++;
|
|
420
|
+
return res.json();
|
|
421
|
+
}
|
|
422
|
+
/** Create a fine-tuning job */
|
|
423
|
+
async fineTuneCreate(options) {
|
|
424
|
+
const res = await proxiedFetch(this.privacy, `${this.baseURL}/fine_tuning/jobs`, {
|
|
425
|
+
method: "POST",
|
|
426
|
+
headers: this.headers,
|
|
427
|
+
body: JSON.stringify(options)
|
|
428
|
+
}, false);
|
|
429
|
+
if (!res.ok) {
|
|
430
|
+
const err = await res.json().catch(() => ({ error: res.statusText }));
|
|
431
|
+
throw new TCloudError(res.status, err.error?.message || err.error || res.statusText);
|
|
432
|
+
}
|
|
433
|
+
this._requestCount++;
|
|
434
|
+
return res.json();
|
|
435
|
+
}
|
|
436
|
+
/** List fine-tuning jobs */
|
|
437
|
+
async fineTuneList() {
|
|
438
|
+
const res = await proxiedFetch(this.privacy, `${this.baseURL}/fine_tuning/jobs`, {
|
|
439
|
+
headers: this.headers
|
|
440
|
+
}, false);
|
|
441
|
+
if (!res.ok) throw new TCloudError(res.status, "Failed to fetch fine-tuning jobs");
|
|
442
|
+
return res.json();
|
|
443
|
+
}
|
|
444
|
+
/** Submit a batch of chat requests */
|
|
445
|
+
async batch(requests) {
|
|
446
|
+
const res = await proxiedFetch(this.privacy, `${this.baseURL}/batch`, {
|
|
447
|
+
method: "POST",
|
|
448
|
+
headers: this.headers,
|
|
449
|
+
body: JSON.stringify({ requests })
|
|
450
|
+
}, false);
|
|
451
|
+
if (!res.ok) {
|
|
452
|
+
const err = await res.json().catch(() => ({ error: res.statusText }));
|
|
453
|
+
throw new TCloudError(res.status, err.error?.message || err.error || res.statusText);
|
|
454
|
+
}
|
|
455
|
+
return res.json();
|
|
456
|
+
}
|
|
457
|
+
/** Get batch job status */
|
|
458
|
+
async batchStatus(jobId) {
|
|
459
|
+
const res = await proxiedFetch(this.privacy, `${this.baseURL}/batch?id=${jobId}`, {
|
|
460
|
+
headers: this.headers
|
|
461
|
+
}, false);
|
|
462
|
+
if (!res.ok) throw new TCloudError(res.status, "Failed to fetch batch status");
|
|
463
|
+
return res.json();
|
|
464
|
+
}
|
|
465
|
+
/** Generate video */
|
|
466
|
+
async videoGenerate(options) {
|
|
467
|
+
const res = await proxiedFetch(this.privacy, `${this.baseURL}/video/generate`, {
|
|
468
|
+
method: "POST",
|
|
469
|
+
headers: this.headers,
|
|
470
|
+
body: JSON.stringify(options)
|
|
471
|
+
}, false);
|
|
472
|
+
if (!res.ok) {
|
|
473
|
+
const err = await res.json().catch(() => ({ error: res.statusText }));
|
|
474
|
+
throw new TCloudError(res.status, err.error?.message || err.error || res.statusText);
|
|
475
|
+
}
|
|
476
|
+
this._requestCount++;
|
|
477
|
+
return res.json();
|
|
478
|
+
}
|
|
479
|
+
/** Get video generation status */
|
|
480
|
+
async videoStatus(id) {
|
|
481
|
+
const res = await proxiedFetch(this.privacy, `${this.baseURL}/video?id=${id}`, {
|
|
482
|
+
headers: this.headers
|
|
483
|
+
}, false);
|
|
484
|
+
if (!res.ok) throw new TCloudError(res.status, "Failed to fetch video status");
|
|
485
|
+
return res.json();
|
|
486
|
+
}
|
|
377
487
|
/** Search models by name, provider, or capability */
|
|
378
488
|
async searchModels(query) {
|
|
379
489
|
const all = await this.models();
|
package/dist/cli.cjs
CHANGED
|
@@ -84,11 +84,14 @@ var TCloudClient = class {
|
|
|
84
84
|
this.limits = config.limits;
|
|
85
85
|
this.headers = {
|
|
86
86
|
"Content-Type": "application/json",
|
|
87
|
-
"X-Tangle-Client": "tcloud-sdk/0.1.
|
|
87
|
+
"X-Tangle-Client": "tcloud-sdk/0.1.4"
|
|
88
88
|
};
|
|
89
89
|
if (this.apiKey) {
|
|
90
90
|
this.headers["Authorization"] = `Bearer ${this.apiKey}`;
|
|
91
91
|
}
|
|
92
|
+
if (config.routing?.mode) {
|
|
93
|
+
this.headers["X-Tangle-Routing"] = config.routing.mode;
|
|
94
|
+
}
|
|
92
95
|
if (config.routing?.prefer) {
|
|
93
96
|
this.headers["X-Tangle-Operator"] = config.routing.prefer;
|
|
94
97
|
}
|
|
@@ -398,6 +401,113 @@ var TCloudClient = class {
|
|
|
398
401
|
this._requestCount++;
|
|
399
402
|
return res.arrayBuffer();
|
|
400
403
|
}
|
|
404
|
+
/** Legacy completions endpoint */
|
|
405
|
+
async completions(options) {
|
|
406
|
+
const res = await proxiedFetch(this.privacy, `${this.baseURL}/completions`, {
|
|
407
|
+
method: "POST",
|
|
408
|
+
headers: this.headers,
|
|
409
|
+
body: JSON.stringify({
|
|
410
|
+
model: options.model || this.model,
|
|
411
|
+
prompt: options.prompt,
|
|
412
|
+
temperature: options.temperature,
|
|
413
|
+
max_tokens: options.maxTokens,
|
|
414
|
+
stop: options.stop,
|
|
415
|
+
top_p: options.topP
|
|
416
|
+
})
|
|
417
|
+
}, false);
|
|
418
|
+
if (!res.ok) {
|
|
419
|
+
const err = await res.json().catch(() => ({ error: res.statusText }));
|
|
420
|
+
throw new TCloudError(res.status, err.error?.message || err.error || res.statusText);
|
|
421
|
+
}
|
|
422
|
+
this._requestCount++;
|
|
423
|
+
return res.json();
|
|
424
|
+
}
|
|
425
|
+
/** Audio transcription (speech-to-text) */
|
|
426
|
+
async transcribe(file, options) {
|
|
427
|
+
const formData = new FormData();
|
|
428
|
+
formData.append("file", file, "audio.webm");
|
|
429
|
+
formData.append("model", options?.model || "whisper-1");
|
|
430
|
+
if (options?.language) formData.append("language", options.language);
|
|
431
|
+
if (options?.prompt) formData.append("prompt", options.prompt);
|
|
432
|
+
const headers = { ...this.headers };
|
|
433
|
+
delete headers["Content-Type"];
|
|
434
|
+
const res = await proxiedFetch(this.privacy, `${this.baseURL}/audio/transcriptions`, {
|
|
435
|
+
method: "POST",
|
|
436
|
+
headers,
|
|
437
|
+
body: formData
|
|
438
|
+
}, false);
|
|
439
|
+
if (!res.ok) {
|
|
440
|
+
const err = await res.json().catch(() => ({ error: res.statusText }));
|
|
441
|
+
throw new TCloudError(res.status, err.error?.message || err.error || res.statusText);
|
|
442
|
+
}
|
|
443
|
+
this._requestCount++;
|
|
444
|
+
return res.json();
|
|
445
|
+
}
|
|
446
|
+
/** Create a fine-tuning job */
|
|
447
|
+
async fineTuneCreate(options) {
|
|
448
|
+
const res = await proxiedFetch(this.privacy, `${this.baseURL}/fine_tuning/jobs`, {
|
|
449
|
+
method: "POST",
|
|
450
|
+
headers: this.headers,
|
|
451
|
+
body: JSON.stringify(options)
|
|
452
|
+
}, false);
|
|
453
|
+
if (!res.ok) {
|
|
454
|
+
const err = await res.json().catch(() => ({ error: res.statusText }));
|
|
455
|
+
throw new TCloudError(res.status, err.error?.message || err.error || res.statusText);
|
|
456
|
+
}
|
|
457
|
+
this._requestCount++;
|
|
458
|
+
return res.json();
|
|
459
|
+
}
|
|
460
|
+
/** List fine-tuning jobs */
|
|
461
|
+
async fineTuneList() {
|
|
462
|
+
const res = await proxiedFetch(this.privacy, `${this.baseURL}/fine_tuning/jobs`, {
|
|
463
|
+
headers: this.headers
|
|
464
|
+
}, false);
|
|
465
|
+
if (!res.ok) throw new TCloudError(res.status, "Failed to fetch fine-tuning jobs");
|
|
466
|
+
return res.json();
|
|
467
|
+
}
|
|
468
|
+
/** Submit a batch of chat requests */
|
|
469
|
+
async batch(requests) {
|
|
470
|
+
const res = await proxiedFetch(this.privacy, `${this.baseURL}/batch`, {
|
|
471
|
+
method: "POST",
|
|
472
|
+
headers: this.headers,
|
|
473
|
+
body: JSON.stringify({ requests })
|
|
474
|
+
}, false);
|
|
475
|
+
if (!res.ok) {
|
|
476
|
+
const err = await res.json().catch(() => ({ error: res.statusText }));
|
|
477
|
+
throw new TCloudError(res.status, err.error?.message || err.error || res.statusText);
|
|
478
|
+
}
|
|
479
|
+
return res.json();
|
|
480
|
+
}
|
|
481
|
+
/** Get batch job status */
|
|
482
|
+
async batchStatus(jobId) {
|
|
483
|
+
const res = await proxiedFetch(this.privacy, `${this.baseURL}/batch?id=${jobId}`, {
|
|
484
|
+
headers: this.headers
|
|
485
|
+
}, false);
|
|
486
|
+
if (!res.ok) throw new TCloudError(res.status, "Failed to fetch batch status");
|
|
487
|
+
return res.json();
|
|
488
|
+
}
|
|
489
|
+
/** Generate video */
|
|
490
|
+
async videoGenerate(options) {
|
|
491
|
+
const res = await proxiedFetch(this.privacy, `${this.baseURL}/video/generate`, {
|
|
492
|
+
method: "POST",
|
|
493
|
+
headers: this.headers,
|
|
494
|
+
body: JSON.stringify(options)
|
|
495
|
+
}, false);
|
|
496
|
+
if (!res.ok) {
|
|
497
|
+
const err = await res.json().catch(() => ({ error: res.statusText }));
|
|
498
|
+
throw new TCloudError(res.status, err.error?.message || err.error || res.statusText);
|
|
499
|
+
}
|
|
500
|
+
this._requestCount++;
|
|
501
|
+
return res.json();
|
|
502
|
+
}
|
|
503
|
+
/** Get video generation status */
|
|
504
|
+
async videoStatus(id) {
|
|
505
|
+
const res = await proxiedFetch(this.privacy, `${this.baseURL}/video?id=${id}`, {
|
|
506
|
+
headers: this.headers
|
|
507
|
+
}, false);
|
|
508
|
+
if (!res.ok) throw new TCloudError(res.status, "Failed to fetch video status");
|
|
509
|
+
return res.json();
|
|
510
|
+
}
|
|
401
511
|
/** Search models by name, provider, or capability */
|
|
402
512
|
async searchModels(query) {
|
|
403
513
|
const all = await this.models();
|
package/dist/cli.js
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -98,11 +98,14 @@ var TCloudClient = class {
|
|
|
98
98
|
this.limits = config.limits;
|
|
99
99
|
this.headers = {
|
|
100
100
|
"Content-Type": "application/json",
|
|
101
|
-
"X-Tangle-Client": "tcloud-sdk/0.1.
|
|
101
|
+
"X-Tangle-Client": "tcloud-sdk/0.1.4"
|
|
102
102
|
};
|
|
103
103
|
if (this.apiKey) {
|
|
104
104
|
this.headers["Authorization"] = `Bearer ${this.apiKey}`;
|
|
105
105
|
}
|
|
106
|
+
if (config.routing?.mode) {
|
|
107
|
+
this.headers["X-Tangle-Routing"] = config.routing.mode;
|
|
108
|
+
}
|
|
106
109
|
if (config.routing?.prefer) {
|
|
107
110
|
this.headers["X-Tangle-Operator"] = config.routing.prefer;
|
|
108
111
|
}
|
|
@@ -412,6 +415,113 @@ var TCloudClient = class {
|
|
|
412
415
|
this._requestCount++;
|
|
413
416
|
return res.arrayBuffer();
|
|
414
417
|
}
|
|
418
|
+
/** Legacy completions endpoint */
|
|
419
|
+
async completions(options) {
|
|
420
|
+
const res = await proxiedFetch(this.privacy, `${this.baseURL}/completions`, {
|
|
421
|
+
method: "POST",
|
|
422
|
+
headers: this.headers,
|
|
423
|
+
body: JSON.stringify({
|
|
424
|
+
model: options.model || this.model,
|
|
425
|
+
prompt: options.prompt,
|
|
426
|
+
temperature: options.temperature,
|
|
427
|
+
max_tokens: options.maxTokens,
|
|
428
|
+
stop: options.stop,
|
|
429
|
+
top_p: options.topP
|
|
430
|
+
})
|
|
431
|
+
}, false);
|
|
432
|
+
if (!res.ok) {
|
|
433
|
+
const err = await res.json().catch(() => ({ error: res.statusText }));
|
|
434
|
+
throw new TCloudError(res.status, err.error?.message || err.error || res.statusText);
|
|
435
|
+
}
|
|
436
|
+
this._requestCount++;
|
|
437
|
+
return res.json();
|
|
438
|
+
}
|
|
439
|
+
/** Audio transcription (speech-to-text) */
|
|
440
|
+
async transcribe(file, options) {
|
|
441
|
+
const formData = new FormData();
|
|
442
|
+
formData.append("file", file, "audio.webm");
|
|
443
|
+
formData.append("model", options?.model || "whisper-1");
|
|
444
|
+
if (options?.language) formData.append("language", options.language);
|
|
445
|
+
if (options?.prompt) formData.append("prompt", options.prompt);
|
|
446
|
+
const headers = { ...this.headers };
|
|
447
|
+
delete headers["Content-Type"];
|
|
448
|
+
const res = await proxiedFetch(this.privacy, `${this.baseURL}/audio/transcriptions`, {
|
|
449
|
+
method: "POST",
|
|
450
|
+
headers,
|
|
451
|
+
body: formData
|
|
452
|
+
}, false);
|
|
453
|
+
if (!res.ok) {
|
|
454
|
+
const err = await res.json().catch(() => ({ error: res.statusText }));
|
|
455
|
+
throw new TCloudError(res.status, err.error?.message || err.error || res.statusText);
|
|
456
|
+
}
|
|
457
|
+
this._requestCount++;
|
|
458
|
+
return res.json();
|
|
459
|
+
}
|
|
460
|
+
/** Create a fine-tuning job */
|
|
461
|
+
async fineTuneCreate(options) {
|
|
462
|
+
const res = await proxiedFetch(this.privacy, `${this.baseURL}/fine_tuning/jobs`, {
|
|
463
|
+
method: "POST",
|
|
464
|
+
headers: this.headers,
|
|
465
|
+
body: JSON.stringify(options)
|
|
466
|
+
}, false);
|
|
467
|
+
if (!res.ok) {
|
|
468
|
+
const err = await res.json().catch(() => ({ error: res.statusText }));
|
|
469
|
+
throw new TCloudError(res.status, err.error?.message || err.error || res.statusText);
|
|
470
|
+
}
|
|
471
|
+
this._requestCount++;
|
|
472
|
+
return res.json();
|
|
473
|
+
}
|
|
474
|
+
/** List fine-tuning jobs */
|
|
475
|
+
async fineTuneList() {
|
|
476
|
+
const res = await proxiedFetch(this.privacy, `${this.baseURL}/fine_tuning/jobs`, {
|
|
477
|
+
headers: this.headers
|
|
478
|
+
}, false);
|
|
479
|
+
if (!res.ok) throw new TCloudError(res.status, "Failed to fetch fine-tuning jobs");
|
|
480
|
+
return res.json();
|
|
481
|
+
}
|
|
482
|
+
/** Submit a batch of chat requests */
|
|
483
|
+
async batch(requests) {
|
|
484
|
+
const res = await proxiedFetch(this.privacy, `${this.baseURL}/batch`, {
|
|
485
|
+
method: "POST",
|
|
486
|
+
headers: this.headers,
|
|
487
|
+
body: JSON.stringify({ requests })
|
|
488
|
+
}, false);
|
|
489
|
+
if (!res.ok) {
|
|
490
|
+
const err = await res.json().catch(() => ({ error: res.statusText }));
|
|
491
|
+
throw new TCloudError(res.status, err.error?.message || err.error || res.statusText);
|
|
492
|
+
}
|
|
493
|
+
return res.json();
|
|
494
|
+
}
|
|
495
|
+
/** Get batch job status */
|
|
496
|
+
async batchStatus(jobId) {
|
|
497
|
+
const res = await proxiedFetch(this.privacy, `${this.baseURL}/batch?id=${jobId}`, {
|
|
498
|
+
headers: this.headers
|
|
499
|
+
}, false);
|
|
500
|
+
if (!res.ok) throw new TCloudError(res.status, "Failed to fetch batch status");
|
|
501
|
+
return res.json();
|
|
502
|
+
}
|
|
503
|
+
/** Generate video */
|
|
504
|
+
async videoGenerate(options) {
|
|
505
|
+
const res = await proxiedFetch(this.privacy, `${this.baseURL}/video/generate`, {
|
|
506
|
+
method: "POST",
|
|
507
|
+
headers: this.headers,
|
|
508
|
+
body: JSON.stringify(options)
|
|
509
|
+
}, false);
|
|
510
|
+
if (!res.ok) {
|
|
511
|
+
const err = await res.json().catch(() => ({ error: res.statusText }));
|
|
512
|
+
throw new TCloudError(res.status, err.error?.message || err.error || res.statusText);
|
|
513
|
+
}
|
|
514
|
+
this._requestCount++;
|
|
515
|
+
return res.json();
|
|
516
|
+
}
|
|
517
|
+
/** Get video generation status */
|
|
518
|
+
async videoStatus(id) {
|
|
519
|
+
const res = await proxiedFetch(this.privacy, `${this.baseURL}/video?id=${id}`, {
|
|
520
|
+
headers: this.headers
|
|
521
|
+
}, false);
|
|
522
|
+
if (!res.ok) throw new TCloudError(res.status, "Failed to fetch video status");
|
|
523
|
+
return res.json();
|
|
524
|
+
}
|
|
415
525
|
/** Search models by name, provider, or capability */
|
|
416
526
|
async searchModels(query) {
|
|
417
527
|
const all = await this.models();
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { T as TCloudClient, a as TCloudConfig, S as ShieldedWallet, g as generateWallet } from './shielded-
|
|
2
|
-
export { C as ChatCompletion,
|
|
1
|
+
import { T as TCloudClient, a as TCloudConfig, S as ShieldedWallet, g as generateWallet } from './shielded-BTi_OftW.cjs';
|
|
2
|
+
export { B as BatchJobResponse, b as BatchRequest, C as ChatCompletion, c as ChatCompletionChunk, d as ChatMessage, e as ChatOptions, f as CompletionOptions, h as CompletionResponse, i as CreditBalance, E as EmbeddingOptions, j as EmbeddingResponse, F as FineTuningJob, k as FineTuningJobOptions, I as ImageGenerateOptions, l as ImageResponse, M as Model, O as Operator, P as PrivacyConfig, R as RerankOptions, m as RerankResponse, n as RoutingConfig, o as ShieldedConfig, p as SpendAuth, q as SpendingLimits, r as TCloudError, s as TranscriptionResponse, V as VideoGenerateOptions, t as VideoResponse, u as createShieldedClient, v as estimateCost, w as signSpendAuth } from './shielded-BTi_OftW.cjs';
|
|
3
3
|
import 'viem';
|
|
4
4
|
|
|
5
5
|
declare class TCloud extends TCloudClient {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { T as TCloudClient, a as TCloudConfig, S as ShieldedWallet, g as generateWallet } from './shielded-
|
|
2
|
-
export { C as ChatCompletion,
|
|
1
|
+
import { T as TCloudClient, a as TCloudConfig, S as ShieldedWallet, g as generateWallet } from './shielded-BTi_OftW.js';
|
|
2
|
+
export { B as BatchJobResponse, b as BatchRequest, C as ChatCompletion, c as ChatCompletionChunk, d as ChatMessage, e as ChatOptions, f as CompletionOptions, h as CompletionResponse, i as CreditBalance, E as EmbeddingOptions, j as EmbeddingResponse, F as FineTuningJob, k as FineTuningJobOptions, I as ImageGenerateOptions, l as ImageResponse, M as Model, O as Operator, P as PrivacyConfig, R as RerankOptions, m as RerankResponse, n as RoutingConfig, o as ShieldedConfig, p as SpendAuth, q as SpendingLimits, r as TCloudError, s as TranscriptionResponse, V as VideoGenerateOptions, t as VideoResponse, u as createShieldedClient, v as estimateCost, w as signSpendAuth } from './shielded-BTi_OftW.js';
|
|
3
3
|
import 'viem';
|
|
4
4
|
|
|
5
5
|
declare class TCloud extends TCloudClient {
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
TCloud
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-PILYAKCF.js";
|
|
4
4
|
import {
|
|
5
5
|
TCloudClient,
|
|
6
6
|
TCloudError,
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
estimateCost,
|
|
9
9
|
generateWallet,
|
|
10
10
|
signSpendAuth
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-KVXWEAK3.js";
|
|
12
12
|
export {
|
|
13
13
|
TCloud,
|
|
14
14
|
TCloudClient,
|
|
@@ -38,6 +38,8 @@ interface SpendingLimits {
|
|
|
38
38
|
}) => void;
|
|
39
39
|
}
|
|
40
40
|
interface RoutingConfig {
|
|
41
|
+
/** Routing mode: 'operator' (Tangle operators only), 'provider' (direct APIs only), 'auto' (try operators, fall back to providers) */
|
|
42
|
+
mode?: 'operator' | 'provider' | 'auto';
|
|
41
43
|
/** Preferred operator slug or address */
|
|
42
44
|
prefer?: string;
|
|
43
45
|
/** Blueprint ID — route to operators under this Blueprint */
|
|
@@ -96,6 +98,91 @@ interface RerankResponse {
|
|
|
96
98
|
relevance_score: number;
|
|
97
99
|
}[];
|
|
98
100
|
}
|
|
101
|
+
interface CompletionOptions {
|
|
102
|
+
model?: string;
|
|
103
|
+
prompt: string;
|
|
104
|
+
temperature?: number;
|
|
105
|
+
maxTokens?: number;
|
|
106
|
+
stop?: string | string[];
|
|
107
|
+
topP?: number;
|
|
108
|
+
}
|
|
109
|
+
interface CompletionResponse {
|
|
110
|
+
id: string;
|
|
111
|
+
object: string;
|
|
112
|
+
created: number;
|
|
113
|
+
model: string;
|
|
114
|
+
choices: {
|
|
115
|
+
text: string;
|
|
116
|
+
index: number;
|
|
117
|
+
finish_reason: string;
|
|
118
|
+
}[];
|
|
119
|
+
usage?: {
|
|
120
|
+
prompt_tokens: number;
|
|
121
|
+
completion_tokens: number;
|
|
122
|
+
total_tokens: number;
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
interface TranscriptionResponse {
|
|
126
|
+
text: string;
|
|
127
|
+
}
|
|
128
|
+
interface FineTuningJobOptions {
|
|
129
|
+
model: string;
|
|
130
|
+
training_file: string;
|
|
131
|
+
hyperparameters?: {
|
|
132
|
+
n_epochs?: number | 'auto';
|
|
133
|
+
batch_size?: number | 'auto';
|
|
134
|
+
learning_rate_multiplier?: number | 'auto';
|
|
135
|
+
};
|
|
136
|
+
suffix?: string;
|
|
137
|
+
}
|
|
138
|
+
interface FineTuningJob {
|
|
139
|
+
id: string;
|
|
140
|
+
object: string;
|
|
141
|
+
model: string;
|
|
142
|
+
status: string;
|
|
143
|
+
created_at: number;
|
|
144
|
+
finished_at: number | null;
|
|
145
|
+
fine_tuned_model: string | null;
|
|
146
|
+
error: {
|
|
147
|
+
code: string;
|
|
148
|
+
message: string;
|
|
149
|
+
} | null;
|
|
150
|
+
}
|
|
151
|
+
interface BatchRequest {
|
|
152
|
+
model: string;
|
|
153
|
+
messages: ChatMessage[];
|
|
154
|
+
temperature?: number;
|
|
155
|
+
max_tokens?: number;
|
|
156
|
+
}
|
|
157
|
+
interface BatchJobResponse {
|
|
158
|
+
id: string;
|
|
159
|
+
status: 'pending' | 'processing' | 'completed' | 'failed';
|
|
160
|
+
total_items: number;
|
|
161
|
+
completed: number;
|
|
162
|
+
failed: number;
|
|
163
|
+
results: ({
|
|
164
|
+
status: 'fulfilled';
|
|
165
|
+
data: ChatCompletion;
|
|
166
|
+
} | {
|
|
167
|
+
status: 'rejected';
|
|
168
|
+
error: string;
|
|
169
|
+
})[] | null;
|
|
170
|
+
error: string | null;
|
|
171
|
+
created_at: string;
|
|
172
|
+
completed_at: string | null;
|
|
173
|
+
}
|
|
174
|
+
interface VideoGenerateOptions {
|
|
175
|
+
model?: string;
|
|
176
|
+
prompt: string;
|
|
177
|
+
duration?: number;
|
|
178
|
+
resolution?: string;
|
|
179
|
+
}
|
|
180
|
+
interface VideoResponse {
|
|
181
|
+
id: string;
|
|
182
|
+
status: string;
|
|
183
|
+
url?: string;
|
|
184
|
+
error?: string;
|
|
185
|
+
}
|
|
99
186
|
interface PrivacyConfig {
|
|
100
187
|
/** 'direct' — no proxy (default). 'relayer' — route through tcloud-relayer. 'socks5' — route through SOCKS5 proxy (e.g. Tor). */
|
|
101
188
|
mode: 'direct' | 'relayer' | 'socks5';
|
|
@@ -326,6 +413,28 @@ declare class TCloudClient {
|
|
|
326
413
|
input: string;
|
|
327
414
|
voice?: string;
|
|
328
415
|
}): Promise<ArrayBuffer>;
|
|
416
|
+
/** Legacy completions endpoint */
|
|
417
|
+
completions(options: CompletionOptions): Promise<CompletionResponse>;
|
|
418
|
+
/** Audio transcription (speech-to-text) */
|
|
419
|
+
transcribe(file: Blob, options?: {
|
|
420
|
+
model?: string;
|
|
421
|
+
language?: string;
|
|
422
|
+
prompt?: string;
|
|
423
|
+
}): Promise<TranscriptionResponse>;
|
|
424
|
+
/** Create a fine-tuning job */
|
|
425
|
+
fineTuneCreate(options: FineTuningJobOptions): Promise<FineTuningJob>;
|
|
426
|
+
/** List fine-tuning jobs */
|
|
427
|
+
fineTuneList(): Promise<{
|
|
428
|
+
data: FineTuningJob[];
|
|
429
|
+
}>;
|
|
430
|
+
/** Submit a batch of chat requests */
|
|
431
|
+
batch(requests: BatchRequest[]): Promise<BatchJobResponse>;
|
|
432
|
+
/** Get batch job status */
|
|
433
|
+
batchStatus(jobId: string): Promise<BatchJobResponse>;
|
|
434
|
+
/** Generate video */
|
|
435
|
+
videoGenerate(options: VideoGenerateOptions): Promise<VideoResponse>;
|
|
436
|
+
/** Get video generation status */
|
|
437
|
+
videoStatus(id: string): Promise<VideoResponse>;
|
|
329
438
|
/** Search models by name, provider, or capability */
|
|
330
439
|
searchModels(query: string): Promise<Model[]>;
|
|
331
440
|
/** Estimate cost for a request (without sending it) */
|
|
@@ -401,4 +510,4 @@ declare function createShieldedClient(config?: TCloudConfig & {
|
|
|
401
510
|
stopAutoReplenish: () => void;
|
|
402
511
|
};
|
|
403
512
|
|
|
404
|
-
export { type AutoReplenishOptions as A, type ChatCompletion as C, type EmbeddingOptions as E, type ImageGenerateOptions as I, type Model as M, type Operator as O, type PrivacyConfig as P, type RerankOptions as R, type ShieldedWallet as S, TCloudClient as T, type TCloudConfig as a, type
|
|
513
|
+
export { type AutoReplenishOptions as A, type BatchJobResponse as B, type ChatCompletion as C, type EmbeddingOptions as E, type FineTuningJob as F, type ImageGenerateOptions as I, type Model as M, type Operator as O, type PrivacyConfig as P, type RerankOptions as R, type ShieldedWallet as S, TCloudClient as T, type VideoGenerateOptions as V, type TCloudConfig as a, type BatchRequest as b, type ChatCompletionChunk as c, type ChatMessage as d, type ChatOptions as e, type CompletionOptions as f, generateWallet as g, type CompletionResponse as h, type CreditBalance as i, type EmbeddingResponse as j, type FineTuningJobOptions as k, type ImageResponse as l, type RerankResponse as m, type RoutingConfig as n, type ShieldedConfig as o, type SpendAuth as p, type SpendingLimits as q, TCloudError as r, type TranscriptionResponse as s, type VideoResponse as t, createShieldedClient as u, estimateCost as v, signSpendAuth as w };
|
|
@@ -38,6 +38,8 @@ interface SpendingLimits {
|
|
|
38
38
|
}) => void;
|
|
39
39
|
}
|
|
40
40
|
interface RoutingConfig {
|
|
41
|
+
/** Routing mode: 'operator' (Tangle operators only), 'provider' (direct APIs only), 'auto' (try operators, fall back to providers) */
|
|
42
|
+
mode?: 'operator' | 'provider' | 'auto';
|
|
41
43
|
/** Preferred operator slug or address */
|
|
42
44
|
prefer?: string;
|
|
43
45
|
/** Blueprint ID — route to operators under this Blueprint */
|
|
@@ -96,6 +98,91 @@ interface RerankResponse {
|
|
|
96
98
|
relevance_score: number;
|
|
97
99
|
}[];
|
|
98
100
|
}
|
|
101
|
+
interface CompletionOptions {
|
|
102
|
+
model?: string;
|
|
103
|
+
prompt: string;
|
|
104
|
+
temperature?: number;
|
|
105
|
+
maxTokens?: number;
|
|
106
|
+
stop?: string | string[];
|
|
107
|
+
topP?: number;
|
|
108
|
+
}
|
|
109
|
+
interface CompletionResponse {
|
|
110
|
+
id: string;
|
|
111
|
+
object: string;
|
|
112
|
+
created: number;
|
|
113
|
+
model: string;
|
|
114
|
+
choices: {
|
|
115
|
+
text: string;
|
|
116
|
+
index: number;
|
|
117
|
+
finish_reason: string;
|
|
118
|
+
}[];
|
|
119
|
+
usage?: {
|
|
120
|
+
prompt_tokens: number;
|
|
121
|
+
completion_tokens: number;
|
|
122
|
+
total_tokens: number;
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
interface TranscriptionResponse {
|
|
126
|
+
text: string;
|
|
127
|
+
}
|
|
128
|
+
interface FineTuningJobOptions {
|
|
129
|
+
model: string;
|
|
130
|
+
training_file: string;
|
|
131
|
+
hyperparameters?: {
|
|
132
|
+
n_epochs?: number | 'auto';
|
|
133
|
+
batch_size?: number | 'auto';
|
|
134
|
+
learning_rate_multiplier?: number | 'auto';
|
|
135
|
+
};
|
|
136
|
+
suffix?: string;
|
|
137
|
+
}
|
|
138
|
+
interface FineTuningJob {
|
|
139
|
+
id: string;
|
|
140
|
+
object: string;
|
|
141
|
+
model: string;
|
|
142
|
+
status: string;
|
|
143
|
+
created_at: number;
|
|
144
|
+
finished_at: number | null;
|
|
145
|
+
fine_tuned_model: string | null;
|
|
146
|
+
error: {
|
|
147
|
+
code: string;
|
|
148
|
+
message: string;
|
|
149
|
+
} | null;
|
|
150
|
+
}
|
|
151
|
+
interface BatchRequest {
|
|
152
|
+
model: string;
|
|
153
|
+
messages: ChatMessage[];
|
|
154
|
+
temperature?: number;
|
|
155
|
+
max_tokens?: number;
|
|
156
|
+
}
|
|
157
|
+
interface BatchJobResponse {
|
|
158
|
+
id: string;
|
|
159
|
+
status: 'pending' | 'processing' | 'completed' | 'failed';
|
|
160
|
+
total_items: number;
|
|
161
|
+
completed: number;
|
|
162
|
+
failed: number;
|
|
163
|
+
results: ({
|
|
164
|
+
status: 'fulfilled';
|
|
165
|
+
data: ChatCompletion;
|
|
166
|
+
} | {
|
|
167
|
+
status: 'rejected';
|
|
168
|
+
error: string;
|
|
169
|
+
})[] | null;
|
|
170
|
+
error: string | null;
|
|
171
|
+
created_at: string;
|
|
172
|
+
completed_at: string | null;
|
|
173
|
+
}
|
|
174
|
+
interface VideoGenerateOptions {
|
|
175
|
+
model?: string;
|
|
176
|
+
prompt: string;
|
|
177
|
+
duration?: number;
|
|
178
|
+
resolution?: string;
|
|
179
|
+
}
|
|
180
|
+
interface VideoResponse {
|
|
181
|
+
id: string;
|
|
182
|
+
status: string;
|
|
183
|
+
url?: string;
|
|
184
|
+
error?: string;
|
|
185
|
+
}
|
|
99
186
|
interface PrivacyConfig {
|
|
100
187
|
/** 'direct' — no proxy (default). 'relayer' — route through tcloud-relayer. 'socks5' — route through SOCKS5 proxy (e.g. Tor). */
|
|
101
188
|
mode: 'direct' | 'relayer' | 'socks5';
|
|
@@ -326,6 +413,28 @@ declare class TCloudClient {
|
|
|
326
413
|
input: string;
|
|
327
414
|
voice?: string;
|
|
328
415
|
}): Promise<ArrayBuffer>;
|
|
416
|
+
/** Legacy completions endpoint */
|
|
417
|
+
completions(options: CompletionOptions): Promise<CompletionResponse>;
|
|
418
|
+
/** Audio transcription (speech-to-text) */
|
|
419
|
+
transcribe(file: Blob, options?: {
|
|
420
|
+
model?: string;
|
|
421
|
+
language?: string;
|
|
422
|
+
prompt?: string;
|
|
423
|
+
}): Promise<TranscriptionResponse>;
|
|
424
|
+
/** Create a fine-tuning job */
|
|
425
|
+
fineTuneCreate(options: FineTuningJobOptions): Promise<FineTuningJob>;
|
|
426
|
+
/** List fine-tuning jobs */
|
|
427
|
+
fineTuneList(): Promise<{
|
|
428
|
+
data: FineTuningJob[];
|
|
429
|
+
}>;
|
|
430
|
+
/** Submit a batch of chat requests */
|
|
431
|
+
batch(requests: BatchRequest[]): Promise<BatchJobResponse>;
|
|
432
|
+
/** Get batch job status */
|
|
433
|
+
batchStatus(jobId: string): Promise<BatchJobResponse>;
|
|
434
|
+
/** Generate video */
|
|
435
|
+
videoGenerate(options: VideoGenerateOptions): Promise<VideoResponse>;
|
|
436
|
+
/** Get video generation status */
|
|
437
|
+
videoStatus(id: string): Promise<VideoResponse>;
|
|
329
438
|
/** Search models by name, provider, or capability */
|
|
330
439
|
searchModels(query: string): Promise<Model[]>;
|
|
331
440
|
/** Estimate cost for a request (without sending it) */
|
|
@@ -401,4 +510,4 @@ declare function createShieldedClient(config?: TCloudConfig & {
|
|
|
401
510
|
stopAutoReplenish: () => void;
|
|
402
511
|
};
|
|
403
512
|
|
|
404
|
-
export { type AutoReplenishOptions as A, type ChatCompletion as C, type EmbeddingOptions as E, type ImageGenerateOptions as I, type Model as M, type Operator as O, type PrivacyConfig as P, type RerankOptions as R, type ShieldedWallet as S, TCloudClient as T, type TCloudConfig as a, type
|
|
513
|
+
export { type AutoReplenishOptions as A, type BatchJobResponse as B, type ChatCompletion as C, type EmbeddingOptions as E, type FineTuningJob as F, type ImageGenerateOptions as I, type Model as M, type Operator as O, type PrivacyConfig as P, type RerankOptions as R, type ShieldedWallet as S, TCloudClient as T, type VideoGenerateOptions as V, type TCloudConfig as a, type BatchRequest as b, type ChatCompletionChunk as c, type ChatMessage as d, type ChatOptions as e, type CompletionOptions as f, generateWallet as g, type CompletionResponse as h, type CreditBalance as i, type EmbeddingResponse as j, type FineTuningJobOptions as k, type ImageResponse as l, type RerankResponse as m, type RoutingConfig as n, type ShieldedConfig as o, type SpendAuth as p, type SpendingLimits as q, TCloudError as r, type TranscriptionResponse as s, type VideoResponse as t, createShieldedClient as u, estimateCost as v, signSpendAuth as w };
|
package/dist/shielded.cjs
CHANGED
|
@@ -97,11 +97,14 @@ var TCloudClient = class {
|
|
|
97
97
|
this.limits = config.limits;
|
|
98
98
|
this.headers = {
|
|
99
99
|
"Content-Type": "application/json",
|
|
100
|
-
"X-Tangle-Client": "tcloud-sdk/0.1.
|
|
100
|
+
"X-Tangle-Client": "tcloud-sdk/0.1.4"
|
|
101
101
|
};
|
|
102
102
|
if (this.apiKey) {
|
|
103
103
|
this.headers["Authorization"] = `Bearer ${this.apiKey}`;
|
|
104
104
|
}
|
|
105
|
+
if (config.routing?.mode) {
|
|
106
|
+
this.headers["X-Tangle-Routing"] = config.routing.mode;
|
|
107
|
+
}
|
|
105
108
|
if (config.routing?.prefer) {
|
|
106
109
|
this.headers["X-Tangle-Operator"] = config.routing.prefer;
|
|
107
110
|
}
|
|
@@ -411,6 +414,113 @@ var TCloudClient = class {
|
|
|
411
414
|
this._requestCount++;
|
|
412
415
|
return res.arrayBuffer();
|
|
413
416
|
}
|
|
417
|
+
/** Legacy completions endpoint */
|
|
418
|
+
async completions(options) {
|
|
419
|
+
const res = await proxiedFetch(this.privacy, `${this.baseURL}/completions`, {
|
|
420
|
+
method: "POST",
|
|
421
|
+
headers: this.headers,
|
|
422
|
+
body: JSON.stringify({
|
|
423
|
+
model: options.model || this.model,
|
|
424
|
+
prompt: options.prompt,
|
|
425
|
+
temperature: options.temperature,
|
|
426
|
+
max_tokens: options.maxTokens,
|
|
427
|
+
stop: options.stop,
|
|
428
|
+
top_p: options.topP
|
|
429
|
+
})
|
|
430
|
+
}, false);
|
|
431
|
+
if (!res.ok) {
|
|
432
|
+
const err = await res.json().catch(() => ({ error: res.statusText }));
|
|
433
|
+
throw new TCloudError(res.status, err.error?.message || err.error || res.statusText);
|
|
434
|
+
}
|
|
435
|
+
this._requestCount++;
|
|
436
|
+
return res.json();
|
|
437
|
+
}
|
|
438
|
+
/** Audio transcription (speech-to-text) */
|
|
439
|
+
async transcribe(file, options) {
|
|
440
|
+
const formData = new FormData();
|
|
441
|
+
formData.append("file", file, "audio.webm");
|
|
442
|
+
formData.append("model", options?.model || "whisper-1");
|
|
443
|
+
if (options?.language) formData.append("language", options.language);
|
|
444
|
+
if (options?.prompt) formData.append("prompt", options.prompt);
|
|
445
|
+
const headers = { ...this.headers };
|
|
446
|
+
delete headers["Content-Type"];
|
|
447
|
+
const res = await proxiedFetch(this.privacy, `${this.baseURL}/audio/transcriptions`, {
|
|
448
|
+
method: "POST",
|
|
449
|
+
headers,
|
|
450
|
+
body: formData
|
|
451
|
+
}, false);
|
|
452
|
+
if (!res.ok) {
|
|
453
|
+
const err = await res.json().catch(() => ({ error: res.statusText }));
|
|
454
|
+
throw new TCloudError(res.status, err.error?.message || err.error || res.statusText);
|
|
455
|
+
}
|
|
456
|
+
this._requestCount++;
|
|
457
|
+
return res.json();
|
|
458
|
+
}
|
|
459
|
+
/** Create a fine-tuning job */
|
|
460
|
+
async fineTuneCreate(options) {
|
|
461
|
+
const res = await proxiedFetch(this.privacy, `${this.baseURL}/fine_tuning/jobs`, {
|
|
462
|
+
method: "POST",
|
|
463
|
+
headers: this.headers,
|
|
464
|
+
body: JSON.stringify(options)
|
|
465
|
+
}, false);
|
|
466
|
+
if (!res.ok) {
|
|
467
|
+
const err = await res.json().catch(() => ({ error: res.statusText }));
|
|
468
|
+
throw new TCloudError(res.status, err.error?.message || err.error || res.statusText);
|
|
469
|
+
}
|
|
470
|
+
this._requestCount++;
|
|
471
|
+
return res.json();
|
|
472
|
+
}
|
|
473
|
+
/** List fine-tuning jobs */
|
|
474
|
+
async fineTuneList() {
|
|
475
|
+
const res = await proxiedFetch(this.privacy, `${this.baseURL}/fine_tuning/jobs`, {
|
|
476
|
+
headers: this.headers
|
|
477
|
+
}, false);
|
|
478
|
+
if (!res.ok) throw new TCloudError(res.status, "Failed to fetch fine-tuning jobs");
|
|
479
|
+
return res.json();
|
|
480
|
+
}
|
|
481
|
+
/** Submit a batch of chat requests */
|
|
482
|
+
async batch(requests) {
|
|
483
|
+
const res = await proxiedFetch(this.privacy, `${this.baseURL}/batch`, {
|
|
484
|
+
method: "POST",
|
|
485
|
+
headers: this.headers,
|
|
486
|
+
body: JSON.stringify({ requests })
|
|
487
|
+
}, false);
|
|
488
|
+
if (!res.ok) {
|
|
489
|
+
const err = await res.json().catch(() => ({ error: res.statusText }));
|
|
490
|
+
throw new TCloudError(res.status, err.error?.message || err.error || res.statusText);
|
|
491
|
+
}
|
|
492
|
+
return res.json();
|
|
493
|
+
}
|
|
494
|
+
/** Get batch job status */
|
|
495
|
+
async batchStatus(jobId) {
|
|
496
|
+
const res = await proxiedFetch(this.privacy, `${this.baseURL}/batch?id=${jobId}`, {
|
|
497
|
+
headers: this.headers
|
|
498
|
+
}, false);
|
|
499
|
+
if (!res.ok) throw new TCloudError(res.status, "Failed to fetch batch status");
|
|
500
|
+
return res.json();
|
|
501
|
+
}
|
|
502
|
+
/** Generate video */
|
|
503
|
+
async videoGenerate(options) {
|
|
504
|
+
const res = await proxiedFetch(this.privacy, `${this.baseURL}/video/generate`, {
|
|
505
|
+
method: "POST",
|
|
506
|
+
headers: this.headers,
|
|
507
|
+
body: JSON.stringify(options)
|
|
508
|
+
}, false);
|
|
509
|
+
if (!res.ok) {
|
|
510
|
+
const err = await res.json().catch(() => ({ error: res.statusText }));
|
|
511
|
+
throw new TCloudError(res.status, err.error?.message || err.error || res.statusText);
|
|
512
|
+
}
|
|
513
|
+
this._requestCount++;
|
|
514
|
+
return res.json();
|
|
515
|
+
}
|
|
516
|
+
/** Get video generation status */
|
|
517
|
+
async videoStatus(id) {
|
|
518
|
+
const res = await proxiedFetch(this.privacy, `${this.baseURL}/video?id=${id}`, {
|
|
519
|
+
headers: this.headers
|
|
520
|
+
}, false);
|
|
521
|
+
if (!res.ok) throw new TCloudError(res.status, "Failed to fetch video status");
|
|
522
|
+
return res.json();
|
|
523
|
+
}
|
|
414
524
|
/** Search models by name, provider, or capability */
|
|
415
525
|
async searchModels(query) {
|
|
416
526
|
const all = await this.models();
|
package/dist/shielded.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import 'viem';
|
|
2
|
-
export { A as AutoReplenishOptions, S as ShieldedWallet,
|
|
2
|
+
export { A as AutoReplenishOptions, S as ShieldedWallet, p as SpendAuth, u as createShieldedClient, v as estimateCost, g as generateWallet, w as signSpendAuth } from './shielded-BTi_OftW.cjs';
|
package/dist/shielded.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import 'viem';
|
|
2
|
-
export { A as AutoReplenishOptions, S as ShieldedWallet,
|
|
2
|
+
export { A as AutoReplenishOptions, S as ShieldedWallet, p as SpendAuth, u as createShieldedClient, v as estimateCost, g as generateWallet, w as signSpendAuth } from './shielded-BTi_OftW.js';
|
package/dist/shielded.js
CHANGED