@qvac/sdk 0.9.2 → 0.10.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 +15 -68
- package/dist/client/api/cancel.d.ts +1 -1
- package/dist/client/api/cancel.js +1 -1
- package/dist/client/api/completion-stream.d.ts +51 -12
- package/dist/client/api/completion-stream.js +129 -56
- package/dist/client/api/delete-cache.d.ts +1 -0
- package/dist/client/api/delete-cache.js +1 -0
- package/dist/client/api/diffusion.d.ts +17 -2
- package/dist/client/api/diffusion.js +21 -4
- package/dist/client/api/embed.d.ts +4 -0
- package/dist/client/api/finetune.d.ts +21 -0
- package/dist/client/api/get-loaded-model-info.d.ts +25 -0
- package/dist/client/api/get-loaded-model-info.js +36 -0
- package/dist/client/api/get-model-info.d.ts +9 -1
- package/dist/client/api/get-model-info.js +8 -0
- package/dist/client/api/heartbeat.d.ts +2 -2
- package/dist/client/api/heartbeat.js +2 -2
- package/dist/client/api/index.d.ts +3 -1
- package/dist/client/api/index.js +3 -1
- package/dist/client/api/invoke-plugin.d.ts +16 -0
- package/dist/client/api/invoke-plugin.js +16 -0
- package/dist/client/api/load-model.d.ts +36 -3
- package/dist/client/api/load-model.js +31 -10
- package/dist/client/api/provide.d.ts +11 -5
- package/dist/client/api/provide.js +11 -6
- package/dist/client/api/rag.d.ts +9 -0
- package/dist/client/api/rag.js +9 -0
- package/dist/client/api/registry.d.ts +26 -0
- package/dist/client/api/registry.js +26 -0
- package/dist/client/api/resume.d.ts +20 -4
- package/dist/client/api/resume.js +20 -4
- package/dist/client/api/state.d.ts +23 -0
- package/dist/client/api/state.js +29 -0
- package/dist/client/api/stop-provider.d.ts +11 -5
- package/dist/client/api/stop-provider.js +11 -5
- package/dist/client/api/suspend.d.ts +21 -3
- package/dist/client/api/suspend.js +21 -3
- package/dist/client/api/text-to-speech.d.ts +64 -6
- package/dist/client/api/text-to-speech.js +423 -47
- package/dist/client/api/transcribe.d.ts +29 -4
- package/dist/client/api/transcribe.js +86 -28
- package/dist/client/api/translate.d.ts +1 -0
- package/dist/client/api/translate.js +1 -0
- package/dist/client/rpc/bare-client.js +22 -1
- package/dist/client/rpc/expo-rpc-client.d.ts +1 -1
- package/dist/client/rpc/expo-rpc-client.js +96 -4
- package/dist/client/rpc/node-rpc-client.js +36 -0
- package/dist/examples/audio/mic-input.d.ts +9 -0
- package/dist/examples/audio/mic-input.js +111 -0
- package/dist/examples/completion-events.d.ts +18 -0
- package/dist/examples/completion-events.js +79 -0
- package/dist/examples/delegated-inference/composite.js +12 -18
- package/dist/examples/delegated-inference/consumer-profiled.js +4 -11
- package/dist/examples/delegated-inference/consumer.js +8 -13
- package/dist/examples/delegated-inference/provider.js +11 -16
- package/dist/examples/diffusion-flux2-klein-img2img.d.ts +2 -0
- package/dist/examples/diffusion-flux2-klein-img2img.js +60 -0
- package/dist/examples/diffusion-flux2-klein.js +1 -0
- package/dist/examples/diffusion-img2img.d.ts +2 -0
- package/dist/examples/diffusion-img2img.js +49 -0
- package/dist/examples/diffusion-txt2img.js +2 -1
- package/dist/examples/kv-cache-example.js +11 -12
- package/dist/examples/llamacpp-cache.d.ts +2 -0
- package/dist/examples/llamacpp-cache.js +107 -0
- package/dist/examples/llamacpp-dynamic-tools.d.ts +2 -0
- package/dist/examples/llamacpp-dynamic-tools.js +144 -0
- package/dist/examples/llamacpp-native-tools.js +2 -8
- package/dist/examples/llamacpp-structured-output.d.ts +2 -0
- package/dist/examples/llamacpp-structured-output.js +106 -0
- package/dist/examples/llamacpp-tools-pythonic.d.ts +2 -0
- package/dist/examples/llamacpp-tools-pythonic.js +69 -0
- package/dist/examples/plugins.js +4 -4
- package/dist/examples/suspend-resume.js +21 -4
- package/dist/examples/transcription/parakeet-microphone-record.js +6 -33
- package/dist/examples/transcription/whispercpp-filesystem-streaming.js +7 -5
- package/dist/examples/transcription/whispercpp-filesystem.js +12 -3
- package/dist/examples/transcription/whispercpp-microphone-record.js +6 -29
- package/dist/examples/translation/translation-stream.js +5 -5
- package/dist/examples/tts/llm-to-tts-streaming.d.ts +16 -0
- package/dist/examples/tts/llm-to-tts-streaming.js +143 -0
- package/dist/examples/tts/supertonic-multilingual.js +3 -3
- package/dist/examples/tts/supertonic.js +3 -3
- package/dist/examples/tts/utils.d.ts +11 -1
- package/dist/examples/tts/utils.js +70 -17
- package/dist/examples/voice-assistant/voice-assistant.d.ts +2 -0
- package/dist/examples/voice-assistant/voice-assistant.js +207 -0
- package/dist/expo/plugins/withMobileBundle.js +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/logging/logger.d.ts +11 -0
- package/dist/logging/logger.js +11 -0
- package/dist/logging/types.d.ts +18 -0
- package/dist/models/registry/models.d.ts +6620 -6185
- package/dist/models/registry/models.js +6296 -5318
- package/dist/models/update-models/codegen.js +84 -23
- package/dist/models/update-models/companions.d.ts +18 -0
- package/dist/models/update-models/companions.js +175 -0
- package/dist/models/update-models/naming.js +0 -25
- package/dist/models/update-models/registry.js +4 -2
- package/dist/models/update-models/types.d.ts +37 -9
- package/dist/profiling/index.d.ts +49 -0
- package/dist/profiling/index.js +49 -0
- package/dist/schemas/cancel.d.ts +6 -2
- package/dist/schemas/cancel.js +14 -7
- package/dist/schemas/common.d.ts +353 -271
- package/dist/schemas/common.js +26 -5
- package/dist/schemas/completion-event.d.ts +225 -0
- package/dist/schemas/completion-event.js +79 -0
- package/dist/schemas/completion-stream.d.ts +122 -31
- package/dist/schemas/completion-stream.js +137 -36
- package/dist/schemas/delegate.d.ts +0 -2
- package/dist/schemas/delegate.js +25 -6
- package/dist/schemas/download-asset.d.ts +5 -5
- package/dist/schemas/embed.js +21 -9
- package/dist/schemas/engine-addon-map.d.ts +11 -1
- package/dist/schemas/engine-addon-map.js +2 -2
- package/dist/schemas/get-loaded-model-info.d.ts +52 -0
- package/dist/schemas/get-loaded-model-info.js +44 -0
- package/dist/schemas/get-model-info.d.ts +2 -2
- package/dist/schemas/get-model-info.js +103 -32
- package/dist/schemas/heartbeat.d.ts +0 -1
- package/dist/schemas/index.d.ts +4 -1
- package/dist/schemas/index.js +4 -1
- package/dist/schemas/llamacpp-config.d.ts +14 -4
- package/dist/schemas/llamacpp-config.js +5 -0
- package/dist/schemas/load-model.d.ts +3233 -1260
- package/dist/schemas/load-model.js +23 -16
- package/dist/schemas/model-src-utils.d.ts +7 -6
- package/dist/schemas/model-src-utils.js +27 -1
- package/dist/schemas/model-types.d.ts +4 -4
- package/dist/schemas/ocr.d.ts +1 -1
- package/dist/schemas/plugin.d.ts +27 -3
- package/dist/schemas/plugin.js +27 -2
- package/dist/schemas/profiling.js +11 -3
- package/dist/schemas/provide.d.ts +1 -3
- package/dist/schemas/provide.js +0 -3
- package/dist/schemas/rag.d.ts +4 -4
- package/dist/schemas/registry.d.ts +10 -10
- package/dist/schemas/registry.js +36 -14
- package/dist/schemas/reload-config.d.ts +73 -7
- package/dist/schemas/sdcpp-config.d.ts +16 -8
- package/dist/schemas/sdcpp-config.js +118 -25
- package/dist/schemas/sdk-config.d.ts +116 -90
- package/dist/schemas/sdk-config.js +16 -0
- package/dist/schemas/sdk-errors-client.d.ts +3 -0
- package/dist/schemas/sdk-errors-client.js +16 -1
- package/dist/schemas/sdk-errors-server.d.ts +3 -0
- package/dist/schemas/sdk-errors-server.js +23 -0
- package/dist/schemas/state.d.ts +23 -0
- package/dist/schemas/state.js +14 -0
- package/dist/schemas/stop-provide.d.ts +0 -5
- package/dist/schemas/stop-provide.js +2 -6
- package/dist/schemas/text-to-speech.d.ts +93 -27
- package/dist/schemas/text-to-speech.js +27 -0
- package/dist/schemas/tools.d.ts +16 -0
- package/dist/schemas/tools.js +15 -0
- package/dist/schemas/transcription-config.d.ts +8 -8
- package/dist/schemas/transcription.d.ts +33 -0
- package/dist/schemas/transcription.js +9 -0
- package/dist/schemas/translate.js +59 -19
- package/dist/schemas/translation-config.d.ts +157 -133
- package/dist/schemas/translation-config.js +34 -11
- package/dist/server/bare/delegate-rpc-client.d.ts +1 -1
- package/dist/server/bare/delegate-rpc-client.js +131 -122
- package/dist/server/bare/hyperswarm.d.ts +2 -2
- package/dist/server/bare/hyperswarm.js +12 -7
- package/dist/server/bare/ops/cancel.js +7 -0
- package/dist/server/bare/ops/kv-cache-utils.d.ts +7 -10
- package/dist/server/bare/ops/kv-cache-utils.js +31 -40
- package/dist/server/bare/ops/load-model.js +0 -1
- package/dist/server/bare/ops/transcribe.d.ts +11 -4
- package/dist/server/bare/ops/transcribe.js +25 -4
- package/dist/server/bare/ops/translate.js +42 -4
- package/dist/server/bare/ops/unload-model.js +21 -19
- package/dist/server/bare/plugins/llamacpp-completion/ops/cache-logger.js +1 -2
- package/dist/server/bare/plugins/llamacpp-completion/ops/completion-stream.d.ts +13 -8
- package/dist/server/bare/plugins/llamacpp-completion/ops/completion-stream.js +257 -85
- package/dist/server/bare/plugins/llamacpp-completion/ops/kv-cache-state.d.ts +101 -0
- package/dist/server/bare/plugins/llamacpp-completion/ops/kv-cache-state.js +135 -0
- package/dist/server/bare/plugins/llamacpp-completion/plugin.d.ts +79 -22
- package/dist/server/bare/plugins/llamacpp-completion/plugin.js +57 -32
- package/dist/server/bare/plugins/llamacpp-embedding/plugin.js +10 -16
- package/dist/server/bare/plugins/nmtcpp-translation/plugin.d.ts +69 -44
- package/dist/server/bare/plugins/nmtcpp-translation/plugin.js +113 -94
- package/dist/server/bare/plugins/onnx-ocr/plugin.d.ts +1 -1
- package/dist/server/bare/plugins/onnx-ocr/plugin.js +1 -2
- package/dist/server/bare/plugins/onnx-tts/ops/text-to-speech-stream.d.ts +7 -0
- package/dist/server/bare/plugins/onnx-tts/ops/text-to-speech-stream.js +116 -0
- package/dist/server/bare/plugins/onnx-tts/ops/text-to-speech.d.ts +2 -3
- package/dist/server/bare/plugins/onnx-tts/ops/text-to-speech.js +71 -9
- package/dist/server/bare/plugins/onnx-tts/plugin.d.ts +41 -13
- package/dist/server/bare/plugins/onnx-tts/plugin.js +48 -3
- package/dist/server/bare/plugins/parakeet-transcription/plugin.d.ts +15 -7
- package/dist/server/bare/plugins/parakeet-transcription/plugin.js +5 -6
- package/dist/server/bare/plugins/sdcpp-generation/ops/diffusion.js +6 -0
- package/dist/server/bare/plugins/sdcpp-generation/plugin.d.ts +8 -5
- package/dist/server/bare/plugins/sdcpp-generation/plugin.js +13 -13
- package/dist/server/bare/plugins/whispercpp-transcription/plugin.d.ts +17 -1
- package/dist/server/bare/plugins/whispercpp-transcription/plugin.js +40 -17
- package/dist/server/bare/registry/config-registry.js +14 -3
- package/dist/server/bare/registry/model-registry.d.ts +8 -10
- package/dist/server/bare/registry/model-registry.js +17 -12
- package/dist/server/bare/registry/registry-client.js +79 -19
- package/dist/server/bare/runtime-lifecycle.d.ts +2 -1
- package/dist/server/bare/runtime-lifecycle.js +13 -2
- package/dist/server/bare/types/addon-responses.d.ts +8 -3
- package/dist/server/bare/utils/transcribe-metadata.d.ts +21 -0
- package/dist/server/bare/utils/transcribe-metadata.js +28 -0
- package/dist/server/bare/utils/tts-stats.d.ts +22 -0
- package/dist/server/bare/utils/tts-stats.js +10 -0
- package/dist/server/rpc/create-server.d.ts +4 -1
- package/dist/server/rpc/create-server.js +5 -1
- package/dist/server/rpc/delegate-transport.js +36 -29
- package/dist/server/rpc/handle-request.js +28 -3
- package/dist/server/rpc/handler-registry.js +7 -1
- package/dist/server/rpc/handler-utils.d.ts +5 -0
- package/dist/server/rpc/handler-utils.js +22 -0
- package/dist/server/rpc/handlers/cancel-delegated.js +3 -5
- package/dist/server/rpc/handlers/cancelHandler.js +4 -5
- package/dist/server/rpc/handlers/completion-stream-delegated.js +14 -5
- package/dist/server/rpc/handlers/delete-cache.js +8 -3
- package/dist/server/rpc/handlers/download-asset.js +3 -24
- package/dist/server/rpc/handlers/get-loaded-model-info.d.ts +3 -0
- package/dist/server/rpc/handlers/get-loaded-model-info.js +39 -0
- package/dist/server/rpc/handlers/get-model-info.js +93 -84
- package/dist/server/rpc/handlers/heartbeat-delegated.js +2 -2
- package/dist/server/rpc/handlers/index.d.ts +6 -0
- package/dist/server/rpc/handlers/index.js +6 -0
- package/dist/server/rpc/handlers/load-model/download-manager.d.ts +35 -9
- package/dist/server/rpc/handlers/load-model/download-manager.js +142 -38
- package/dist/server/rpc/handlers/load-model/download-stats.d.ts +5 -4
- package/dist/server/rpc/handlers/load-model/download-stats.js +49 -8
- package/dist/server/rpc/handlers/load-model/handler.js +31 -50
- package/dist/server/rpc/handlers/load-model/http.d.ts +2 -2
- package/dist/server/rpc/handlers/load-model/http.js +97 -142
- package/dist/server/rpc/handlers/load-model/hyperdrive.d.ts +2 -2
- package/dist/server/rpc/handlers/load-model/hyperdrive.js +55 -74
- package/dist/server/rpc/handlers/load-model/index.d.ts +0 -1
- package/dist/server/rpc/handlers/load-model/index.js +0 -1
- package/dist/server/rpc/handlers/load-model/registry-client-options.d.ts +27 -0
- package/dist/server/rpc/handlers/load-model/registry-client-options.js +19 -0
- package/dist/server/rpc/handlers/load-model/registry-companion-set.d.ts +22 -0
- package/dist/server/rpc/handlers/load-model/registry-companion-set.js +208 -0
- package/dist/server/rpc/handlers/load-model/registry-download-utils.d.ts +24 -0
- package/dist/server/rpc/handlers/load-model/registry-download-utils.js +114 -0
- package/dist/server/rpc/handlers/load-model/registry.d.ts +2 -20
- package/dist/server/rpc/handlers/load-model/registry.js +109 -381
- package/dist/server/rpc/handlers/load-model/resolve-session.d.ts +15 -0
- package/dist/server/rpc/handlers/load-model/resolve-session.js +61 -0
- package/dist/server/rpc/handlers/load-model/resolve.d.ts +3 -3
- package/dist/server/rpc/handlers/load-model/resolve.js +14 -23
- package/dist/server/rpc/handlers/load-model/types.d.ts +11 -4
- package/dist/server/rpc/handlers/load-model/types.js +28 -1
- package/dist/server/rpc/handlers/load-model-delegated.js +2 -4
- package/dist/server/rpc/handlers/plugin-dispatch.js +9 -5
- package/dist/server/rpc/handlers/plugin-invoke.js +1 -1
- package/dist/server/rpc/handlers/provideHandler/connection.js +13 -2
- package/dist/server/rpc/handlers/provideHandler/handler.js +42 -29
- package/dist/server/rpc/handlers/state.d.ts +3 -0
- package/dist/server/rpc/handlers/state.js +7 -0
- package/dist/server/rpc/handlers/stopProvideHandler.d.ts +2 -2
- package/dist/server/rpc/handlers/stopProvideHandler.js +12 -7
- package/dist/server/rpc/handlers/text-to-speech-stream.d.ts +3 -0
- package/dist/server/rpc/handlers/text-to-speech-stream.js +4 -0
- package/dist/server/rpc/handlers/unload-model-delegated.js +3 -3
- package/dist/server/rpc/profiling/operation-metrics.js +20 -0
- package/dist/server/rpc/rpc-utils.js +1 -1
- package/dist/server/rpc/transport-selector.d.ts +3 -0
- package/dist/server/rpc/transport-selector.js +18 -0
- package/dist/server/utils/cache/auto-history.d.ts +4 -0
- package/dist/server/utils/cache/auto-history.js +22 -0
- package/dist/server/utils/{cache.d.ts → cache/paths.d.ts} +22 -5
- package/dist/server/utils/{cache.js → cache/paths.js} +36 -20
- package/dist/server/utils/cache/types.d.ts +8 -0
- package/dist/server/utils/cache/types.js +1 -0
- package/dist/server/utils/checksum.d.ts +2 -2
- package/dist/server/utils/checksum.js +1 -1
- package/dist/server/utils/clear-storage.d.ts +5 -0
- package/dist/server/utils/clear-storage.js +17 -0
- package/dist/server/utils/completion-normalizer.d.ts +17 -0
- package/dist/server/utils/completion-normalizer.js +301 -0
- package/dist/server/utils/expand-gguf-shards.d.ts +3 -0
- package/dist/server/utils/expand-gguf-shards.js +22 -0
- package/dist/server/utils/formatting.js +1 -1
- package/dist/server/utils/index.d.ts +4 -2
- package/dist/server/utils/index.js +4 -2
- package/dist/server/utils/qvac-paths.d.ts +2 -0
- package/dist/server/utils/qvac-paths.js +5 -0
- package/dist/server/utils/response-format.d.ts +3 -0
- package/dist/server/utils/response-format.js +20 -0
- package/dist/server/utils/tool-integration.d.ts +15 -4
- package/dist/server/utils/tool-integration.js +21 -41
- package/dist/server/utils/tools/dialect.d.ts +8 -0
- package/dist/server/utils/tools/dialect.js +12 -0
- package/dist/server/utils/tools/index.d.ts +3 -0
- package/dist/server/utils/tools/index.js +2 -0
- package/dist/server/utils/tools/parser.d.ts +6 -0
- package/dist/server/utils/tools/parser.js +40 -0
- package/dist/server/utils/tools/parsers/hermes.d.ts +4 -0
- package/dist/server/utils/tools/parsers/hermes.js +100 -0
- package/dist/server/utils/tools/parsers/json.d.ts +6 -0
- package/dist/server/utils/tools/parsers/json.js +115 -0
- package/dist/server/utils/tools/parsers/pythonic.d.ts +4 -0
- package/dist/server/utils/tools/parsers/pythonic.js +267 -0
- package/dist/server/utils/tools/shared.d.ts +18 -0
- package/dist/server/utils/tools/shared.js +54 -0
- package/dist/server/utils/worker-lock.d.ts +3 -0
- package/dist/server/utils/worker-lock.js +67 -0
- package/dist/server/worker-core.d.ts +16 -1
- package/dist/server/worker-core.js +114 -14
- package/dist/utils/aggregate-events.d.ts +16 -0
- package/dist/utils/aggregate-events.js +52 -0
- package/dist/utils/cache-normalize.d.ts +10 -0
- package/dist/utils/cache-normalize.js +23 -0
- package/dist/utils/encoding.d.ts +8 -0
- package/dist/utils/encoding.js +13 -0
- package/dist/utils/errors-client.d.ts +12 -0
- package/dist/utils/errors-client.js +20 -0
- package/dist/utils/errors-server.d.ts +14 -0
- package/dist/utils/errors-server.js +31 -0
- package/dist/utils/load-model-validation.d.ts +7 -0
- package/dist/utils/load-model-validation.js +18 -0
- package/expo/plugins/patches/android-link.mjs +1 -1
- package/expo/plugins/patches/ios-link.mjs +1 -1
- package/package.json +14 -18
- package/dist/examples/translation/translation-opus.d.ts +0 -2
- package/dist/examples/translation/translation-opus.js +0 -33
- package/dist/server/bare/utils/loader-adapter.d.ts +0 -7
- package/dist/server/bare/utils/loader-adapter.js +0 -9
- package/dist/server/utils/model-path.d.ts +0 -5
- package/dist/server/utils/model-path.js +0 -7
- package/dist/server/utils/tool-parser.d.ts +0 -7
- package/dist/server/utils/tool-parser.js +0 -248
|
@@ -76,6 +76,7 @@ export declare const whisperConfigSchema: z.ZodObject<{
|
|
|
76
76
|
expectedSize: z.ZodOptional<z.ZodNumber>;
|
|
77
77
|
sha256Checksum: z.ZodOptional<z.ZodString>;
|
|
78
78
|
addon: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
79
|
+
embeddings: "embeddings";
|
|
79
80
|
"llamacpp-completion": "llamacpp-completion";
|
|
80
81
|
"whispercpp-transcription": "whispercpp-transcription";
|
|
81
82
|
"llamacpp-embedding": "llamacpp-embedding";
|
|
@@ -86,7 +87,6 @@ export declare const whisperConfigSchema: z.ZodObject<{
|
|
|
86
87
|
"sdcpp-generation": "sdcpp-generation";
|
|
87
88
|
llm: "llm";
|
|
88
89
|
whisper: "whisper";
|
|
89
|
-
embeddings: "embeddings";
|
|
90
90
|
nmt: "nmt";
|
|
91
91
|
parakeet: "parakeet";
|
|
92
92
|
tts: "tts";
|
|
@@ -139,6 +139,7 @@ export declare const parakeetConfigSchema: z.ZodObject<{
|
|
|
139
139
|
expectedSize: z.ZodOptional<z.ZodNumber>;
|
|
140
140
|
sha256Checksum: z.ZodOptional<z.ZodString>;
|
|
141
141
|
addon: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
142
|
+
embeddings: "embeddings";
|
|
142
143
|
"llamacpp-completion": "llamacpp-completion";
|
|
143
144
|
"whispercpp-transcription": "whispercpp-transcription";
|
|
144
145
|
"llamacpp-embedding": "llamacpp-embedding";
|
|
@@ -149,7 +150,6 @@ export declare const parakeetConfigSchema: z.ZodObject<{
|
|
|
149
150
|
"sdcpp-generation": "sdcpp-generation";
|
|
150
151
|
llm: "llm";
|
|
151
152
|
whisper: "whisper";
|
|
152
|
-
embeddings: "embeddings";
|
|
153
153
|
nmt: "nmt";
|
|
154
154
|
parakeet: "parakeet";
|
|
155
155
|
tts: "tts";
|
|
@@ -169,6 +169,7 @@ export declare const parakeetConfigSchema: z.ZodObject<{
|
|
|
169
169
|
expectedSize: z.ZodOptional<z.ZodNumber>;
|
|
170
170
|
sha256Checksum: z.ZodOptional<z.ZodString>;
|
|
171
171
|
addon: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
172
|
+
embeddings: "embeddings";
|
|
172
173
|
"llamacpp-completion": "llamacpp-completion";
|
|
173
174
|
"whispercpp-transcription": "whispercpp-transcription";
|
|
174
175
|
"llamacpp-embedding": "llamacpp-embedding";
|
|
@@ -179,7 +180,6 @@ export declare const parakeetConfigSchema: z.ZodObject<{
|
|
|
179
180
|
"sdcpp-generation": "sdcpp-generation";
|
|
180
181
|
llm: "llm";
|
|
181
182
|
whisper: "whisper";
|
|
182
|
-
embeddings: "embeddings";
|
|
183
183
|
nmt: "nmt";
|
|
184
184
|
parakeet: "parakeet";
|
|
185
185
|
tts: "tts";
|
|
@@ -199,6 +199,7 @@ export declare const parakeetConfigSchema: z.ZodObject<{
|
|
|
199
199
|
expectedSize: z.ZodOptional<z.ZodNumber>;
|
|
200
200
|
sha256Checksum: z.ZodOptional<z.ZodString>;
|
|
201
201
|
addon: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
202
|
+
embeddings: "embeddings";
|
|
202
203
|
"llamacpp-completion": "llamacpp-completion";
|
|
203
204
|
"whispercpp-transcription": "whispercpp-transcription";
|
|
204
205
|
"llamacpp-embedding": "llamacpp-embedding";
|
|
@@ -209,7 +210,6 @@ export declare const parakeetConfigSchema: z.ZodObject<{
|
|
|
209
210
|
"sdcpp-generation": "sdcpp-generation";
|
|
210
211
|
llm: "llm";
|
|
211
212
|
whisper: "whisper";
|
|
212
|
-
embeddings: "embeddings";
|
|
213
213
|
nmt: "nmt";
|
|
214
214
|
parakeet: "parakeet";
|
|
215
215
|
tts: "tts";
|
|
@@ -229,6 +229,7 @@ export declare const parakeetConfigSchema: z.ZodObject<{
|
|
|
229
229
|
expectedSize: z.ZodOptional<z.ZodNumber>;
|
|
230
230
|
sha256Checksum: z.ZodOptional<z.ZodString>;
|
|
231
231
|
addon: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
232
|
+
embeddings: "embeddings";
|
|
232
233
|
"llamacpp-completion": "llamacpp-completion";
|
|
233
234
|
"whispercpp-transcription": "whispercpp-transcription";
|
|
234
235
|
"llamacpp-embedding": "llamacpp-embedding";
|
|
@@ -239,7 +240,6 @@ export declare const parakeetConfigSchema: z.ZodObject<{
|
|
|
239
240
|
"sdcpp-generation": "sdcpp-generation";
|
|
240
241
|
llm: "llm";
|
|
241
242
|
whisper: "whisper";
|
|
242
|
-
embeddings: "embeddings";
|
|
243
243
|
nmt: "nmt";
|
|
244
244
|
parakeet: "parakeet";
|
|
245
245
|
tts: "tts";
|
|
@@ -259,6 +259,7 @@ export declare const parakeetConfigSchema: z.ZodObject<{
|
|
|
259
259
|
expectedSize: z.ZodOptional<z.ZodNumber>;
|
|
260
260
|
sha256Checksum: z.ZodOptional<z.ZodString>;
|
|
261
261
|
addon: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
262
|
+
embeddings: "embeddings";
|
|
262
263
|
"llamacpp-completion": "llamacpp-completion";
|
|
263
264
|
"whispercpp-transcription": "whispercpp-transcription";
|
|
264
265
|
"llamacpp-embedding": "llamacpp-embedding";
|
|
@@ -269,7 +270,6 @@ export declare const parakeetConfigSchema: z.ZodObject<{
|
|
|
269
270
|
"sdcpp-generation": "sdcpp-generation";
|
|
270
271
|
llm: "llm";
|
|
271
272
|
whisper: "whisper";
|
|
272
|
-
embeddings: "embeddings";
|
|
273
273
|
nmt: "nmt";
|
|
274
274
|
parakeet: "parakeet";
|
|
275
275
|
tts: "tts";
|
|
@@ -289,6 +289,7 @@ export declare const parakeetConfigSchema: z.ZodObject<{
|
|
|
289
289
|
expectedSize: z.ZodOptional<z.ZodNumber>;
|
|
290
290
|
sha256Checksum: z.ZodOptional<z.ZodString>;
|
|
291
291
|
addon: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
292
|
+
embeddings: "embeddings";
|
|
292
293
|
"llamacpp-completion": "llamacpp-completion";
|
|
293
294
|
"whispercpp-transcription": "whispercpp-transcription";
|
|
294
295
|
"llamacpp-embedding": "llamacpp-embedding";
|
|
@@ -299,7 +300,6 @@ export declare const parakeetConfigSchema: z.ZodObject<{
|
|
|
299
300
|
"sdcpp-generation": "sdcpp-generation";
|
|
300
301
|
llm: "llm";
|
|
301
302
|
whisper: "whisper";
|
|
302
|
-
embeddings: "embeddings";
|
|
303
303
|
nmt: "nmt";
|
|
304
304
|
parakeet: "parakeet";
|
|
305
305
|
tts: "tts";
|
|
@@ -319,6 +319,7 @@ export declare const parakeetConfigSchema: z.ZodObject<{
|
|
|
319
319
|
expectedSize: z.ZodOptional<z.ZodNumber>;
|
|
320
320
|
sha256Checksum: z.ZodOptional<z.ZodString>;
|
|
321
321
|
addon: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
322
|
+
embeddings: "embeddings";
|
|
322
323
|
"llamacpp-completion": "llamacpp-completion";
|
|
323
324
|
"whispercpp-transcription": "whispercpp-transcription";
|
|
324
325
|
"llamacpp-embedding": "llamacpp-embedding";
|
|
@@ -329,7 +330,6 @@ export declare const parakeetConfigSchema: z.ZodObject<{
|
|
|
329
330
|
"sdcpp-generation": "sdcpp-generation";
|
|
330
331
|
llm: "llm";
|
|
331
332
|
whisper: "whisper";
|
|
332
|
-
embeddings: "embeddings";
|
|
333
333
|
nmt: "nmt";
|
|
334
334
|
parakeet: "parakeet";
|
|
335
335
|
tts: "tts";
|
|
@@ -9,6 +9,7 @@ export declare const audioInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
9
9
|
export declare const transcribeParamsSchema: z.ZodObject<{
|
|
10
10
|
modelId: z.ZodString;
|
|
11
11
|
prompt: z.ZodOptional<z.ZodString>;
|
|
12
|
+
metadata: z.ZodOptional<z.ZodBoolean>;
|
|
12
13
|
audioChunk: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
13
14
|
type: z.ZodLiteral<"base64">;
|
|
14
15
|
value: z.ZodString;
|
|
@@ -29,9 +30,17 @@ export declare const transcribeStatsSchema: z.ZodObject<{
|
|
|
29
30
|
decoderTime: z.ZodOptional<z.ZodNumber>;
|
|
30
31
|
melSpecTime: z.ZodOptional<z.ZodNumber>;
|
|
31
32
|
}, z.core.$strip>;
|
|
33
|
+
export declare const transcribeSegmentSchema: z.ZodObject<{
|
|
34
|
+
text: z.ZodString;
|
|
35
|
+
startMs: z.ZodNumber;
|
|
36
|
+
endMs: z.ZodNumber;
|
|
37
|
+
append: z.ZodBoolean;
|
|
38
|
+
id: z.ZodNumber;
|
|
39
|
+
}, z.core.$strip>;
|
|
32
40
|
export declare const transcribeRequestSchema: z.ZodObject<{
|
|
33
41
|
modelId: z.ZodString;
|
|
34
42
|
prompt: z.ZodOptional<z.ZodString>;
|
|
43
|
+
metadata: z.ZodOptional<z.ZodBoolean>;
|
|
35
44
|
audioChunk: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
36
45
|
type: z.ZodLiteral<"base64">;
|
|
37
46
|
value: z.ZodString;
|
|
@@ -57,20 +66,30 @@ export declare const transcribeResponseSchema: z.ZodObject<{
|
|
|
57
66
|
melSpecTime: z.ZodOptional<z.ZodNumber>;
|
|
58
67
|
}, z.core.$strip>>;
|
|
59
68
|
error: z.ZodOptional<z.ZodString>;
|
|
69
|
+
segment: z.ZodOptional<z.ZodObject<{
|
|
70
|
+
text: z.ZodString;
|
|
71
|
+
startMs: z.ZodNumber;
|
|
72
|
+
endMs: z.ZodNumber;
|
|
73
|
+
append: z.ZodBoolean;
|
|
74
|
+
id: z.ZodNumber;
|
|
75
|
+
}, z.core.$strip>>;
|
|
60
76
|
type: z.ZodLiteral<"transcribe">;
|
|
61
77
|
}, z.core.$strip>;
|
|
62
78
|
export type AudioInput = z.infer<typeof audioInputSchema>;
|
|
63
79
|
export type TranscribeParams = z.infer<typeof transcribeParamsSchema>;
|
|
80
|
+
export type TranscribeSegment = z.infer<typeof transcribeSegmentSchema>;
|
|
64
81
|
export type TranscribeClientParams = {
|
|
65
82
|
modelId: string;
|
|
66
83
|
audioChunk: string | Buffer;
|
|
67
84
|
prompt?: string;
|
|
85
|
+
metadata?: boolean;
|
|
68
86
|
};
|
|
69
87
|
export type TranscribeRequest = z.infer<typeof transcribeRequestSchema>;
|
|
70
88
|
export type TranscribeResponse = z.infer<typeof transcribeResponseSchema>;
|
|
71
89
|
export declare const transcribeStreamRequestSchema: z.ZodObject<{
|
|
72
90
|
modelId: z.ZodString;
|
|
73
91
|
prompt: z.ZodOptional<z.ZodString>;
|
|
92
|
+
metadata: z.ZodOptional<z.ZodBoolean>;
|
|
74
93
|
type: z.ZodLiteral<"transcribeStream">;
|
|
75
94
|
}, z.core.$strip>;
|
|
76
95
|
export declare const transcribeStreamResponseSchema: z.ZodObject<{
|
|
@@ -89,6 +108,13 @@ export declare const transcribeStreamResponseSchema: z.ZodObject<{
|
|
|
89
108
|
melSpecTime: z.ZodOptional<z.ZodNumber>;
|
|
90
109
|
}, z.core.$strip>>;
|
|
91
110
|
error: z.ZodOptional<z.ZodString>;
|
|
111
|
+
segment: z.ZodOptional<z.ZodObject<{
|
|
112
|
+
text: z.ZodString;
|
|
113
|
+
startMs: z.ZodNumber;
|
|
114
|
+
endMs: z.ZodNumber;
|
|
115
|
+
append: z.ZodBoolean;
|
|
116
|
+
id: z.ZodNumber;
|
|
117
|
+
}, z.core.$strip>>;
|
|
92
118
|
type: z.ZodLiteral<"transcribeStream">;
|
|
93
119
|
}, z.core.$strip>;
|
|
94
120
|
export type TranscribeStreamRequest = z.infer<typeof transcribeStreamRequestSchema>;
|
|
@@ -96,6 +122,7 @@ export type TranscribeStreamResponse = z.infer<typeof transcribeStreamResponseSc
|
|
|
96
122
|
export type TranscribeStreamClientParams = {
|
|
97
123
|
modelId: string;
|
|
98
124
|
prompt?: string;
|
|
125
|
+
metadata?: boolean;
|
|
99
126
|
};
|
|
100
127
|
export interface TranscribeStreamSession {
|
|
101
128
|
write(audioChunk: Buffer): void;
|
|
@@ -103,5 +130,11 @@ export interface TranscribeStreamSession {
|
|
|
103
130
|
destroy(): void;
|
|
104
131
|
[Symbol.asyncIterator](): AsyncIterator<string>;
|
|
105
132
|
}
|
|
133
|
+
export interface TranscribeStreamMetadataSession {
|
|
134
|
+
write(audioChunk: Buffer): void;
|
|
135
|
+
end(): void;
|
|
136
|
+
destroy(): void;
|
|
137
|
+
[Symbol.asyncIterator](): AsyncIterator<TranscribeSegment>;
|
|
138
|
+
}
|
|
106
139
|
export type TranscribeStats = z.infer<typeof transcribeStatsSchema>;
|
|
107
140
|
//# sourceMappingURL=transcription.d.ts.map
|
|
@@ -12,6 +12,7 @@ export const audioInputSchema = z.discriminatedUnion("type", [
|
|
|
12
12
|
const transcribeBaseSchema = z.object({
|
|
13
13
|
modelId: z.string(),
|
|
14
14
|
prompt: z.string().optional(),
|
|
15
|
+
metadata: z.boolean().optional(),
|
|
15
16
|
});
|
|
16
17
|
export const transcribeParamsSchema = transcribeBaseSchema.extend({
|
|
17
18
|
audioChunk: audioInputSchema,
|
|
@@ -28,6 +29,13 @@ export const transcribeStatsSchema = z.object({
|
|
|
28
29
|
decoderTime: z.number().optional(),
|
|
29
30
|
melSpecTime: z.number().optional(),
|
|
30
31
|
});
|
|
32
|
+
export const transcribeSegmentSchema = z.object({
|
|
33
|
+
text: z.string(),
|
|
34
|
+
startMs: z.number(),
|
|
35
|
+
endMs: z.number(),
|
|
36
|
+
append: z.boolean(),
|
|
37
|
+
id: z.number(),
|
|
38
|
+
});
|
|
31
39
|
export const transcribeRequestSchema = transcribeParamsSchema.extend({
|
|
32
40
|
type: z.literal("transcribe"),
|
|
33
41
|
});
|
|
@@ -36,6 +44,7 @@ const transcriptionResultBase = z.object({
|
|
|
36
44
|
done: z.boolean().optional(),
|
|
37
45
|
stats: transcribeStatsSchema.optional(),
|
|
38
46
|
error: z.string().optional(),
|
|
47
|
+
segment: transcribeSegmentSchema.optional(),
|
|
39
48
|
});
|
|
40
49
|
export const transcribeResponseSchema = transcriptionResultBase.extend({
|
|
41
50
|
type: z.literal("transcribe"),
|
|
@@ -1,24 +1,43 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { nmtModelTypeSchema, llmModelTypeSchema, normalizeModelType, } from "./model-types.js";
|
|
3
3
|
const translateParamsNmtSchema = z.object({
|
|
4
|
-
modelId: z
|
|
5
|
-
|
|
4
|
+
modelId: z
|
|
5
|
+
.string()
|
|
6
|
+
.describe("The identifier of the NMT translation model to use."),
|
|
7
|
+
text: z
|
|
8
|
+
.union([
|
|
6
9
|
z.string().min(1, "Text cannot be empty"),
|
|
7
10
|
z
|
|
8
11
|
.array(z.string().min(1, "Text cannot be empty"))
|
|
9
12
|
.min(1, "Array cannot be empty"),
|
|
10
|
-
])
|
|
11
|
-
|
|
12
|
-
|
|
13
|
+
])
|
|
14
|
+
.describe("The input text(s) to translate. A single string returns a single translation; an array returns one translation per input."),
|
|
15
|
+
stream: z
|
|
16
|
+
.boolean()
|
|
17
|
+
.describe("Whether to stream tokens (`true`) or resolve the complete translation once (`false`)."),
|
|
18
|
+
modelType: nmtModelTypeSchema.describe("NMT model-type variant identifier."),
|
|
13
19
|
});
|
|
14
20
|
const translateParamsLlmSchema = z.object({
|
|
15
|
-
modelId: z
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
modelId: z
|
|
22
|
+
.string()
|
|
23
|
+
.describe("The identifier of the LLM model used for translation."),
|
|
24
|
+
text: z
|
|
25
|
+
.string()
|
|
26
|
+
.min(1, "Text cannot be empty")
|
|
27
|
+
.describe("The input text to translate."),
|
|
28
|
+
stream: z
|
|
29
|
+
.boolean()
|
|
30
|
+
.describe("Whether to stream tokens (`true`) or resolve the complete translation once (`false`)."),
|
|
31
|
+
modelType: llmModelTypeSchema.describe("LLM model-type variant identifier."),
|
|
32
|
+
from: z
|
|
33
|
+
.string()
|
|
34
|
+
.optional()
|
|
35
|
+
.describe("Source language code. When omitted, the SDK attempts to auto-detect the source language."),
|
|
36
|
+
to: z.string().describe("Target language code."),
|
|
37
|
+
context: z
|
|
38
|
+
.string()
|
|
39
|
+
.optional()
|
|
40
|
+
.describe("Optional translation context passed to the LLM as a system hint."),
|
|
22
41
|
});
|
|
23
42
|
// Using z.union since each modelType accepts multiple values
|
|
24
43
|
const translateParamsSchema = z.union([
|
|
@@ -27,15 +46,36 @@ const translateParamsSchema = z.union([
|
|
|
27
46
|
]);
|
|
28
47
|
export const translationStatsSchema = z.object({
|
|
29
48
|
// Common stats
|
|
30
|
-
totalTime: z
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
49
|
+
totalTime: z
|
|
50
|
+
.number()
|
|
51
|
+
.optional()
|
|
52
|
+
.describe("Total translation time in milliseconds."),
|
|
53
|
+
totalTokens: z
|
|
54
|
+
.number()
|
|
55
|
+
.optional()
|
|
56
|
+
.describe("Total tokens produced by the translation."),
|
|
57
|
+
tokensPerSecond: z
|
|
58
|
+
.number()
|
|
59
|
+
.optional()
|
|
60
|
+
.describe("Tokens generated per second."),
|
|
61
|
+
timeToFirstToken: z
|
|
62
|
+
.number()
|
|
63
|
+
.optional()
|
|
64
|
+
.describe("Time to first token in milliseconds (LLM translation only)."),
|
|
34
65
|
// NMT-specific
|
|
35
|
-
decodeTime: z
|
|
36
|
-
|
|
66
|
+
decodeTime: z
|
|
67
|
+
.number()
|
|
68
|
+
.optional()
|
|
69
|
+
.describe("Time spent in the NMT decoder in milliseconds."),
|
|
70
|
+
encodeTime: z
|
|
71
|
+
.number()
|
|
72
|
+
.optional()
|
|
73
|
+
.describe("Time spent in the NMT encoder in milliseconds."),
|
|
37
74
|
// LLM-specific
|
|
38
|
-
cacheTokens: z
|
|
75
|
+
cacheTokens: z
|
|
76
|
+
.number()
|
|
77
|
+
.optional()
|
|
78
|
+
.describe("Tokens served from the KV cache during LLM translation."),
|
|
39
79
|
});
|
|
40
80
|
export const translateRequestSchema = z.union([
|
|
41
81
|
translateParamsNmtSchema.extend({ type: z.literal("translate") }),
|