@qvac/sdk 0.17.0 → 0.18.0
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/NOTICE +83 -18
- package/README.md +19 -0
- package/dist/client/api/audio-gen.d.ts +17 -0
- package/dist/client/api/audio-gen.js +17 -0
- package/dist/client/api/finetune.d.ts +2 -0
- package/dist/client/api/finetune.js +7 -1
- package/dist/client/api/index.d.ts +1 -1
- package/dist/client/api/index.js +1 -1
- package/dist/client/api/load-model.d.ts +8 -0
- package/dist/client/api/transcribe.d.ts +19 -2
- package/dist/client/api/transcribe.js +66 -27
- package/dist/client/api/translate.d.ts +3 -2
- package/dist/client/api/translate.js +42 -21
- package/dist/client/api/vla.d.ts +42 -1
- package/dist/client/api/vla.js +50 -1
- package/dist/commands/bundle/entry-gen.d.ts +4 -0
- package/dist/commands/bundle/entry-gen.js +6 -0
- package/dist/commands/bundle/index.js +19 -12
- package/dist/examples/asr/parakeet-indic-conformer-filesystem.d.ts +2 -0
- package/dist/examples/asr/parakeet-indic-conformer-filesystem.js +52 -0
- package/dist/examples/audiogen/generate-cover.d.ts +2 -0
- package/dist/examples/audiogen/generate-cover.js +100 -0
- package/dist/examples/llamacpp-fallback.d.ts +2 -0
- package/dist/examples/llamacpp-fallback.js +34 -0
- package/dist/examples/multi-job-completion.d.ts +28 -0
- package/dist/examples/multi-job-completion.js +128 -0
- package/dist/examples/profiling/basic.js +32 -1
- package/dist/examples/system-resources.d.ts +2 -0
- package/dist/examples/system-resources.js +86 -0
- package/dist/examples/tts/audio8.d.ts +2 -0
- package/dist/examples/tts/audio8.js +54 -0
- package/dist/examples/tts/cosyvoice3.d.ts +2 -0
- package/dist/examples/tts/cosyvoice3.js +52 -0
- package/dist/examples/vla-groot.js +92 -49
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/models/registry/models.d.ts +782 -6
- package/dist/models/registry/models.js +2664 -1859
- package/dist/schemas/audio-gen.d.ts +103 -0
- package/dist/schemas/audio-gen.js +135 -4
- package/dist/schemas/common.d.ts +550 -11
- package/dist/schemas/constants-registry.d.ts +18 -4
- package/dist/schemas/constants-registry.js +16 -3
- package/dist/schemas/index.d.ts +1 -1
- package/dist/schemas/index.js +1 -1
- package/dist/schemas/llamacpp-config.d.ts +10 -10
- package/dist/schemas/llamacpp-config.js +12 -5
- package/dist/schemas/load-model.d.ts +3678 -323
- package/dist/schemas/load-model.js +21 -3
- package/dist/schemas/sdk-config.d.ts +60 -24
- package/dist/schemas/sdk-errors-server.d.ts +1 -0
- package/dist/schemas/sdk-errors-server.js +5 -0
- package/dist/schemas/text-to-speech.d.ts +1086 -110
- package/dist/schemas/text-to-speech.js +194 -4
- package/dist/schemas/tools.d.ts +0 -16
- package/dist/schemas/tools.js +0 -15
- package/dist/schemas/transcription-config.d.ts +2 -0
- package/dist/schemas/transcription-config.js +10 -4
- package/dist/schemas/transcription.d.ts +3 -0
- package/dist/schemas/vla.d.ts +83 -0
- package/dist/schemas/vla.js +105 -2
- package/dist/scripts/link-workspace-inference.d.ts +2 -0
- package/dist/scripts/link-workspace-inference.js +31 -0
- package/dist/server/bare/ops/cancel.d.ts +1 -1
- package/dist/server/bare/ops/cancel.js +1 -1
- package/dist/server/bare/ops/kv-cache-retention.js +11 -0
- package/dist/server/bare/ops/kv-cache-utils.d.ts +1 -1
- package/dist/server/bare/ops/kv-cache-utils.js +40 -12
- package/dist/server/bare/ops/transcribe.d.ts +2 -2
- package/dist/server/bare/ops/transcribe.js +54 -48
- package/dist/server/bare/ops/translate-stats.d.ts +5 -0
- package/dist/server/bare/ops/translate-stats.js +11 -0
- package/dist/server/bare/ops/translate.js +66 -38
- package/dist/server/bare/ops/unload-model.js +30 -24
- package/dist/server/bare/plugins/audiogen-ggml/ops/audio-gen-input.d.ts +20 -0
- package/dist/server/bare/plugins/audiogen-ggml/ops/audio-gen-input.js +153 -0
- package/dist/server/bare/plugins/audiogen-ggml/ops/audio-gen-stream.js +52 -1
- package/dist/server/bare/plugins/audiogen-ggml/plugin.d.ts +28 -0
- package/dist/server/bare/plugins/ggml-ocr/plugin.js +3 -1
- package/dist/server/bare/plugins/ggml-vla/ops/vla-set-embodiment.d.ts +3 -0
- package/dist/server/bare/plugins/ggml-vla/ops/vla-set-embodiment.js +9 -0
- package/dist/server/bare/plugins/ggml-vla/plugin.d.ts +37 -0
- package/dist/server/bare/plugins/ggml-vla/plugin.js +21 -4
- package/dist/server/bare/plugins/llamacpp-completion/ops/batch-completion-stream.js +16 -15
- package/dist/server/bare/plugins/llamacpp-completion/ops/cache-logger.d.ts +1 -1
- package/dist/server/bare/plugins/llamacpp-completion/ops/cache-logger.js +2 -2
- package/dist/server/bare/plugins/llamacpp-completion/ops/completion-stats.d.ts +6 -0
- package/dist/server/bare/plugins/llamacpp-completion/ops/completion-stats.js +10 -0
- package/dist/server/bare/plugins/llamacpp-completion/ops/completion-stream.d.ts +1 -0
- package/dist/server/bare/plugins/llamacpp-completion/ops/completion-stream.js +131 -123
- package/dist/server/bare/plugins/llamacpp-completion/ops/finetune.js +110 -20
- package/dist/server/bare/plugins/llamacpp-completion/ops/kv-cache-session.d.ts +49 -23
- package/dist/server/bare/plugins/llamacpp-completion/ops/kv-cache-session.js +308 -143
- package/dist/server/bare/plugins/llamacpp-completion/ops/kv-cache-state.d.ts +1 -0
- package/dist/server/bare/plugins/llamacpp-completion/ops/kv-cache-state.js +2 -2
- package/dist/server/bare/plugins/llamacpp-completion/plugin.d.ts +6 -6
- package/dist/server/bare/plugins/llamacpp-completion/plugin.js +55 -36
- package/dist/server/bare/plugins/llamacpp-completion/transform.js +1 -7
- package/dist/server/bare/plugins/llamacpp-embedding/plugin.js +2 -3
- package/dist/server/bare/plugins/nmtcpp-translation/plugin.js +6 -5
- package/dist/server/bare/plugins/parakeet-transcription/plugin.js +27 -16
- package/dist/server/bare/plugins/tts-ggml/ops/parler-options.js +23 -3
- package/dist/server/bare/plugins/tts-ggml/plugin.d.ts +302 -4
- package/dist/server/bare/plugins/tts-ggml/plugin.js +131 -0
- package/dist/server/bare/plugins/whispercpp-transcription/plugin.js +48 -39
- package/dist/server/bare/registry/model-registry.d.ts +1 -0
- package/dist/server/bare/runtime/request-registry-singleton.js +29 -15
- package/dist/server/bare/runtime/request-registry.d.ts +27 -0
- package/dist/server/bare/runtime/request-registry.js +246 -76
- package/dist/server/bare/types/addon-responses.d.ts +4 -12
- package/dist/server/rpc/handlers/load-model/handler.js +2 -2
- package/dist/server/rpc/handlers/load-model/resolve-session.d.ts +1 -1
- package/dist/server/rpc/handlers/load-model/resolve-session.js +3 -3
- package/dist/server/rpc/handlers/load-model/resolve.d.ts +12 -2
- package/dist/server/rpc/handlers/load-model/resolve.js +90 -12
- package/dist/server/utils/audio/decoder.d.ts +37 -1
- package/dist/server/utils/audio/decoder.js +81 -51
- package/dist/server/utils/config-transform.d.ts +3 -0
- package/dist/server/utils/config-transform.js +6 -0
- package/dist/server/utils/index.d.ts +0 -1
- package/dist/server/utils/index.js +0 -1
- package/dist/server/utils/shard-utils.d.ts +1 -0
- package/dist/server/utils/shard-utils.js +14 -0
- package/dist/server/utils/tool-integration.d.ts +3 -10
- package/dist/server/utils/tool-integration.js +3 -12
- package/dist/utils/errors-server.d.ts +3 -0
- package/dist/utils/errors-server.js +5 -0
- package/package.json +12 -14
- package/dist/examples/llamacpp-dynamic-tools.d.ts +0 -2
- package/dist/examples/llamacpp-dynamic-tools.js +0 -152
- package/dist/models/update-models/codegen.d.ts +0 -3
- package/dist/models/update-models/codegen.js +0 -196
- package/dist/models/update-models/companions.d.ts +0 -30
- package/dist/models/update-models/companions.js +0 -296
- package/dist/models/update-models/history.d.ts +0 -24
- package/dist/models/update-models/history.js +0 -107
- package/dist/models/update-models/index.d.ts +0 -2
- package/dist/models/update-models/index.js +0 -123
- package/dist/models/update-models/naming.d.ts +0 -4
- package/dist/models/update-models/naming.js +0 -396
- package/dist/models/update-models/processing.d.ts +0 -8
- package/dist/models/update-models/processing.js +0 -65
- package/dist/models/update-models/registry.d.ts +0 -5
- package/dist/models/update-models/registry.js +0 -87
- package/dist/models/update-models/shards.d.ts +0 -4
- package/dist/models/update-models/shards.js +0 -57
- package/dist/models/update-models/types.d.ts +0 -88
- package/dist/models/update-models/types.js +0 -1
- package/dist/models/update-models/utils.d.ts +0 -3
- package/dist/models/update-models/utils.js +0 -21
- package/dist/server/bare/plugins/llamacpp-completion/ops/batch-cancelled.d.ts +0 -23
- package/dist/server/bare/plugins/llamacpp-completion/ops/batch-cancelled.js +0 -30
- package/dist/server/utils/expand-gguf-shards.d.ts +0 -3
- package/dist/server/utils/expand-gguf-shards.js +0 -22
package/NOTICE
CHANGED
|
@@ -63,14 +63,24 @@ Third-Party Model Licenses
|
|
|
63
63
|
|
|
64
64
|
abot-world-0-5b-lf-dit-q8_0
|
|
65
65
|
https://huggingface.co/acvlab/ABot-World-0-5B-LF
|
|
66
|
+
audio8-codec-decoder-f16
|
|
67
|
+
https://huggingface.co/Audio8/Audio8-TTS-Preview-0.6b
|
|
68
|
+
audio8-codec-encoder-f16
|
|
69
|
+
https://huggingface.co/Audio8/Audio8-TTS-Preview-0.6b
|
|
70
|
+
audio8-lm-f16
|
|
71
|
+
https://huggingface.co/Audio8/Audio8-TTS-Preview-0.6b
|
|
66
72
|
bci-embedder
|
|
67
73
|
https://github.com/tetherto/qvac/releases/download/bci-test-assets-v0.1.0/bci-embedder.bin
|
|
74
|
+
cosyvoice3-campplus-f32
|
|
75
|
+
https://huggingface.co/FunAudioLLM/Fun-CosyVoice3-0.5B-2512
|
|
68
76
|
cosyvoice3-flow-f32
|
|
69
77
|
https://huggingface.co/FunAudioLLM/Fun-CosyVoice3-0.5B-2512
|
|
70
78
|
cosyvoice3-hift-f32
|
|
71
79
|
https://huggingface.co/FunAudioLLM/Fun-CosyVoice3-0.5B-2512
|
|
72
80
|
cosyvoice3-llm-q8_0
|
|
73
81
|
https://huggingface.co/FunAudioLLM/Fun-CosyVoice3-0.5B-2512
|
|
82
|
+
cosyvoice3-s3tok-f16
|
|
83
|
+
https://huggingface.co/FunAudioLLM/Fun-CosyVoice3-0.5B-2512
|
|
74
84
|
craft_mlt_25k
|
|
75
85
|
https://www.jaided.ai/easyocr/modelhub/
|
|
76
86
|
crnn_mobilenet_v3_small
|
|
@@ -179,6 +189,8 @@ Third-Party Model Licenses
|
|
|
179
189
|
https://huggingface.co/unsloth/Qwen3.6-27B-GGUF
|
|
180
190
|
Qwen3.6-35B-A3B-GGUF
|
|
181
191
|
https://huggingface.co/unsloth/Qwen3.6-35B-A3B-GGUF
|
|
192
|
+
Qwen3.8-27B-GGUF
|
|
193
|
+
https://huggingface.co/unsloth/Qwen3.8-27B-GGUF
|
|
182
194
|
ru-base-ggml-model-f16
|
|
183
195
|
https://huggingface.co/CheeLi03/whisper-base-rus-8
|
|
184
196
|
ru-tiny-ggml-model-f16
|
|
@@ -199,6 +211,10 @@ Third-Party Model Licenses
|
|
|
199
211
|
https://huggingface.co/Comfy-Org/Wan_2.1_ComfyUI_repackaged
|
|
200
212
|
unlimited-ocr-gguf
|
|
201
213
|
https://huggingface.co/vimalnakrani/unlimited-ocr-gguf
|
|
214
|
+
VisionPsy-Nano-460M-Flash-GGUFs
|
|
215
|
+
https://huggingface.co/qvac/VisionPsy-Nano-460M-Flash-GGUFs
|
|
216
|
+
VisionPsy-Nano-460M-GGUFs
|
|
217
|
+
https://huggingface.co/qvac/VisionPsy-Nano-460M-GGUFs
|
|
202
218
|
voice-en
|
|
203
219
|
https://huggingface.co/FunAudioLLM/Fun-CosyVoice3-0.5B-2512
|
|
204
220
|
voice-zh-2
|
|
@@ -348,6 +364,12 @@ Third-Party Model Licenses
|
|
|
348
364
|
https://huggingface.co/ChristianAzinn/gte-large-gguf
|
|
349
365
|
gte-large-gguf
|
|
350
366
|
https://huggingface.co/ChristianAzinn/gte-large-gguf
|
|
367
|
+
indic-conformer-ctc.f16
|
|
368
|
+
https://huggingface.co/ai4bharat/indic-conformer
|
|
369
|
+
indic-conformer-ctc.q4_0
|
|
370
|
+
https://huggingface.co/ai4bharat/indic-conformer
|
|
371
|
+
indic-conformer-ctc.q8_0
|
|
372
|
+
https://huggingface.co/ai4bharat/indic-conformer
|
|
351
373
|
lavasr-denoiser-f16
|
|
352
374
|
https://huggingface.co/spaces/YatharthS
|
|
353
375
|
lavasr-enhancer-f16
|
|
@@ -632,13 +654,13 @@ JavaScript Dependencies
|
|
|
632
654
|
|
|
633
655
|
@hyperswarm/secret-stream@6.9.1
|
|
634
656
|
https://github.com/holepunchto/hyperswarm-secret-stream
|
|
635
|
-
@qvac/asr-ggml@0.
|
|
657
|
+
@qvac/asr-ggml@0.3.2
|
|
636
658
|
https://github.com/tetherto/qvac
|
|
637
|
-
@qvac/audiogen-ggml@0.
|
|
659
|
+
@qvac/audiogen-ggml@0.2.3
|
|
638
660
|
https://github.com/tetherto/qvac
|
|
639
|
-
@qvac/bci-whispercpp@0.
|
|
661
|
+
@qvac/bci-whispercpp@0.7.2
|
|
640
662
|
https://github.com/tetherto/qvac
|
|
641
|
-
@qvac/classification-ggml@0.
|
|
663
|
+
@qvac/classification-ggml@0.20.0
|
|
642
664
|
https://github.com/tetherto/qvac
|
|
643
665
|
@qvac/decoder-audio@0.5.0
|
|
644
666
|
https://github.com/tetherto/qvac
|
|
@@ -646,23 +668,21 @@ JavaScript Dependencies
|
|
|
646
668
|
https://github.com/tetherto/qvac
|
|
647
669
|
@qvac/diffusion-cpp@0.17.0
|
|
648
670
|
https://github.com/tetherto/qvac
|
|
649
|
-
@qvac/embed-llamacpp@0.
|
|
671
|
+
@qvac/embed-llamacpp@0.34.0
|
|
650
672
|
https://github.com/tetherto/qvac
|
|
651
673
|
@qvac/error@0.1.1
|
|
652
|
-
@qvac/fabric@0.
|
|
674
|
+
@qvac/fabric@0.6.0
|
|
653
675
|
https://github.com/tetherto/qvac
|
|
654
676
|
@qvac/infer-base@0.4.2
|
|
655
677
|
https://github.com/tetherto/qvac
|
|
656
|
-
@qvac/infer-base@0.6.1
|
|
657
|
-
https://github.com/tetherto/qvac
|
|
658
678
|
@qvac/infer-base@0.6.2
|
|
659
679
|
https://github.com/tetherto/qvac
|
|
660
680
|
@qvac/langdetect-text@0.1.2
|
|
661
681
|
https://github.com/tetherto/qvac
|
|
662
|
-
@qvac/llm-llamacpp@0.
|
|
682
|
+
@qvac/llm-llamacpp@0.45.0
|
|
663
683
|
https://github.com/tetherto/qvac
|
|
664
684
|
@qvac/logging@0.1.0
|
|
665
|
-
@qvac/ocr-ggml@0.
|
|
685
|
+
@qvac/ocr-ggml@0.18.0
|
|
666
686
|
https://github.com/tetherto/qvac
|
|
667
687
|
@qvac/rag@0.6.4
|
|
668
688
|
https://github.com/tetherto/qvac
|
|
@@ -670,11 +690,11 @@ JavaScript Dependencies
|
|
|
670
690
|
https://github.com/tetherto/qvac
|
|
671
691
|
@qvac/registry-schema@0.3.0
|
|
672
692
|
https://github.com/tetherto/qvac
|
|
673
|
-
@qvac/translation-nmtcpp@
|
|
693
|
+
@qvac/translation-nmtcpp@0.10.0
|
|
674
694
|
https://github.com/tetherto/qvac
|
|
675
|
-
@qvac/tts-ggml@0.
|
|
695
|
+
@qvac/tts-ggml@0.7.4
|
|
676
696
|
https://github.com/tetherto/qvac
|
|
677
|
-
@qvac/vla-ggml@0.
|
|
697
|
+
@qvac/vla-ggml@0.21.1
|
|
678
698
|
https://github.com/tetherto/qvac
|
|
679
699
|
adaptive-timeout@1.0.1
|
|
680
700
|
https://github.com/holepunchto/adaptive-timeout
|
|
@@ -696,12 +716,18 @@ JavaScript Dependencies
|
|
|
696
716
|
https://github.com/holepunchto/bare-bundle
|
|
697
717
|
bare-bundle-id@1.0.2
|
|
698
718
|
https://github.com/holepunchto/bare-bundle-id
|
|
719
|
+
bare-cov@1.2.2
|
|
720
|
+
https://github.com/holepunchto/bare-cov
|
|
699
721
|
bare-cpu-info@0.1.1
|
|
700
722
|
https://github.com/holepunchto/bare-cpu-info
|
|
701
723
|
bare-crypto@1.15.3
|
|
702
724
|
https://github.com/holepunchto/bare-crypto
|
|
725
|
+
bare-debug-log@2.0.0
|
|
726
|
+
https://github.com/holepunchto/bare-debug-log
|
|
703
727
|
bare-dns@2.1.4
|
|
704
728
|
https://github.com/holepunchto/bare-dns
|
|
729
|
+
bare-encoding@1.0.3
|
|
730
|
+
https://github.com/holepunchto/bare-encoding
|
|
705
731
|
bare-env@3.0.0
|
|
706
732
|
https://github.com/holepunchto/bare-env
|
|
707
733
|
bare-events@2.9.1
|
|
@@ -712,6 +738,8 @@ JavaScript Dependencies
|
|
|
712
738
|
https://github.com/holepunchto/bare-ffmpeg
|
|
713
739
|
bare-form-data@1.2.2
|
|
714
740
|
https://github.com/holepunchto/bare-form-data
|
|
741
|
+
bare-format@1.0.2
|
|
742
|
+
https://github.com/holepunchto/bare-format
|
|
715
743
|
bare-fs@4.7.2
|
|
716
744
|
https://github.com/holepunchto/bare-fs
|
|
717
745
|
bare-gpu-info@0.1.1
|
|
@@ -726,12 +754,12 @@ JavaScript Dependencies
|
|
|
726
754
|
https://github.com/holepunchto/bare-https
|
|
727
755
|
bare-inspect@3.1.4
|
|
728
756
|
https://github.com/holepunchto/bare-inspect
|
|
729
|
-
bare-
|
|
730
|
-
https://github.com/holepunchto/bare-
|
|
731
|
-
bare-link@3.2.2
|
|
732
|
-
https://github.com/holepunchto/bare-link
|
|
757
|
+
bare-inspector@6.0.2
|
|
758
|
+
https://github.com/holepunchto/bare-inspector
|
|
733
759
|
bare-mime@1.0.0
|
|
734
760
|
https://github.com/holepunchto/bare-mime
|
|
761
|
+
bare-module@6.2.1
|
|
762
|
+
https://github.com/holepunchto/bare-module
|
|
735
763
|
bare-module-lexer@1.5.2
|
|
736
764
|
https://github.com/holepunchto/bare-module-lexer
|
|
737
765
|
bare-module-resolve@1.12.2
|
|
@@ -740,7 +768,7 @@ JavaScript Dependencies
|
|
|
740
768
|
https://github.com/holepunchto/bare-module-traverse
|
|
741
769
|
bare-net@2.3.2
|
|
742
770
|
https://github.com/holepunchto/bare-net
|
|
743
|
-
bare-os@3.9.
|
|
771
|
+
bare-os@3.9.3
|
|
744
772
|
https://github.com/holepunchto/bare-os
|
|
745
773
|
bare-pack@2.1.3
|
|
746
774
|
https://github.com/holepunchto/bare-pack
|
|
@@ -766,6 +794,10 @@ JavaScript Dependencies
|
|
|
766
794
|
https://github.com/holepunchto/bare-stream
|
|
767
795
|
bare-structured-clone@1.5.5
|
|
768
796
|
https://github.com/holepunchto/bare-structured-clone
|
|
797
|
+
bare-stylize@0.0.1
|
|
798
|
+
https://github.com/holepunchto/bare-stylize
|
|
799
|
+
bare-subprocess@5.2.3
|
|
800
|
+
https://github.com/holepunchto/bare-subprocess
|
|
769
801
|
bare-subprocess@6.1.0
|
|
770
802
|
https://github.com/holepunchto/bare-subprocess
|
|
771
803
|
bare-tcp@2.5.1
|
|
@@ -778,10 +810,17 @@ JavaScript Dependencies
|
|
|
778
810
|
https://github.com/holepunchto/bare-type
|
|
779
811
|
bare-url@2.4.5
|
|
780
812
|
https://github.com/holepunchto/bare-url
|
|
813
|
+
bare-utils@1.6.0
|
|
814
|
+
https://github.com/holepunchto/bare-utils
|
|
815
|
+
bare-v8-to-istanbul@1.0.2
|
|
816
|
+
bare-ws@3.0.0
|
|
817
|
+
https://github.com/holepunchto/bare-ws
|
|
781
818
|
bare-zlib@1.4.0
|
|
782
819
|
https://github.com/holepunchto/bare-zlib
|
|
783
820
|
blind-relay@1.6.1
|
|
784
821
|
https://github.com/holepunchto/blind-relay
|
|
822
|
+
brittle@3.19.1
|
|
823
|
+
https://github.com/holepunchto/brittle
|
|
785
824
|
compact-encoding@3.2.0
|
|
786
825
|
https://github.com/holepunchto/compact-encoding
|
|
787
826
|
compact-encoding-bitfield@1.1.0
|
|
@@ -796,6 +835,8 @@ JavaScript Dependencies
|
|
|
796
835
|
https://github.com/holepunchto/fd-lock
|
|
797
836
|
fs-native-extensions@1.5.0
|
|
798
837
|
https://github.com/holepunchto/fs-native-extensions
|
|
838
|
+
globbie@1.0.3
|
|
839
|
+
https://github.com/holepunchto/globbie
|
|
799
840
|
hyperblobs@2.12.1
|
|
800
841
|
https://github.com/holepunchto/hyperblobs
|
|
801
842
|
hypercore-errors@1.5.0
|
|
@@ -877,9 +918,21 @@ JavaScript Dependencies
|
|
|
877
918
|
https://github.com/npm/node-semver
|
|
878
919
|
simdle-universal@1.1.2
|
|
879
920
|
https://github.com/holepunchto/simdle-universal
|
|
921
|
+
tmatch@5.0.0
|
|
922
|
+
https://github.com/isaacs/tmatch
|
|
923
|
+
v8-to-istanbul@9.3.0
|
|
924
|
+
https://github.com/istanbuljs/v8-to-istanbul
|
|
880
925
|
|
|
881
926
|
--- mit (MIT License) ---
|
|
882
927
|
|
|
928
|
+
@jridgewell/resolve-uri@3.1.2
|
|
929
|
+
https://github.com/jridgewell/resolve-uri
|
|
930
|
+
@jridgewell/sourcemap-codec@1.5.5
|
|
931
|
+
https://github.com/jridgewell/sourcemaps
|
|
932
|
+
@jridgewell/trace-mapping@0.3.31
|
|
933
|
+
https://github.com/jridgewell/sourcemaps
|
|
934
|
+
@types/istanbul-lib-coverage@2.0.6
|
|
935
|
+
https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
883
936
|
big-sparse-array@1.0.3
|
|
884
937
|
https://github.com/mafintosh/big-sparse-array
|
|
885
938
|
binary-stream-equals@1.0.0
|
|
@@ -888,12 +941,16 @@ JavaScript Dependencies
|
|
|
888
941
|
https://github.com/mafintosh/bogon
|
|
889
942
|
codecs@3.1.0
|
|
890
943
|
https://github.com/mafintosh/codecs
|
|
944
|
+
convert-source-map@2.0.0
|
|
945
|
+
https://github.com/thlorenz/convert-source-map
|
|
891
946
|
corestore@7.10.1
|
|
892
947
|
https://github.com/holepunchto/corestore
|
|
893
948
|
debounceify@1.1.0
|
|
894
949
|
https://github.com/mafintosh/debounceify
|
|
895
950
|
dht-rpc@6.27.0
|
|
896
951
|
https://github.com/holepunchto/dht-rpc
|
|
952
|
+
error-stack-parser@2.1.4
|
|
953
|
+
https://github.com/stacktracejs/error-stack-parser
|
|
897
954
|
fast-fifo@1.3.2
|
|
898
955
|
https://github.com/mafintosh/fast-fifo
|
|
899
956
|
fast-safe-stringify@2.1.1
|
|
@@ -926,6 +983,8 @@ JavaScript Dependencies
|
|
|
926
983
|
https://github.com/mafintosh/mutexify
|
|
927
984
|
nat-sampler@1.0.1
|
|
928
985
|
https://github.com/mafintosh/nat-sampler
|
|
986
|
+
picomatch@4.0.4
|
|
987
|
+
https://github.com/micromatch/picomatch
|
|
929
988
|
promaphore@1.0.0
|
|
930
989
|
https://github.com/mafintosh/promaphore
|
|
931
990
|
protocol-buffers-encodings@1.2.0
|
|
@@ -946,6 +1005,8 @@ JavaScript Dependencies
|
|
|
946
1005
|
https://github.com/mafintosh/safety-catch
|
|
947
1006
|
same-data@1.0.0
|
|
948
1007
|
https://github.com/mafintosh/same-data
|
|
1008
|
+
same-object@1.0.2
|
|
1009
|
+
https://github.com/holepunchto/same-object
|
|
949
1010
|
shuffled-priority-queue@2.1.0
|
|
950
1011
|
https://github.com/mafintosh/shuffled-priority-queue
|
|
951
1012
|
signal-promise@1.0.3
|
|
@@ -960,12 +1021,16 @@ JavaScript Dependencies
|
|
|
960
1021
|
https://github.com/holepunchto/sodium-universal
|
|
961
1022
|
speedometer@1.1.0
|
|
962
1023
|
https://github.com/mafintosh/speedometer
|
|
1024
|
+
stackframe@1.3.4
|
|
1025
|
+
https://github.com/stacktracejs/stackframe
|
|
963
1026
|
streamx@2.28.0
|
|
964
1027
|
https://github.com/mafintosh/streamx
|
|
965
1028
|
tar-stream@3.2.0
|
|
966
1029
|
https://github.com/mafintosh/tar-stream
|
|
967
1030
|
teex@1.0.1
|
|
968
1031
|
https://github.com/mafintosh/teex
|
|
1032
|
+
test-tmp@1.4.0
|
|
1033
|
+
https://github.com/mafintosh/test-tmp
|
|
969
1034
|
time-ordered-set@2.0.1
|
|
970
1035
|
https://github.com/mafintosh/time-ordered-set
|
|
971
1036
|
timeout-refresh@2.0.1
|
package/README.md
CHANGED
|
@@ -140,6 +140,25 @@ sampling. Enabling gauges adds one CPU query and one query per GPU to each
|
|
|
140
140
|
profiled operation's response path. If the worker resource collector is not
|
|
141
141
|
initialized, the event omits the resource block.
|
|
142
142
|
|
|
143
|
+
## Streaming transcription statistics
|
|
144
|
+
|
|
145
|
+
Whisper and Parakeet duplex transcription sessions expose terminal engine
|
|
146
|
+
statistics after their event iterator completes:
|
|
147
|
+
|
|
148
|
+
```ts
|
|
149
|
+
const session = await transcribeStream({ modelId })
|
|
150
|
+
|
|
151
|
+
for await (const text of session) {
|
|
152
|
+
process.stdout.write(text)
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
const stats = await session.stats
|
|
156
|
+
console.log(stats?.audioDuration, stats?.realTimeFactor)
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
`session.stats` resolves to `undefined` when the engine does not report
|
|
160
|
+
statistics.
|
|
161
|
+
|
|
143
162
|
## Examples
|
|
144
163
|
|
|
145
164
|
In the `./examples` subdirectory, you will find scripts demonstrating how to use all SDK functionalities. To try any of them:
|
|
@@ -3,6 +3,13 @@ import type { AudioGenClientParams, AudioGenResult } from '../../schemas/audio-g
|
|
|
3
3
|
* Generates PCM audio using a loaded AudioGen model.
|
|
4
4
|
*
|
|
5
5
|
* @param params - Loaded model ID, required caption, and optional lyrics, musical controls, duration, and seed.
|
|
6
|
+
* @param params.referenceAudio - Optional timbre reference: a file path (decoded server-side)
|
|
7
|
+
* or raw interleaved stereo 48 kHz Float32 LE PCM bytes.
|
|
8
|
+
* @param params.sourceAudio - Source audio to re-render (same forms as `referenceAudio`);
|
|
9
|
+
* required when `taskType` is `"cover-nofsq"`.
|
|
10
|
+
* @param params.taskType - `"text2music"` (default) or `"cover-nofsq"`.
|
|
11
|
+
* @param params.audioCoverStrength - Source-context strength for cover tasks (0..1).
|
|
12
|
+
* @param params.coverNoiseStrength - Initial source/noise blend for cover tasks (0..1).
|
|
6
13
|
* @returns A run with a synchronous request ID, generation progress stream, PCM audio promise, and stats promise.
|
|
7
14
|
*
|
|
8
15
|
* @example
|
|
@@ -23,6 +30,16 @@ import type { AudioGenClientParams, AudioGenResult } from '../../schemas/audio-g
|
|
|
23
30
|
* }
|
|
24
31
|
* const { pcm, sampleRate, channels, bitsPerSample } = await run.audio;
|
|
25
32
|
* const stats = await run.stats;
|
|
33
|
+
*
|
|
34
|
+
* // Re-render an existing song with a new caption (cover) and a timbre reference:
|
|
35
|
+
* const cover = audioGen({
|
|
36
|
+
* modelId,
|
|
37
|
+
* caption: "orchestral arrangement with dramatic strings",
|
|
38
|
+
* taskType: "cover-nofsq",
|
|
39
|
+
* sourceAudio: "/path/to/source.wav",
|
|
40
|
+
* referenceAudio: "/path/to/reference.mp3",
|
|
41
|
+
* coverNoiseStrength: 0.75,
|
|
42
|
+
* });
|
|
26
43
|
* ```
|
|
27
44
|
*/
|
|
28
45
|
export declare function audioGen(params: AudioGenClientParams): AudioGenResult;
|
|
@@ -4,6 +4,13 @@ import { createAudioGenResult } from '../../client/api/audio-gen-result.js';
|
|
|
4
4
|
* Generates PCM audio using a loaded AudioGen model.
|
|
5
5
|
*
|
|
6
6
|
* @param params - Loaded model ID, required caption, and optional lyrics, musical controls, duration, and seed.
|
|
7
|
+
* @param params.referenceAudio - Optional timbre reference: a file path (decoded server-side)
|
|
8
|
+
* or raw interleaved stereo 48 kHz Float32 LE PCM bytes.
|
|
9
|
+
* @param params.sourceAudio - Source audio to re-render (same forms as `referenceAudio`);
|
|
10
|
+
* required when `taskType` is `"cover-nofsq"`.
|
|
11
|
+
* @param params.taskType - `"text2music"` (default) or `"cover-nofsq"`.
|
|
12
|
+
* @param params.audioCoverStrength - Source-context strength for cover tasks (0..1).
|
|
13
|
+
* @param params.coverNoiseStrength - Initial source/noise blend for cover tasks (0..1).
|
|
7
14
|
* @returns A run with a synchronous request ID, generation progress stream, PCM audio promise, and stats promise.
|
|
8
15
|
*
|
|
9
16
|
* @example
|
|
@@ -24,6 +31,16 @@ import { createAudioGenResult } from '../../client/api/audio-gen-result.js';
|
|
|
24
31
|
* }
|
|
25
32
|
* const { pcm, sampleRate, channels, bitsPerSample } = await run.audio;
|
|
26
33
|
* const stats = await run.stats;
|
|
34
|
+
*
|
|
35
|
+
* // Re-render an existing song with a new caption (cover) and a timbre reference:
|
|
36
|
+
* const cover = audioGen({
|
|
37
|
+
* modelId,
|
|
38
|
+
* caption: "orchestral arrangement with dramatic strings",
|
|
39
|
+
* taskType: "cover-nofsq",
|
|
40
|
+
* sourceAudio: "/path/to/source.wav",
|
|
41
|
+
* referenceAudio: "/path/to/reference.mp3",
|
|
42
|
+
* coverNoiseStrength: 0.75,
|
|
43
|
+
* });
|
|
27
44
|
* ```
|
|
28
45
|
*/
|
|
29
46
|
export function audioGen(params) {
|
|
@@ -2,6 +2,8 @@ import { type FinetuneGetStateParams, type FinetuneProgress, type FinetuneResult
|
|
|
2
2
|
export interface FinetuneHandle {
|
|
3
3
|
progressStream: AsyncGenerator<FinetuneProgress>;
|
|
4
4
|
result: Promise<FinetuneResult>;
|
|
5
|
+
/** Stable id for this run; pass to `cancel({ requestId })` to stop it. */
|
|
6
|
+
requestId: string;
|
|
5
7
|
}
|
|
6
8
|
type FinetuneReplyParams = FinetuneStopParams | FinetuneGetStateParams;
|
|
7
9
|
/**
|
|
@@ -2,6 +2,7 @@ import { send, stream as streamRpc } from '../../client/rpc/rpc-client.js';
|
|
|
2
2
|
import { finetuneRunParamsSchema, finetuneRunRequestSchema, finetuneStopRequestSchema, finetuneGetStateParamsSchema, finetuneGetStateRequestSchema, finetuneProgressResponseSchema, finetuneResponseSchema } from '../../schemas/index.js';
|
|
3
3
|
import { InvalidResponseError, StreamEndedError } from '../../utils/errors-client.js';
|
|
4
4
|
import { parseClientInput } from '../../client/parse-input.js';
|
|
5
|
+
import { generateClientRequestId } from '../../client/api/client-request-id.js';
|
|
5
6
|
function isFinetuneReplyParams(params) {
|
|
6
7
|
return (params.operation === 'pause' || params.operation === 'cancel' || params.operation === 'getState');
|
|
7
8
|
}
|
|
@@ -36,6 +37,9 @@ export function finetune(params, rpcOptions) {
|
|
|
36
37
|
return resultPromise;
|
|
37
38
|
}
|
|
38
39
|
const runParams = parseClientInput(finetuneRunParamsSchema, params);
|
|
40
|
+
// Client-side id so the run is cancellable via cancel({ requestId }) the
|
|
41
|
+
// moment the handle is returned. Surfaced on the handle below.
|
|
42
|
+
const requestId = generateClientRequestId();
|
|
39
43
|
let resultResolver = () => { };
|
|
40
44
|
let resultRejecter = () => { };
|
|
41
45
|
const resultPromise = new Promise((resolve, reject) => {
|
|
@@ -53,6 +57,7 @@ export function finetune(params, rpcOptions) {
|
|
|
53
57
|
const request = parseClientInput(finetuneRunRequestSchema, {
|
|
54
58
|
type: 'finetune',
|
|
55
59
|
...runParams,
|
|
60
|
+
requestId,
|
|
56
61
|
withProgress: true
|
|
57
62
|
});
|
|
58
63
|
const responses = streamRpc(request, rpcOptions);
|
|
@@ -133,6 +138,7 @@ export function finetune(params, rpcOptions) {
|
|
|
133
138
|
})();
|
|
134
139
|
return {
|
|
135
140
|
progressStream,
|
|
136
|
-
result: resultPromise
|
|
141
|
+
result: resultPromise,
|
|
142
|
+
requestId
|
|
137
143
|
};
|
|
138
144
|
}
|
|
@@ -30,7 +30,7 @@ export { modelRegistryList, modelRegistrySearch, modelRegistryGetModel, type Mod
|
|
|
30
30
|
export { suspend } from './suspend.js';
|
|
31
31
|
export { resume } from './resume.js';
|
|
32
32
|
export { state } from './state.js';
|
|
33
|
-
export { vla, vlaHparams } from './vla.js';
|
|
33
|
+
export { vla, vlaHparams, vlaSetEmbodiment } from './vla.js';
|
|
34
34
|
export { vlaPreprocessImage, vlaPadState, VLA_DEFAULT_IMAGE_SIZE } from './vla-helpers.js';
|
|
35
35
|
export { audioGen } from '../../client/api/audio-gen.js';
|
|
36
36
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/client/api/index.js
CHANGED
|
@@ -30,6 +30,6 @@ export { modelRegistryList, modelRegistrySearch, modelRegistryGetModel } from '.
|
|
|
30
30
|
export { suspend } from './suspend.js';
|
|
31
31
|
export { resume } from './resume.js';
|
|
32
32
|
export { state } from './state.js';
|
|
33
|
-
export { vla, vlaHparams } from './vla.js';
|
|
33
|
+
export { vla, vlaHparams, vlaSetEmbodiment } from './vla.js';
|
|
34
34
|
export { vlaPreprocessImage, vlaPadState, VLA_DEFAULT_IMAGE_SIZE } from './vla-helpers.js';
|
|
35
35
|
export { audioGen } from '../../client/api/audio-gen.js';
|
|
@@ -37,6 +37,7 @@ export declare function loadModel<S extends ModelDescriptor>(options: LoadModelD
|
|
|
37
37
|
* "tts-ggml", ...). May be omitted when `modelSrc` is a registry descriptor
|
|
38
38
|
* that already carries the engine.
|
|
39
39
|
* - modelConfig: Model-specific configuration options (companion sources, model parameters, etc.)
|
|
40
|
+
* - fallbackSrc: For a built-in catalog model, an HTTP URL or local file path to load from when the registry is unreachable (validated against the model checksum)
|
|
40
41
|
* - onProgress: Callback for download progress updates
|
|
41
42
|
* - logger: Logger instance for model operation logs
|
|
42
43
|
* @param rpcOptions - Optional RPC options including per-call profiling configuration
|
|
@@ -113,6 +114,13 @@ export declare function loadModel<S extends ModelDescriptor>(options: LoadModelD
|
|
|
113
114
|
* modelType: "llamacpp-completion",
|
|
114
115
|
* logger // Pass logger in options
|
|
115
116
|
* });
|
|
117
|
+
*
|
|
118
|
+
* // Catalog model with an alternate source used when the registry is unreachable
|
|
119
|
+
* import { LLAMA_3_2_1B_INST_Q4_0 } from "@qvac/sdk";
|
|
120
|
+
* const resilientId = await loadModel({
|
|
121
|
+
* modelSrc: LLAMA_3_2_1B_INST_Q4_0,
|
|
122
|
+
* fallbackSrc: "https://mirror.example.com/llama-3.2-1b-instruct-q4_0.gguf"
|
|
123
|
+
* });
|
|
116
124
|
* ```
|
|
117
125
|
*/
|
|
118
126
|
export declare function loadModel(options: LoadModelOptions, rpcOptions?: RPCOptions): Promise<string> & {
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { type TranscribeClientParams, type RPCOptions, type TranscribeSegment, type TranscribeStreamClientParams, type TranscribeStreamSession, type TranscribeStreamMetadataSession, type TranscribeStreamConversationSession } from '../../schemas/index.js';
|
|
1
|
+
import { type TranscribeClientParams, type RPCOptions, type TranscribeSegment, type TranscribeStreamRequest, type TranscribeStreamClientParams, type TranscribeStreamSession, type TranscribeStreamMetadataSession, type TranscribeStreamConversationSession, type TranscribeStats } from '../../schemas/index.js';
|
|
2
|
+
import { duplex } from '../../client/rpc/rpc-client.js';
|
|
3
|
+
type TranscribeDuplexFactory = (request: TranscribeStreamRequest, options?: RPCOptions) => ReturnType<typeof duplex>;
|
|
2
4
|
/**
|
|
3
5
|
* Transcribe audio and return the complete text. Accepts either a file
|
|
4
6
|
* path or an audio buffer.
|
|
@@ -61,7 +63,8 @@ export declare function transcribeStream(params: TranscribeClientParams, options
|
|
|
61
63
|
* @returns A session object: call `write(audioChunk)` with a `Uint8Array`
|
|
62
64
|
* (Node `Buffer` is a `Uint8Array` subtype) to feed audio,
|
|
63
65
|
* iterate with `for await (...)` to receive transcription, and
|
|
64
|
-
* `end()` to signal end of audio.
|
|
66
|
+
* `end()` to signal end of audio. After consuming the iterator,
|
|
67
|
+
* await `session.stats` for terminal engine statistics.
|
|
65
68
|
*/
|
|
66
69
|
export declare function transcribeStream(params: TranscribeStreamClientParams & {
|
|
67
70
|
emitVadEvents: true;
|
|
@@ -73,4 +76,18 @@ export declare function transcribeStream(params: TranscribeStreamClientParams &
|
|
|
73
76
|
metadata: true;
|
|
74
77
|
}, options?: RPCOptions): Promise<TranscribeStreamMetadataSession>;
|
|
75
78
|
export declare function transcribeStream(params: TranscribeStreamClientParams, options?: RPCOptions): Promise<TranscribeStreamSession>;
|
|
79
|
+
/**
|
|
80
|
+
* Shared duplex session factory. The per-call line processor decides whether
|
|
81
|
+
* to surface strings or segments; `sessionName` is only used to label the
|
|
82
|
+
* "already iterated" error so callers see the correct session type.
|
|
83
|
+
*/
|
|
84
|
+
export declare function createTranscribeStreamSession<T>(params: TranscribeStreamClientParams, options: RPCOptions | undefined, process: (line: string, onStats: (stats: TranscribeStats | undefined) => void) => T | undefined | null, sessionName: string, duplexFactory?: TranscribeDuplexFactory): Promise<{
|
|
85
|
+
stats: Promise<TranscribeStats | undefined>;
|
|
86
|
+
write(audioChunk: Uint8Array): void;
|
|
87
|
+
end(): void;
|
|
88
|
+
destroy(): void;
|
|
89
|
+
[Symbol.asyncIterator](): AsyncIterator<T>;
|
|
90
|
+
}>;
|
|
91
|
+
export declare function processLine(line: string, onStats: (stats: TranscribeStats | undefined) => void): string | undefined | null;
|
|
92
|
+
export {};
|
|
76
93
|
//# sourceMappingURL=transcribe.d.ts.map
|
|
@@ -121,12 +121,39 @@ function buildTranscribeStreamRequest(params) {
|
|
|
121
121
|
* to surface strings or segments; `sessionName` is only used to label the
|
|
122
122
|
* "already iterated" error so callers see the correct session type.
|
|
123
123
|
*/
|
|
124
|
-
async function createTranscribeStreamSession(params, options, process, sessionName) {
|
|
124
|
+
export async function createTranscribeStreamSession(params, options, process, sessionName, duplexFactory = duplex) {
|
|
125
125
|
const request = buildTranscribeStreamRequest(params);
|
|
126
|
-
const { requestStream, responseStream } = await
|
|
127
|
-
|
|
126
|
+
const { requestStream, responseStream } = await duplexFactory(request, options);
|
|
127
|
+
let statsSettled = false;
|
|
128
|
+
let resolveStatsPromise = () => { };
|
|
129
|
+
let rejectStatsPromise = () => { };
|
|
130
|
+
const stats = new Promise((resolve, reject) => {
|
|
131
|
+
resolveStatsPromise = resolve;
|
|
132
|
+
rejectStatsPromise = reject;
|
|
133
|
+
});
|
|
134
|
+
stats.catch(() => { });
|
|
135
|
+
function resolveStats(value) {
|
|
136
|
+
if (statsSettled)
|
|
137
|
+
return;
|
|
138
|
+
statsSettled = true;
|
|
139
|
+
resolveStatsPromise(value);
|
|
140
|
+
}
|
|
141
|
+
function rejectStats(error) {
|
|
142
|
+
if (statsSettled)
|
|
143
|
+
return;
|
|
144
|
+
statsSettled = true;
|
|
145
|
+
rejectStatsPromise(error);
|
|
146
|
+
}
|
|
147
|
+
function resolveEmptyStats() {
|
|
148
|
+
resolveStats(undefined);
|
|
149
|
+
}
|
|
150
|
+
function processResponse(line) {
|
|
151
|
+
return process(line, resolveStats);
|
|
152
|
+
}
|
|
153
|
+
const responses = parseLines(responseStream, processResponse, resolveEmptyStats, rejectStats);
|
|
128
154
|
let consumed = false;
|
|
129
155
|
return {
|
|
156
|
+
stats,
|
|
130
157
|
write(audioChunk) {
|
|
131
158
|
requestStream.write(audioChunk);
|
|
132
159
|
},
|
|
@@ -134,6 +161,7 @@ async function createTranscribeStreamSession(params, options, process, sessionNa
|
|
|
134
161
|
requestStream.end();
|
|
135
162
|
},
|
|
136
163
|
destroy() {
|
|
164
|
+
resolveStats(undefined);
|
|
137
165
|
requestStream.destroy();
|
|
138
166
|
responseStream.destroy();
|
|
139
167
|
},
|
|
@@ -154,32 +182,41 @@ function transcribeStreamDuplexMetadata(params, options) {
|
|
|
154
182
|
}
|
|
155
183
|
function transcribeStreamDuplexConversation(params, options) {
|
|
156
184
|
const wantsMetadata = params.metadata === true;
|
|
157
|
-
return createTranscribeStreamSession(params, options, (line) => processLineConversation(line, wantsMetadata), 'TranscribeStreamConversationSession');
|
|
185
|
+
return createTranscribeStreamSession(params, options, (line, onStats) => processLineConversation(line, wantsMetadata, onStats), 'TranscribeStreamConversationSession');
|
|
158
186
|
}
|
|
159
187
|
/**
|
|
160
188
|
* Line-delimited parser: reads newline-separated frames from a duplex
|
|
161
189
|
* response stream, passes each non-empty line through `process`, and yields
|
|
162
190
|
* whatever values it returns. `null` from `process` terminates the stream.
|
|
163
191
|
*/
|
|
164
|
-
async function* parseLines(responseStream, process) {
|
|
192
|
+
async function* parseLines(responseStream, process, onClose, onError) {
|
|
165
193
|
let buf = '';
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
const
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
194
|
+
try {
|
|
195
|
+
for await (const chunk of responseStream) {
|
|
196
|
+
buf += chunk.toString();
|
|
197
|
+
const lines = buf.split('\n');
|
|
198
|
+
buf = lines.pop() || '';
|
|
199
|
+
for (const line of lines) {
|
|
200
|
+
const result = process(line);
|
|
201
|
+
if (result === null)
|
|
202
|
+
return;
|
|
203
|
+
if (result !== undefined)
|
|
204
|
+
yield result;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
// Process any residual data after stream ends
|
|
208
|
+
if (buf.trim()) {
|
|
209
|
+
const result = process(buf);
|
|
210
|
+
if (result !== null && result !== undefined)
|
|
175
211
|
yield result;
|
|
176
212
|
}
|
|
177
213
|
}
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
214
|
+
catch (error) {
|
|
215
|
+
onError(error);
|
|
216
|
+
throw error;
|
|
217
|
+
}
|
|
218
|
+
finally {
|
|
219
|
+
onClose();
|
|
183
220
|
}
|
|
184
221
|
}
|
|
185
222
|
function parseResponseLine(line) {
|
|
@@ -204,23 +241,25 @@ function parseResponseLine(line) {
|
|
|
204
241
|
* `undefined` for frames the caller should skip, or the value extracted from
|
|
205
242
|
* the frame.
|
|
206
243
|
*/
|
|
207
|
-
function processWith(line, extract) {
|
|
244
|
+
function processWith(line, extract, onStats) {
|
|
208
245
|
const response = parseResponseLine(line);
|
|
209
246
|
if (response === null)
|
|
210
247
|
return undefined;
|
|
211
248
|
if (response.error)
|
|
212
249
|
throw new TranscriptionFailedError(response.error);
|
|
213
|
-
if (response.done)
|
|
250
|
+
if (response.done) {
|
|
251
|
+
onStats(response.stats);
|
|
214
252
|
return null;
|
|
253
|
+
}
|
|
215
254
|
return extract(response);
|
|
216
255
|
}
|
|
217
|
-
function processLine(line) {
|
|
218
|
-
return processWith(line, (response) => (response.text?.trim() ? response.text : undefined));
|
|
256
|
+
export function processLine(line, onStats) {
|
|
257
|
+
return processWith(line, (response) => (response.text?.trim() ? response.text : undefined), onStats);
|
|
219
258
|
}
|
|
220
|
-
function processLineMetadata(line) {
|
|
221
|
-
return processWith(line, (response) => response.segment);
|
|
259
|
+
function processLineMetadata(line, onStats) {
|
|
260
|
+
return processWith(line, (response) => response.segment, onStats);
|
|
222
261
|
}
|
|
223
|
-
function processLineConversation(line, wantsMetadata) {
|
|
262
|
+
function processLineConversation(line, wantsMetadata, onStats) {
|
|
224
263
|
return processWith(line, (response) => {
|
|
225
264
|
if (response.vad) {
|
|
226
265
|
return {
|
|
@@ -252,5 +291,5 @@ function processLineConversation(line, wantsMetadata) {
|
|
|
252
291
|
return { type: 'text', text: response.text };
|
|
253
292
|
}
|
|
254
293
|
return undefined;
|
|
255
|
-
});
|
|
294
|
+
}, onStats);
|
|
256
295
|
}
|
|
@@ -19,7 +19,7 @@ import { type TranslateClientParams, type TranslationStats, type RPCOptions } fr
|
|
|
19
19
|
* modelId: "modelId",
|
|
20
20
|
* text: "Hello world",
|
|
21
21
|
* from: "en",
|
|
22
|
-
* to: "es"
|
|
22
|
+
* to: "es",
|
|
23
23
|
* modelType: "llm",
|
|
24
24
|
* });
|
|
25
25
|
*
|
|
@@ -32,7 +32,7 @@ import { type TranslateClientParams, type TranslationStats, type RPCOptions } fr
|
|
|
32
32
|
* modelId: "modelId",
|
|
33
33
|
* text: "Hello world",
|
|
34
34
|
* from: "en",
|
|
35
|
-
* to: "es"
|
|
35
|
+
* to: "es",
|
|
36
36
|
* modelType: "llm",
|
|
37
37
|
* stream: false,
|
|
38
38
|
* });
|
|
@@ -44,5 +44,6 @@ export declare function translate(params: TranslateClientParams, options?: RPCOp
|
|
|
44
44
|
tokenStream: AsyncGenerator<string>;
|
|
45
45
|
stats: Promise<TranslationStats | undefined>;
|
|
46
46
|
text: Promise<string>;
|
|
47
|
+
requestId: string;
|
|
47
48
|
};
|
|
48
49
|
//# sourceMappingURL=translate.d.ts.map
|