@qvac/sdk 0.8.1 → 1.0.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/LICENSE +24 -1
- package/README.md +191 -373
- package/dist/client/api/cancel.d.ts +4 -22
- package/dist/client/api/cancel.js +6 -25
- package/dist/client/api/completion-stream.d.ts +30 -24
- package/dist/client/api/completion-stream.js +70 -121
- package/dist/client/api/delete-cache.js +2 -3
- package/dist/client/api/download-asset.d.ts +5 -6
- package/dist/client/api/download-asset.js +20 -16
- package/dist/client/api/embed.d.ts +4 -21
- package/dist/client/api/embed.js +14 -4
- package/dist/client/api/index.d.ts +2 -6
- package/dist/client/api/index.js +2 -6
- package/dist/client/api/load-model.d.ts +21 -49
- package/dist/client/api/load-model.js +134 -40
- package/dist/client/api/logging-stream.d.ts +4 -7
- package/dist/client/api/logging-stream.js +5 -9
- package/dist/client/api/ping.d.ts +11 -0
- package/dist/client/api/ping.js +18 -0
- package/dist/client/api/provide.d.ts +1 -1
- package/dist/client/api/provide.js +3 -4
- package/dist/client/api/rag.d.ts +21 -216
- package/dist/client/api/rag.js +36 -396
- package/dist/client/api/stop-provider.d.ts +1 -1
- package/dist/client/api/stop-provider.js +3 -4
- package/dist/client/api/text-to-speech.d.ts +2 -2
- package/dist/client/api/text-to-speech.js +3 -3
- package/dist/client/api/transcribe.d.ts +5 -9
- package/dist/client/api/transcribe.js +9 -11
- package/dist/client/api/translate.d.ts +3 -3
- package/dist/client/api/translate.js +15 -15
- package/dist/client/api/unload-model.d.ts +1 -5
- package/dist/client/api/unload-model.js +4 -17
- package/dist/client/index.d.ts +1 -1
- package/dist/client/index.js +1 -1
- package/dist/client/logging-stream-registry.d.ts +1 -1
- package/dist/client/logging-stream-registry.js +13 -14
- package/dist/client/rpc/bare-client.d.ts +139 -3
- package/dist/client/rpc/bare-client.js +16 -117
- package/dist/client/rpc/bare-rpc-client.d.ts +4 -0
- package/dist/client/rpc/bare-rpc-client.js +87 -0
- package/dist/client/rpc/expo-rpc-client.d.ts +1 -2
- package/dist/client/rpc/expo-rpc-client.js +14 -57
- package/dist/client/rpc/node-rpc-client.d.ts +8 -3
- package/dist/client/rpc/node-rpc-client.js +62 -218
- package/dist/client/rpc/rpc-client.d.ts +2 -3
- package/dist/client/rpc/rpc-client.js +49 -184
- package/dist/constants/audio.d.ts +2 -1
- package/dist/constants/audio.js +17 -1
- package/dist/constants/index.d.ts +0 -1
- package/dist/constants/index.js +0 -1
- package/dist/examples/delegated-inference/consumer.js +2 -3
- package/dist/examples/download-with-cancel.js +4 -3
- package/dist/examples/embed-hyperdrive.d.ts +2 -0
- package/dist/examples/embed-hyperdrive.js +19 -0
- package/dist/examples/kv-cache-cleanup.js +2 -1
- package/dist/examples/kv-cache-custom-key.js +2 -16
- package/dist/examples/kv-cache-example.js +2 -1
- package/dist/examples/llamacpp-file-logging.d.ts +2 -0
- package/dist/examples/{logging-file-transport.js → llamacpp-file-logging.js} +8 -3
- package/dist/examples/llamacpp-filesystem.js +2 -2
- package/dist/examples/llamacpp-http.js +1 -0
- package/dist/examples/llamacpp-hyperdrive.d.ts +2 -0
- package/dist/examples/{llamacpp-p2p.js → llamacpp-hyperdrive.js} +2 -1
- package/dist/examples/llamacpp-multimodal.js +4 -3
- package/dist/examples/llamacpp-native-tools.js +30 -72
- package/dist/examples/multi-model-demo.js +3 -2
- package/dist/examples/parallel-download.js +14 -46
- package/dist/examples/rag/rag-chromadb.js +1 -0
- package/dist/examples/rag/rag-hyperdb-workspaces.d.ts +2 -0
- package/dist/examples/rag/rag-hyperdb-workspaces.js +107 -0
- package/dist/examples/rag/rag-hyperdb.d.ts +2 -0
- package/dist/examples/rag/{rag-hyperdb/ingest.js → rag-hyperdb.js} +5 -10
- package/dist/examples/rag/rag-lancedb.js +1 -0
- package/dist/examples/rag/rag-sqlite.js +1 -0
- package/dist/examples/seed-hyperdrive.d.ts +2 -0
- package/dist/examples/text-to-speech.d.ts +3 -0
- package/dist/examples/{tts/utils.js → text-to-speech.js} +63 -18
- package/dist/examples/translation/translation-indic.js +1 -4
- package/dist/examples/translation/translation-llm-context.js +1 -0
- package/dist/examples/translation/translation-llm.js +2 -2
- package/dist/examples/translation/translation-opus.js +3 -6
- package/dist/examples/translation/translation-stream.js +3 -3
- package/dist/examples/whispercpp-filesystem.js +43 -0
- package/dist/examples/{transcription/whispercpp-microphone-record.js → whispercpp-microphone-record.js} +9 -8
- package/dist/expo/plugins/index.d.ts +0 -3
- package/dist/expo/plugins/index.js +0 -3
- package/dist/expo/plugins/withMobileBundle.d.ts +2 -5
- package/dist/expo/plugins/withMobileBundle.js +40 -121
- package/dist/expo/plugins/withQvacSDK.d.ts +0 -4
- package/dist/expo/plugins/withQvacSDK.js +1 -26
- package/dist/index.d.ts +4 -9
- package/dist/index.js +5 -11
- package/dist/logging/base-logger.js +16 -26
- package/dist/logging/index.d.ts +1 -7
- package/dist/logging/index.js +1 -7
- package/dist/logging/logger.d.ts +2 -0
- package/dist/logging/logger.js +6 -11
- package/dist/logging/stream-logger.d.ts +1 -1
- package/dist/logging/stream-logger.js +3 -6
- package/dist/logging/transport.js +2 -2
- package/dist/logging/types.d.ts +0 -2
- package/dist/logging/utils.d.ts +0 -2
- package/dist/logging/utils.js +0 -62
- package/dist/models/{registry → hyperdrive}/index.js +1 -1
- package/dist/models/hyperdrive/models.d.ts +619 -0
- package/dist/models/hyperdrive/models.js +693 -0
- package/dist/schemas/cancel.d.ts +0 -18
- package/dist/schemas/cancel.js +0 -7
- package/dist/schemas/common.d.ts +166 -3012
- package/dist/schemas/common.js +4 -27
- package/dist/schemas/completion-stream.d.ts +60 -31
- package/dist/schemas/completion-stream.js +44 -20
- package/dist/schemas/delegate.d.ts +0 -9
- package/dist/schemas/delegate.js +2 -6
- package/dist/schemas/download-asset.d.ts +3 -125
- package/dist/schemas/download-asset.js +5 -22
- package/dist/schemas/embed.d.ts +3 -3
- package/dist/schemas/embed.js +2 -9
- package/dist/schemas/index.d.ts +2 -20
- package/dist/schemas/index.js +2 -20
- package/dist/schemas/llamacpp-config.d.ts +12 -243
- package/dist/schemas/llamacpp-config.js +14 -50
- package/dist/schemas/load-model.d.ts +893 -14471
- package/dist/schemas/load-model.js +72 -325
- package/dist/schemas/logging-stream.d.ts +4 -11
- package/dist/schemas/logging-stream.js +3 -4
- package/dist/schemas/ping.d.ts +11 -0
- package/dist/schemas/ping.js +8 -0
- package/dist/schemas/rag.d.ts +52 -183
- package/dist/schemas/rag.js +23 -152
- package/dist/schemas/text-to-speech.d.ts +1 -692
- package/dist/schemas/text-to-speech.js +3 -35
- package/dist/schemas/transcription.d.ts +0 -3
- package/dist/schemas/transcription.js +0 -1
- package/dist/schemas/translate.d.ts +23 -68
- package/dist/schemas/translate.js +11 -37
- package/dist/schemas/translation-config.d.ts +7 -810
- package/dist/schemas/translation-config.js +7 -113
- package/dist/schemas/unload-model.d.ts +0 -2
- package/dist/schemas/unload-model.js +0 -2
- package/dist/schemas/whispercpp-config.d.ts +25 -0
- package/dist/schemas/whispercpp-config.js +18 -0
- package/dist/server/bare/{ops → addons}/cancel.js +1 -2
- package/dist/server/bare/addons/index.d.ts +4 -0
- package/dist/server/bare/addons/index.js +3 -0
- package/dist/server/bare/addons/llamacpp/create-model.d.ts +5 -0
- package/dist/server/bare/addons/llamacpp/create-model.js +67 -0
- package/dist/server/bare/{plugins/llamacpp-completion/ops → addons/llamacpp/handlers}/completion-stream.d.ts +1 -2
- package/dist/server/bare/{plugins/llamacpp-completion/ops → addons/llamacpp/handlers}/completion-stream.js +87 -54
- package/dist/server/bare/addons/llamacpp/handlers/embed.d.ts +4 -0
- package/dist/server/bare/{ops → addons/llamacpp/handlers}/embed.js +7 -22
- package/dist/server/bare/addons/llamacpp/index.d.ts +4 -0
- package/dist/server/bare/addons/llamacpp/index.js +3 -0
- package/dist/server/bare/{ops → addons/llamacpp}/kv-cache-utils.d.ts +1 -4
- package/dist/server/bare/{ops → addons/llamacpp}/kv-cache-utils.js +19 -54
- package/dist/server/bare/addons/load-model.d.ts +3 -0
- package/dist/server/bare/addons/load-model.js +62 -0
- package/dist/server/bare/addons/translation/create-model.d.ts +4 -0
- package/dist/server/bare/addons/translation/create-model.js +45 -0
- package/dist/server/bare/addons/translation/handlers/translate.d.ts +3 -0
- package/dist/server/bare/{ops → addons/translation/handlers}/translate.js +14 -47
- package/dist/server/bare/addons/translation/index.d.ts +3 -0
- package/dist/server/bare/addons/translation/index.js +2 -0
- package/dist/server/bare/addons/tts/create-model.d.ts +6 -0
- package/dist/server/bare/addons/tts/create-model.js +40 -0
- package/dist/server/bare/{plugins/onnx-tts/ops → addons/tts/handlers}/text-to-speech.js +3 -25
- package/dist/server/bare/addons/tts/index.d.ts +3 -0
- package/dist/server/bare/addons/tts/index.js +2 -0
- package/dist/server/bare/addons/unload-model.js +20 -0
- package/dist/server/bare/addons/whispercpp/create-model.d.ts +6 -0
- package/dist/server/bare/addons/whispercpp/create-model.js +55 -0
- package/dist/server/bare/addons/whispercpp/handlers/transcribe-stream.d.ts +3 -0
- package/dist/server/bare/addons/whispercpp/handlers/transcribe-stream.js +48 -0
- package/dist/server/bare/addons/whispercpp/index.d.ts +3 -0
- package/dist/server/bare/addons/whispercpp/index.js +2 -0
- package/dist/server/bare/delegate-rpc-client.d.ts +0 -6
- package/dist/server/bare/delegate-rpc-client.js +45 -187
- package/dist/server/bare/hyperswarm.d.ts +0 -3
- package/dist/server/bare/hyperswarm.js +6 -29
- package/dist/server/bare/rag-hyperdb/handlers/delete-embeddings.d.ts +1 -1
- package/dist/server/bare/rag-hyperdb/handlers/delete-embeddings.js +10 -9
- package/dist/server/bare/rag-hyperdb/handlers/save-embeddings.d.ts +4 -7
- package/dist/server/bare/rag-hyperdb/handlers/save-embeddings.js +14 -13
- package/dist/server/bare/rag-hyperdb/handlers/search.js +10 -10
- package/dist/server/bare/rag-hyperdb/index.d.ts +1 -8
- package/dist/server/bare/rag-hyperdb/index.js +1 -8
- package/dist/server/bare/rag-hyperdb/rag-manager.d.ts +5 -0
- package/dist/server/bare/rag-hyperdb/rag-manager.js +65 -0
- package/dist/server/bare/registry/logging-stream-registry.d.ts +7 -24
- package/dist/server/bare/registry/logging-stream-registry.js +20 -99
- package/dist/server/bare/registry/model-registry.d.ts +26 -16
- package/dist/server/bare/registry/model-registry.js +13 -34
- package/dist/server/error-handlers.d.ts +2 -3
- package/dist/server/error-handlers.js +10 -15
- package/dist/server/http-server.d.ts +2 -0
- package/dist/server/http-server.js +189 -0
- package/dist/server/rpc/create-server.js +3 -5
- package/dist/server/rpc/handle-request.d.ts +9 -0
- package/dist/server/rpc/handle-request.js +242 -92
- package/dist/server/rpc/handlers/cancelHandler.js +3 -14
- package/dist/server/rpc/handlers/completion-stream-delegated.d.ts +1 -3
- package/dist/server/rpc/handlers/completion-stream-delegated.js +8 -20
- package/dist/server/rpc/handlers/completion-stream.js +41 -2
- package/dist/server/rpc/handlers/delete-cache.js +2 -4
- package/dist/server/rpc/handlers/download-asset.js +6 -59
- package/dist/server/rpc/handlers/embed.js +19 -2
- package/dist/server/rpc/handlers/index.d.ts +0 -13
- package/dist/server/rpc/handlers/index.js +0 -13
- package/dist/server/rpc/handlers/load-model/download-manager.d.ts +11 -12
- package/dist/server/rpc/handlers/load-model/download-manager.js +28 -43
- package/dist/server/rpc/handlers/load-model/http.d.ts +1 -2
- package/dist/server/rpc/handlers/load-model/http.js +55 -424
- package/dist/server/rpc/handlers/load-model/hyperdrive.d.ts +1 -2
- package/dist/server/rpc/handlers/load-model/hyperdrive.js +171 -364
- package/dist/server/rpc/handlers/load-model/index.d.ts +2 -2
- package/dist/server/rpc/handlers/load-model/index.js +2 -2
- package/dist/server/rpc/handlers/load-model/resolve.d.ts +1 -3
- package/dist/server/rpc/handlers/load-model/resolve.js +29 -110
- package/dist/server/rpc/handlers/load-model-delegated.d.ts +2 -6
- package/dist/server/rpc/handlers/load-model-delegated.js +20 -60
- package/dist/server/rpc/handlers/{load-model/handler.d.ts → load-model.d.ts} +2 -2
- package/dist/server/rpc/handlers/load-model.js +57 -0
- package/dist/server/rpc/handlers/logging-stream.js +4 -4
- package/dist/server/rpc/handlers/provideHandler/connection.js +10 -12
- package/dist/server/rpc/handlers/provideHandler/handler.js +17 -20
- package/dist/server/rpc/handlers/provideHandler/proxy.js +6 -8
- package/dist/server/rpc/handlers/rag.d.ts +2 -2
- package/dist/server/rpc/handlers/rag.js +43 -130
- package/dist/server/rpc/handlers/stopProvideHandler.js +2 -6
- package/dist/server/rpc/handlers/text-to-speech.js +5 -2
- package/dist/server/rpc/handlers/transcribe-stream.js +24 -2
- package/dist/server/rpc/handlers/translate.js +49 -2
- package/dist/server/rpc/handlers/unload-model.js +3 -12
- package/dist/server/rpc/index.d.ts +1 -1
- package/dist/server/utils/audio/decoder.d.ts +1 -2
- package/dist/server/utils/audio/decoder.js +12 -49
- package/dist/server/utils/cache.d.ts +8 -19
- package/dist/server/utils/cache.js +15 -100
- package/dist/server/utils/hash.d.ts +5 -0
- package/dist/server/utils/hash.js +11 -0
- package/dist/server/utils/index.d.ts +2 -7
- package/dist/server/utils/index.js +2 -7
- package/dist/server/utils/tool-parser.js +14 -28
- package/dist/server/worker.d.ts +5 -4
- package/dist/server/worker.js +89 -22
- package/package.json +41 -148
- package/NOTICE +0 -695
- package/bare-imports.json +0 -44
- package/dist/client/api/get-model-info.d.ts +0 -36
- package/dist/client/api/get-model-info.js +0 -14
- package/dist/client/api/heartbeat.d.ts +0 -30
- package/dist/client/api/heartbeat.js +0 -38
- package/dist/client/api/invoke-plugin.d.ts +0 -15
- package/dist/client/api/invoke-plugin.js +0 -38
- package/dist/client/api/ocr.d.ts +0 -31
- package/dist/client/api/ocr.js +0 -88
- package/dist/client/api/registry.d.ts +0 -14
- package/dist/client/api/registry.js +0 -37
- package/dist/client/config-loader/config-utils.d.ts +0 -5
- package/dist/client/config-loader/config-utils.js +0 -20
- package/dist/client/config-loader/resolve-config.bare.d.ts +0 -9
- package/dist/client/config-loader/resolve-config.bare.js +0 -87
- package/dist/client/config-loader/resolve-config.expo.d.ts +0 -11
- package/dist/client/config-loader/resolve-config.expo.js +0 -62
- package/dist/client/config-loader/resolve-config.node.d.ts +0 -10
- package/dist/client/config-loader/resolve-config.node.js +0 -145
- package/dist/client/init-hooks.d.ts +0 -21
- package/dist/client/init-hooks.js +0 -66
- package/dist/client/rpc/expo-device-info.d.ts +0 -6
- package/dist/client/rpc/expo-device-info.js +0 -32
- package/dist/client/rpc/profiling/index.d.ts +0 -2
- package/dist/client/rpc/profiling/index.js +0 -1
- package/dist/client/rpc/profiling/profiler.d.ts +0 -27
- package/dist/client/rpc/profiling/profiler.js +0 -139
- package/dist/constants/registry.d.ts +0 -2
- package/dist/constants/registry.js +0 -1
- package/dist/examples/cache-management.d.ts +0 -2
- package/dist/examples/cache-management.js +0 -97
- package/dist/examples/config/blind-relay/blind-relay.config.d.ts +0 -5
- package/dist/examples/config/blind-relay/blind-relay.config.js +0 -7
- package/dist/examples/config/default/default.config.d.ts +0 -8
- package/dist/examples/config/default/default.config.js +0 -6
- package/dist/examples/config/plugins/plugins.config.d.ts +0 -5
- package/dist/examples/config/plugins/plugins.config.js +0 -4
- package/dist/examples/config-reload.d.ts +0 -2
- package/dist/examples/config-reload.js +0 -49
- package/dist/examples/default-config-usage.d.ts +0 -17
- package/dist/examples/default-config-usage.js +0 -47
- package/dist/examples/delegated-inference/consumer-profiled.d.ts +0 -2
- package/dist/examples/delegated-inference/consumer-profiled.js +0 -67
- package/dist/examples/download-with-blind-relays.d.ts +0 -2
- package/dist/examples/download-with-blind-relays.js +0 -49
- package/dist/examples/embed-p2p.d.ts +0 -2
- package/dist/examples/embed-p2p.js +0 -54
- package/dist/examples/llamacpp-p2p.d.ts +0 -2
- package/dist/examples/llamacpp-sharded.d.ts +0 -2
- package/dist/examples/llamacpp-sharded.js +0 -53
- package/dist/examples/logging-file-transport.d.ts +0 -2
- package/dist/examples/logging-streaming.d.ts +0 -2
- package/dist/examples/logging-streaming.js +0 -75
- package/dist/examples/mcp-websearch.d.ts +0 -13
- package/dist/examples/mcp-websearch.js +0 -176
- package/dist/examples/ocr-fasttext.d.ts +0 -2
- package/dist/examples/ocr-fasttext.js +0 -52
- package/dist/examples/plugins.d.ts +0 -14
- package/dist/examples/plugins.js +0 -129
- package/dist/examples/profiling/basic.d.ts +0 -2
- package/dist/examples/profiling/basic.js +0 -71
- package/dist/examples/profiling/per-call.d.ts +0 -2
- package/dist/examples/profiling/per-call.js +0 -30
- package/dist/examples/quickstart.d.ts +0 -2
- package/dist/examples/quickstart.js +0 -28
- package/dist/examples/rag/rag-hyperdb/cancellation.d.ts +0 -2
- package/dist/examples/rag/rag-hyperdb/cancellation.js +0 -75
- package/dist/examples/rag/rag-hyperdb/ingest.d.ts +0 -2
- package/dist/examples/rag/rag-hyperdb/pipeline.d.ts +0 -2
- package/dist/examples/rag/rag-hyperdb/pipeline.js +0 -74
- package/dist/examples/rag/rag-hyperdb/workspaces.d.ts +0 -2
- package/dist/examples/rag/rag-hyperdb/workspaces.js +0 -178
- package/dist/examples/registry-query.d.ts +0 -2
- package/dist/examples/registry-query.js +0 -87
- package/dist/examples/seed-p2p.d.ts +0 -2
- package/dist/examples/transcription/parakeet-ctc-filesystem.d.ts +0 -2
- package/dist/examples/transcription/parakeet-ctc-filesystem.js +0 -40
- package/dist/examples/transcription/parakeet-microphone-record.d.ts +0 -2
- package/dist/examples/transcription/parakeet-microphone-record.js +0 -95
- package/dist/examples/transcription/parakeet-sortformer.d.ts +0 -2
- package/dist/examples/transcription/parakeet-sortformer.js +0 -115
- package/dist/examples/transcription/parakeet-tdt-filesystem.d.ts +0 -2
- package/dist/examples/transcription/parakeet-tdt-filesystem.js +0 -44
- package/dist/examples/transcription/whispercpp-filesystem.js +0 -69
- package/dist/examples/transcription/whispercpp-prompt.d.ts +0 -2
- package/dist/examples/transcription/whispercpp-prompt.js +0 -67
- package/dist/examples/translation/translation-bergamot-batch.d.ts +0 -2
- package/dist/examples/translation/translation-bergamot-batch.js +0 -49
- package/dist/examples/translation/translation-bergamot-pivot.d.ts +0 -2
- package/dist/examples/translation/translation-bergamot-pivot.js +0 -73
- package/dist/examples/translation/translation-bergamot.d.ts +0 -2
- package/dist/examples/translation/translation-bergamot.js +0 -39
- package/dist/examples/translation/translation-llm-afriquegemma.d.ts +0 -2
- package/dist/examples/translation/translation-llm-afriquegemma.js +0 -39
- package/dist/examples/tts/chatterbox.d.ts +0 -2
- package/dist/examples/tts/chatterbox.js +0 -59
- package/dist/examples/tts/supertonic.d.ts +0 -2
- package/dist/examples/tts/supertonic.js +0 -51
- package/dist/examples/tts/utils.d.ts +0 -17
- package/dist/expo/plugins/resolve-sdk-package-dir.d.ts +0 -15
- package/dist/expo/plugins/resolve-sdk-package-dir.js +0 -31
- package/dist/expo/plugins/withAndroidArchitecture.d.ts +0 -8
- package/dist/expo/plugins/withAndroidArchitecture.js +0 -52
- package/dist/expo/plugins/withAndroidNdkVersion.d.ts +0 -8
- package/dist/expo/plugins/withAndroidNdkVersion.js +0 -31
- package/dist/expo/plugins/withDeviceInfo.d.ts +0 -10
- package/dist/expo/plugins/withDeviceInfo.js +0 -48
- package/dist/logging/addon.d.ts +0 -6
- package/dist/logging/addon.js +0 -75
- package/dist/logging/client-logger.d.ts +0 -3
- package/dist/logging/client-logger.js +0 -24
- package/dist/logging/namespaces.d.ts +0 -6
- package/dist/logging/namespaces.js +0 -6
- package/dist/logging/registry.d.ts +0 -31
- package/dist/logging/registry.js +0 -62
- package/dist/logging/server-logger.d.ts +0 -3
- package/dist/logging/server-logger.js +0 -16
- package/dist/models/registry/models.d.ts +0 -10417
- package/dist/models/registry/models.js +0 -10757
- package/dist/models/update-models/codegen.d.ts +0 -3
- package/dist/models/update-models/codegen.js +0 -135
- 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 -125
- package/dist/models/update-models/naming.d.ts +0 -4
- package/dist/models/update-models/naming.js +0 -370
- package/dist/models/update-models/processing.d.ts +0 -8
- package/dist/models/update-models/processing.js +0 -67
- package/dist/models/update-models/registry.d.ts +0 -4
- package/dist/models/update-models/registry.js +0 -67
- 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 -60
- 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/pear/pre.d.ts +0 -18
- package/dist/pear/pre.js +0 -433
- package/dist/profiling/aggregator.d.ts +0 -15
- package/dist/profiling/aggregator.js +0 -100
- package/dist/profiling/clock.d.ts +0 -12
- package/dist/profiling/clock.js +0 -51
- package/dist/profiling/controller.d.ts +0 -33
- package/dist/profiling/controller.js +0 -123
- package/dist/profiling/envelope.d.ts +0 -10
- package/dist/profiling/envelope.js +0 -36
- package/dist/profiling/events.d.ts +0 -20
- package/dist/profiling/events.js +0 -37
- package/dist/profiling/exporters.d.ts +0 -10
- package/dist/profiling/exporters.js +0 -236
- package/dist/profiling/index.d.ts +0 -36
- package/dist/profiling/index.js +0 -31
- package/dist/profiling/ring-buffer.d.ts +0 -19
- package/dist/profiling/ring-buffer.js +0 -83
- package/dist/profiling/types.d.ts +0 -47
- package/dist/profiling/types.js +0 -1
- package/dist/schemas/archive.d.ts +0 -9
- package/dist/schemas/archive.js +0 -17
- package/dist/schemas/engine-addon-map.d.ts +0 -5
- package/dist/schemas/engine-addon-map.js +0 -52
- package/dist/schemas/get-model-info.d.ts +0 -120
- package/dist/schemas/get-model-info.js +0 -58
- package/dist/schemas/heartbeat.d.ts +0 -17
- package/dist/schemas/heartbeat.js +0 -10
- package/dist/schemas/json-schema.d.ts +0 -16
- package/dist/schemas/json-schema.js +0 -2
- package/dist/schemas/mcp-adapter.d.ts +0 -47
- package/dist/schemas/mcp-adapter.js +0 -1
- package/dist/schemas/model-src-utils.d.ts +0 -148
- package/dist/schemas/model-src-utils.js +0 -35
- package/dist/schemas/model-types.d.ts +0 -183
- package/dist/schemas/model-types.js +0 -168
- package/dist/schemas/ocr.d.ts +0 -125
- package/dist/schemas/ocr.js +0 -57
- package/dist/schemas/path-validation.d.ts +0 -10
- package/dist/schemas/path-validation.js +0 -22
- package/dist/schemas/plugin.d.ts +0 -226
- package/dist/schemas/plugin.js +0 -158
- package/dist/schemas/profiling.d.ts +0 -105
- package/dist/schemas/profiling.js +0 -66
- package/dist/schemas/registry.d.ts +0 -356
- package/dist/schemas/registry.js +0 -93
- package/dist/schemas/reload-config.d.ts +0 -476
- package/dist/schemas/reload-config.js +0 -44
- package/dist/schemas/runtime-context.d.ts +0 -19
- package/dist/schemas/runtime-context.js +0 -7
- package/dist/schemas/sdk-config.d.ts +0 -2973
- package/dist/schemas/sdk-config.js +0 -136
- package/dist/schemas/sdk-errors-client.d.ts +0 -31
- package/dist/schemas/sdk-errors-client.js +0 -143
- package/dist/schemas/sdk-errors-registry.d.ts +0 -6
- package/dist/schemas/sdk-errors-registry.js +0 -8
- package/dist/schemas/sdk-errors-server.d.ts +0 -89
- package/dist/schemas/sdk-errors-server.js +0 -451
- package/dist/schemas/shard.d.ts +0 -21
- package/dist/schemas/shard.js +0 -17
- package/dist/schemas/tools.d.ts +0 -65
- package/dist/schemas/tools.js +0 -43
- package/dist/schemas/transcription-config.d.ts +0 -383
- package/dist/schemas/transcription-config.js +0 -95
- package/dist/scripts/run-security-tests-bare.d.ts +0 -2
- package/dist/scripts/run-security-tests-bare.js +0 -78
- package/dist/scripts/run-security-tests.d.ts +0 -2
- package/dist/scripts/run-security-tests.js +0 -22
- package/dist/scripts/run-unit-tests.d.ts +0 -2
- package/dist/scripts/run-unit-tests.js +0 -17
- package/dist/server/bare/ops/embed.d.ts +0 -12
- package/dist/server/bare/ops/load-model.d.ts +0 -9
- package/dist/server/bare/ops/load-model.js +0 -85
- package/dist/server/bare/ops/transcribe.d.ts +0 -3
- package/dist/server/bare/ops/transcribe.js +0 -75
- package/dist/server/bare/ops/translate.d.ts +0 -5
- package/dist/server/bare/ops/unload-model.js +0 -41
- package/dist/server/bare/plugins/index.d.ts +0 -8
- package/dist/server/bare/plugins/index.js +0 -7
- package/dist/server/bare/plugins/llamacpp-completion/ops/cache-logger.d.ts +0 -6
- package/dist/server/bare/plugins/llamacpp-completion/ops/cache-logger.js +0 -34
- package/dist/server/bare/plugins/llamacpp-completion/plugin.d.ts +0 -220
- package/dist/server/bare/plugins/llamacpp-completion/plugin.js +0 -155
- package/dist/server/bare/plugins/llamacpp-embedding/plugin.d.ts +0 -54
- package/dist/server/bare/plugins/llamacpp-embedding/plugin.js +0 -87
- package/dist/server/bare/plugins/nmtcpp-translation/plugin.d.ts +0 -367
- package/dist/server/bare/plugins/nmtcpp-translation/plugin.js +0 -201
- package/dist/server/bare/plugins/onnx-ocr/ops/ocr-stream.d.ts +0 -10
- package/dist/server/bare/plugins/onnx-ocr/ops/ocr-stream.js +0 -110
- package/dist/server/bare/plugins/onnx-ocr/plugin.d.ts +0 -86
- package/dist/server/bare/plugins/onnx-ocr/plugin.js +0 -117
- package/dist/server/bare/plugins/onnx-tts/plugin.d.ts +0 -373
- package/dist/server/bare/plugins/onnx-tts/plugin.js +0 -182
- package/dist/server/bare/plugins/onnx-tts/wav-helper.d.ts +0 -14
- package/dist/server/bare/plugins/onnx-tts/wav-helper.js +0 -107
- package/dist/server/bare/plugins/parakeet-transcription/plugin.d.ts +0 -317
- package/dist/server/bare/plugins/parakeet-transcription/plugin.js +0 -154
- package/dist/server/bare/plugins/whispercpp-transcription/plugin.d.ts +0 -237
- package/dist/server/bare/plugins/whispercpp-transcription/plugin.js +0 -86
- package/dist/server/bare/rag-hyperdb/handlers/chunk.d.ts +0 -3
- package/dist/server/bare/rag-hyperdb/handlers/chunk.js +0 -7
- package/dist/server/bare/rag-hyperdb/handlers/close-workspace.d.ts +0 -3
- package/dist/server/bare/rag-hyperdb/handlers/close-workspace.js +0 -9
- package/dist/server/bare/rag-hyperdb/handlers/delete-workspace.d.ts +0 -3
- package/dist/server/bare/rag-hyperdb/handlers/delete-workspace.js +0 -14
- package/dist/server/bare/rag-hyperdb/handlers/ingest.d.ts +0 -9
- package/dist/server/bare/rag-hyperdb/handlers/ingest.js +0 -18
- package/dist/server/bare/rag-hyperdb/handlers/list-workspaces.d.ts +0 -3
- package/dist/server/bare/rag-hyperdb/handlers/list-workspaces.js +0 -4
- package/dist/server/bare/rag-hyperdb/handlers/reindex.d.ts +0 -9
- package/dist/server/bare/rag-hyperdb/handlers/reindex.js +0 -16
- package/dist/server/bare/rag-hyperdb/rag-operation-manager.d.ts +0 -7
- package/dist/server/bare/rag-hyperdb/rag-operation-manager.js +0 -39
- package/dist/server/bare/rag-hyperdb/rag-workspace-manager.d.ts +0 -15
- package/dist/server/bare/rag-hyperdb/rag-workspace-manager.js +0 -136
- package/dist/server/bare/registry/config-registry.d.ts +0 -14
- package/dist/server/bare/registry/config-registry.js +0 -82
- package/dist/server/bare/registry/model-config-registry.d.ts +0 -4
- package/dist/server/bare/registry/model-config-registry.js +0 -15
- package/dist/server/bare/registry/model-config-utils.d.ts +0 -15
- package/dist/server/bare/registry/model-config-utils.js +0 -112
- package/dist/server/bare/registry/registry-client.d.ts +0 -5
- package/dist/server/bare/registry/registry-client.js +0 -37
- package/dist/server/bare/registry/runtime-context-registry.d.ts +0 -7
- package/dist/server/bare/registry/runtime-context-registry.js +0 -26
- package/dist/server/bare/utils/audio-input.d.ts +0 -10
- package/dist/server/bare/utils/audio-input.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/env.d.ts +0 -22
- package/dist/server/env.js +0 -57
- package/dist/server/plugins/index.d.ts +0 -2
- package/dist/server/plugins/index.js +0 -1
- package/dist/server/plugins/registry.d.ts +0 -9
- package/dist/server/plugins/registry.js +0 -79
- package/dist/server/rpc/delegate-transport.d.ts +0 -19
- package/dist/server/rpc/delegate-transport.js +0 -236
- package/dist/server/rpc/delegate-utils.d.ts +0 -2
- package/dist/server/rpc/delegate-utils.js +0 -5
- package/dist/server/rpc/handler-registry.d.ts +0 -3
- package/dist/server/rpc/handler-registry.js +0 -113
- package/dist/server/rpc/handler-utils.d.ts +0 -23
- package/dist/server/rpc/handler-utils.js +0 -170
- package/dist/server/rpc/handlers/cancel-delegated.d.ts +0 -4
- package/dist/server/rpc/handlers/cancel-delegated.js +0 -71
- package/dist/server/rpc/handlers/get-model-info.d.ts +0 -3
- package/dist/server/rpc/handlers/get-model-info.js +0 -164
- package/dist/server/rpc/handlers/heartbeat-delegated.d.ts +0 -4
- package/dist/server/rpc/handlers/heartbeat-delegated.js +0 -32
- package/dist/server/rpc/handlers/heartbeat.d.ts +0 -3
- package/dist/server/rpc/handlers/heartbeat.js +0 -3
- package/dist/server/rpc/handlers/load-model/download-stats.d.ts +0 -6
- package/dist/server/rpc/handlers/load-model/download-stats.js +0 -87
- package/dist/server/rpc/handlers/load-model/handler.js +0 -187
- package/dist/server/rpc/handlers/load-model/registry.d.ts +0 -11
- package/dist/server/rpc/handlers/load-model/registry.js +0 -548
- package/dist/server/rpc/handlers/load-model/types.d.ts +0 -29
- package/dist/server/rpc/handlers/load-model/types.js +0 -1
- package/dist/server/rpc/handlers/ocr-stream.d.ts +0 -3
- package/dist/server/rpc/handlers/ocr-stream.js +0 -4
- package/dist/server/rpc/handlers/plugin-dispatch.d.ts +0 -15
- package/dist/server/rpc/handlers/plugin-dispatch.js +0 -59
- package/dist/server/rpc/handlers/plugin-invoke.d.ts +0 -4
- package/dist/server/rpc/handlers/plugin-invoke.js +0 -92
- package/dist/server/rpc/handlers/registry.d.ts +0 -5
- package/dist/server/rpc/handlers/registry.js +0 -157
- package/dist/server/rpc/handlers/unload-model-delegated.d.ts +0 -3
- package/dist/server/rpc/handlers/unload-model-delegated.js +0 -32
- package/dist/server/rpc/profiling/context.d.ts +0 -18
- package/dist/server/rpc/profiling/context.js +0 -38
- package/dist/server/rpc/profiling/delegation-profiler.d.ts +0 -32
- package/dist/server/rpc/profiling/delegation-profiler.js +0 -154
- package/dist/server/rpc/profiling/index.d.ts +0 -5
- package/dist/server/rpc/profiling/index.js +0 -4
- package/dist/server/rpc/profiling/operation-metrics.d.ts +0 -25
- package/dist/server/rpc/profiling/operation-metrics.js +0 -199
- package/dist/server/rpc/profiling/operation-wrappers.d.ts +0 -18
- package/dist/server/rpc/profiling/operation-wrappers.js +0 -124
- package/dist/server/rpc/profiling/profiler.d.ts +0 -13
- package/dist/server/rpc/profiling/profiler.js +0 -97
- package/dist/server/utils/archive.d.ts +0 -4
- package/dist/server/utils/archive.js +0 -179
- package/dist/server/utils/checksum.d.ts +0 -4
- package/dist/server/utils/checksum.js +0 -31
- package/dist/server/utils/config-transform.d.ts +0 -3
- package/dist/server/utils/config-transform.js +0 -23
- package/dist/server/utils/formatting.d.ts +0 -19
- package/dist/server/utils/formatting.js +0 -61
- package/dist/server/utils/gguf-tensor-extractor.d.ts +0 -15
- package/dist/server/utils/gguf-tensor-extractor.js +0 -314
- package/dist/server/utils/path-security.d.ts +0 -12
- package/dist/server/utils/path-security.js +0 -25
- package/dist/server/utils/shard-utils.d.ts +0 -48
- package/dist/server/utils/shard-utils.js +0 -125
- package/dist/server/utils/tool-integration.d.ts +0 -13
- package/dist/server/utils/tool-integration.js +0 -43
- package/dist/server/worker-core.d.ts +0 -6
- package/dist/server/worker-core.js +0 -88
- package/dist/utils/errors-base.d.ts +0 -3
- package/dist/utils/errors-base.js +0 -13
- package/dist/utils/errors-client.d.ts +0 -137
- package/dist/utils/errors-client.js +0 -240
- package/dist/utils/errors-server.d.ts +0 -236
- package/dist/utils/errors-server.js +0 -412
- package/dist/utils/global-singleton.d.ts +0 -2
- package/dist/utils/global-singleton.js +0 -10
- package/dist/utils/mcp-adapter.d.ts +0 -12
- package/dist/utils/mcp-adapter.js +0 -103
- package/dist/utils/object.d.ts +0 -2
- package/dist/utils/object.js +0 -3
- package/dist/utils/path-sanitize.d.ts +0 -17
- package/dist/utils/path-sanitize.js +0 -54
- package/dist/utils/tool-helpers.d.ts +0 -25
- package/dist/utils/tool-helpers.js +0 -112
- package/expo/plugins/patches/android-link.mjs +0 -63
- package/expo/plugins/patches/ios-link.mjs +0 -63
- /package/dist/examples/{seed-p2p.js → seed-hyperdrive.js} +0 -0
- /package/dist/examples/{transcription/whispercpp-filesystem.d.ts → whispercpp-filesystem.d.ts} +0 -0
- /package/dist/examples/{transcription/whispercpp-microphone-record.d.ts → whispercpp-microphone-record.d.ts} +0 -0
- /package/dist/models/{registry → hyperdrive}/index.d.ts +0 -0
- /package/dist/server/bare/{ops → addons}/cancel.d.ts +0 -0
- /package/dist/server/bare/{plugins/onnx-tts/ops → addons/tts/handlers}/text-to-speech.d.ts +0 -0
- /package/dist/server/bare/{ops → addons}/unload-model.d.ts +0 -0
|
@@ -3,13 +3,11 @@ import { type CancelParams } from "../../schemas/index";
|
|
|
3
3
|
* Cancels an ongoing operation.
|
|
4
4
|
*
|
|
5
5
|
* @param params - The parameters for the cancellation
|
|
6
|
-
* @param params.operation - The type of operation to cancel ("inference"
|
|
6
|
+
* @param params.operation - The type of operation to cancel ("inference" or "download")
|
|
7
7
|
* @param params.modelId - The model ID (required for inference cancellation)
|
|
8
8
|
* @param params.downloadKey - The download key (required for download cancellation)
|
|
9
9
|
* @param params.clearCache - If true, deletes the partial download file (default: false)
|
|
10
|
-
* @
|
|
11
|
-
* @param params.workspace - The RAG workspace to cancel (optional, defaults to "default")
|
|
12
|
-
* @throws {QvacErrorBase} When the response type is invalid or when the cancellation fails
|
|
10
|
+
* @throws {Error} When the response type is invalid or when the cancellation fails
|
|
13
11
|
*
|
|
14
12
|
* @example
|
|
15
13
|
* // Cancel inference
|
|
@@ -17,27 +15,11 @@ import { type CancelParams } from "../../schemas/index";
|
|
|
17
15
|
*
|
|
18
16
|
* @example
|
|
19
17
|
* // Pause download (preserves partial file for automatic resume)
|
|
20
|
-
* await cancel({ operation: "
|
|
18
|
+
* await cancel({ operation: "download", downloadKey: "download-key" });
|
|
21
19
|
*
|
|
22
20
|
* @example
|
|
23
21
|
* // Cancel download completely (deletes partial file)
|
|
24
|
-
* await cancel({ operation: "
|
|
25
|
-
*
|
|
26
|
-
* @example
|
|
27
|
-
* // Cancel delegated remote download
|
|
28
|
-
* await cancel({
|
|
29
|
-
* operation: "downloadAsset",
|
|
30
|
-
* downloadKey: "download-key",
|
|
31
|
-
* delegate: { topic: "topicHex", providerPublicKey: "peerHex" },
|
|
32
|
-
* });
|
|
33
|
-
*
|
|
34
|
-
* @example
|
|
35
|
-
* // Cancel RAG operation on default workspace
|
|
36
|
-
* await cancel({ operation: "rag" });
|
|
37
|
-
*
|
|
38
|
-
* @example
|
|
39
|
-
* // Cancel RAG operation on specific workspace
|
|
40
|
-
* await cancel({ operation: "rag", workspace: "my-workspace" });
|
|
22
|
+
* await cancel({ operation: "download", downloadKey: "download-key", clearCache: true });
|
|
41
23
|
*/
|
|
42
24
|
export declare function cancel(params: CancelParams): Promise<void>;
|
|
43
25
|
//# sourceMappingURL=cancel.d.ts.map
|
|
@@ -1,17 +1,14 @@
|
|
|
1
1
|
import { send } from "../rpc/rpc-client.js";
|
|
2
2
|
import {} from "../../schemas/index.js";
|
|
3
|
-
import { InvalidResponseError, CancelFailedError } from "../../utils/errors-client.js";
|
|
4
3
|
/**
|
|
5
4
|
* Cancels an ongoing operation.
|
|
6
5
|
*
|
|
7
6
|
* @param params - The parameters for the cancellation
|
|
8
|
-
* @param params.operation - The type of operation to cancel ("inference"
|
|
7
|
+
* @param params.operation - The type of operation to cancel ("inference" or "download")
|
|
9
8
|
* @param params.modelId - The model ID (required for inference cancellation)
|
|
10
9
|
* @param params.downloadKey - The download key (required for download cancellation)
|
|
11
10
|
* @param params.clearCache - If true, deletes the partial download file (default: false)
|
|
12
|
-
* @
|
|
13
|
-
* @param params.workspace - The RAG workspace to cancel (optional, defaults to "default")
|
|
14
|
-
* @throws {QvacErrorBase} When the response type is invalid or when the cancellation fails
|
|
11
|
+
* @throws {Error} When the response type is invalid or when the cancellation fails
|
|
15
12
|
*
|
|
16
13
|
* @example
|
|
17
14
|
* // Cancel inference
|
|
@@ -19,27 +16,11 @@ import { InvalidResponseError, CancelFailedError } from "../../utils/errors-clie
|
|
|
19
16
|
*
|
|
20
17
|
* @example
|
|
21
18
|
* // Pause download (preserves partial file for automatic resume)
|
|
22
|
-
* await cancel({ operation: "
|
|
19
|
+
* await cancel({ operation: "download", downloadKey: "download-key" });
|
|
23
20
|
*
|
|
24
21
|
* @example
|
|
25
22
|
* // Cancel download completely (deletes partial file)
|
|
26
|
-
* await cancel({ operation: "
|
|
27
|
-
*
|
|
28
|
-
* @example
|
|
29
|
-
* // Cancel delegated remote download
|
|
30
|
-
* await cancel({
|
|
31
|
-
* operation: "downloadAsset",
|
|
32
|
-
* downloadKey: "download-key",
|
|
33
|
-
* delegate: { topic: "topicHex", providerPublicKey: "peerHex" },
|
|
34
|
-
* });
|
|
35
|
-
*
|
|
36
|
-
* @example
|
|
37
|
-
* // Cancel RAG operation on default workspace
|
|
38
|
-
* await cancel({ operation: "rag" });
|
|
39
|
-
*
|
|
40
|
-
* @example
|
|
41
|
-
* // Cancel RAG operation on specific workspace
|
|
42
|
-
* await cancel({ operation: "rag", workspace: "my-workspace" });
|
|
23
|
+
* await cancel({ operation: "download", downloadKey: "download-key", clearCache: true });
|
|
43
24
|
*/
|
|
44
25
|
export async function cancel(params) {
|
|
45
26
|
const request = {
|
|
@@ -48,9 +29,9 @@ export async function cancel(params) {
|
|
|
48
29
|
};
|
|
49
30
|
const response = await send(request);
|
|
50
31
|
if (response.type !== "cancel") {
|
|
51
|
-
throw new
|
|
32
|
+
throw new Error("Invalid response type");
|
|
52
33
|
}
|
|
53
34
|
if (!response.success) {
|
|
54
|
-
throw new
|
|
35
|
+
throw new Error(response.error ?? "Failed to cancel");
|
|
55
36
|
}
|
|
56
37
|
}
|
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import { type ToolInput } from "../../utils/tool-helpers";
|
|
3
|
-
type CompletionParams = Omit<CompletionClientParams, "tools"> & {
|
|
4
|
-
tools?: Tool[] | ToolInput[];
|
|
5
|
-
mcp?: McpClientInput[];
|
|
6
|
-
rpcOptions?: RPCOptions;
|
|
7
|
-
};
|
|
1
|
+
import { type CompletionStats, type CompletionClientParams, type ToolCall, type ToolCallEvent } from "../../schemas/index";
|
|
8
2
|
/**
|
|
9
3
|
* Generates completion from a language model based on conversation history.
|
|
10
4
|
*
|
|
@@ -12,8 +6,7 @@ type CompletionParams = Omit<CompletionClientParams, "tools"> & {
|
|
|
12
6
|
* @param params.modelId - The identifier of the model to use for completion
|
|
13
7
|
* @param params.history - Array of conversation messages with role, content, and optional attachments
|
|
14
8
|
* @param params.stream - Whether to stream tokens (true) or return complete response (false). Defaults to true
|
|
15
|
-
* @param params.tools - Optional array of tools
|
|
16
|
-
* @param params.mcp - Optional array of MCP client inputs for tool integration
|
|
9
|
+
* @param params.tools - Optional array of tools that can be used by the model
|
|
17
10
|
* @param params.kvCache - Optional KV cache configuration. Cache files are organized hierarchically:
|
|
18
11
|
* - Structure: `{kvCacheKey}/{modelId}/{configHash}.bin`
|
|
19
12
|
* - The configHash includes model config + system prompt to ensure cache isolation
|
|
@@ -22,11 +15,10 @@ type CompletionParams = Omit<CompletionClientParams, "tools"> & {
|
|
|
22
15
|
* - `false` or `undefined`: No caching
|
|
23
16
|
* - ⚡ Performance: When cache exists, only the last message is sent to the model (includes multimodal attachments)
|
|
24
17
|
* - 🗑️ Cleanup: Use `deleteCache({ kvCacheKey })` to remove cached sessions
|
|
25
|
-
* @returns Object with tokenStream generator, toolCallStream generator, text promise, toolCalls promise
|
|
18
|
+
* @returns Object with tokenStream generator, toolCallStream generator, text promise, toolCalls promise, and stats promise
|
|
26
19
|
* @example
|
|
27
20
|
* ```typescript
|
|
28
|
-
*
|
|
29
|
-
*
|
|
21
|
+
* // Streaming mode with tools
|
|
30
22
|
* const result = completion({
|
|
31
23
|
* modelId: "llama-2",
|
|
32
24
|
* history: [
|
|
@@ -34,13 +26,15 @@ type CompletionParams = Omit<CompletionClientParams, "tools"> & {
|
|
|
34
26
|
* ],
|
|
35
27
|
* stream: true,
|
|
36
28
|
* tools: [{
|
|
29
|
+
* type: "function",
|
|
37
30
|
* name: "get_weather",
|
|
38
31
|
* description: "Get current weather",
|
|
39
|
-
* parameters:
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
32
|
+
* parameters: {
|
|
33
|
+
* type: "object",
|
|
34
|
+
* properties: {
|
|
35
|
+
* city: { type: "string" }
|
|
36
|
+
* },
|
|
37
|
+
* required: ["city"]
|
|
44
38
|
* }
|
|
45
39
|
* }]
|
|
46
40
|
* });
|
|
@@ -49,20 +43,32 @@ type CompletionParams = Omit<CompletionClientParams, "tools"> & {
|
|
|
49
43
|
* process.stdout.write(token);
|
|
50
44
|
* }
|
|
51
45
|
*
|
|
52
|
-
* for (const
|
|
53
|
-
* if (toolCall
|
|
54
|
-
*
|
|
55
|
-
* console.log(toolResult);
|
|
46
|
+
* for await (const evt of result.toolCallStream) {
|
|
47
|
+
* if (evt.type === "toolCall") {
|
|
48
|
+
* console.log("Tool:", evt.call.name, evt.call.arguments);
|
|
56
49
|
* }
|
|
57
50
|
* }
|
|
51
|
+
*
|
|
52
|
+
* // Non-streaming mode
|
|
53
|
+
* const response = completion({
|
|
54
|
+
* modelId: "llama-2",
|
|
55
|
+
* history: [
|
|
56
|
+
* { role: "user", content: "What is the capital of France?" }
|
|
57
|
+
* ],
|
|
58
|
+
* stream: false,
|
|
59
|
+
* });
|
|
60
|
+
*
|
|
61
|
+
* const text = await response.text;
|
|
62
|
+
* const stats = await response.stats;
|
|
63
|
+
* console.log(text);
|
|
64
|
+
* console.log(stats);
|
|
58
65
|
* ```
|
|
59
66
|
*/
|
|
60
|
-
export declare function completion(params:
|
|
67
|
+
export declare function completion(params: CompletionClientParams): {
|
|
61
68
|
tokenStream: AsyncGenerator<string>;
|
|
62
69
|
toolCallStream: AsyncGenerator<ToolCallEvent>;
|
|
63
70
|
stats: Promise<CompletionStats | undefined>;
|
|
64
71
|
text: Promise<string>;
|
|
65
|
-
toolCalls: Promise<
|
|
72
|
+
toolCalls: Promise<ToolCall[]>;
|
|
66
73
|
};
|
|
67
|
-
export {};
|
|
68
74
|
//# sourceMappingURL=completion-stream.d.ts.map
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
import { stream as streamRpc } from "../rpc/rpc-client.js";
|
|
2
|
-
import { getClientLogger } from "../../logging/index.js";
|
|
3
1
|
import { completionStreamResponseSchema, } from "../../schemas/index.js";
|
|
4
|
-
import {
|
|
5
|
-
import { attachHandlersToToolCalls, validateTools, } from "../../utils/tool-helpers.js";
|
|
6
|
-
const logger = getClientLogger();
|
|
2
|
+
import { stream as streamRpc } from "../rpc/rpc-client.js";
|
|
7
3
|
/**
|
|
8
4
|
* Generates completion from a language model based on conversation history.
|
|
9
5
|
*
|
|
@@ -11,8 +7,7 @@ const logger = getClientLogger();
|
|
|
11
7
|
* @param params.modelId - The identifier of the model to use for completion
|
|
12
8
|
* @param params.history - Array of conversation messages with role, content, and optional attachments
|
|
13
9
|
* @param params.stream - Whether to stream tokens (true) or return complete response (false). Defaults to true
|
|
14
|
-
* @param params.tools - Optional array of tools
|
|
15
|
-
* @param params.mcp - Optional array of MCP client inputs for tool integration
|
|
10
|
+
* @param params.tools - Optional array of tools that can be used by the model
|
|
16
11
|
* @param params.kvCache - Optional KV cache configuration. Cache files are organized hierarchically:
|
|
17
12
|
* - Structure: `{kvCacheKey}/{modelId}/{configHash}.bin`
|
|
18
13
|
* - The configHash includes model config + system prompt to ensure cache isolation
|
|
@@ -21,11 +16,10 @@ const logger = getClientLogger();
|
|
|
21
16
|
* - `false` or `undefined`: No caching
|
|
22
17
|
* - ⚡ Performance: When cache exists, only the last message is sent to the model (includes multimodal attachments)
|
|
23
18
|
* - 🗑️ Cleanup: Use `deleteCache({ kvCacheKey })` to remove cached sessions
|
|
24
|
-
* @returns Object with tokenStream generator, toolCallStream generator, text promise, toolCalls promise
|
|
19
|
+
* @returns Object with tokenStream generator, toolCallStream generator, text promise, toolCalls promise, and stats promise
|
|
25
20
|
* @example
|
|
26
21
|
* ```typescript
|
|
27
|
-
*
|
|
28
|
-
*
|
|
22
|
+
* // Streaming mode with tools
|
|
29
23
|
* const result = completion({
|
|
30
24
|
* modelId: "llama-2",
|
|
31
25
|
* history: [
|
|
@@ -33,13 +27,15 @@ const logger = getClientLogger();
|
|
|
33
27
|
* ],
|
|
34
28
|
* stream: true,
|
|
35
29
|
* tools: [{
|
|
30
|
+
* type: "function",
|
|
36
31
|
* name: "get_weather",
|
|
37
32
|
* description: "Get current weather",
|
|
38
|
-
* parameters:
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
33
|
+
* parameters: {
|
|
34
|
+
* type: "object",
|
|
35
|
+
* properties: {
|
|
36
|
+
* city: { type: "string" }
|
|
37
|
+
* },
|
|
38
|
+
* required: ["city"]
|
|
43
39
|
* }
|
|
44
40
|
* }]
|
|
45
41
|
* });
|
|
@@ -48,31 +44,44 @@ const logger = getClientLogger();
|
|
|
48
44
|
* process.stdout.write(token);
|
|
49
45
|
* }
|
|
50
46
|
*
|
|
51
|
-
* for (const
|
|
52
|
-
* if (toolCall
|
|
53
|
-
*
|
|
54
|
-
* console.log(toolResult);
|
|
47
|
+
* for await (const evt of result.toolCallStream) {
|
|
48
|
+
* if (evt.type === "toolCall") {
|
|
49
|
+
* console.log("Tool:", evt.call.name, evt.call.arguments);
|
|
55
50
|
* }
|
|
56
51
|
* }
|
|
52
|
+
*
|
|
53
|
+
* // Non-streaming mode
|
|
54
|
+
* const response = completion({
|
|
55
|
+
* modelId: "llama-2",
|
|
56
|
+
* history: [
|
|
57
|
+
* { role: "user", content: "What is the capital of France?" }
|
|
58
|
+
* ],
|
|
59
|
+
* stream: false,
|
|
60
|
+
* });
|
|
61
|
+
*
|
|
62
|
+
* const text = await response.text;
|
|
63
|
+
* const stats = await response.stats;
|
|
64
|
+
* console.log(text);
|
|
65
|
+
* console.log(stats);
|
|
57
66
|
* ```
|
|
58
67
|
*/
|
|
59
68
|
export function completion(params) {
|
|
69
|
+
const request = {
|
|
70
|
+
type: "completionStream",
|
|
71
|
+
...params,
|
|
72
|
+
stream: params.stream ?? true,
|
|
73
|
+
};
|
|
60
74
|
let stats;
|
|
61
75
|
let statsResolver = () => { };
|
|
62
|
-
|
|
63
|
-
const statsPromise = new Promise((resolve, reject) => {
|
|
76
|
+
const statsPromise = new Promise((resolve) => {
|
|
64
77
|
statsResolver = resolve;
|
|
65
|
-
statsRejecter = reject;
|
|
66
78
|
});
|
|
67
|
-
statsPromise.catch(() => { });
|
|
68
79
|
let toolCallsArray = [];
|
|
69
80
|
let toolCallsResolver = () => { };
|
|
70
|
-
|
|
71
|
-
const toolCallsPromise = new Promise((resolve, reject) => {
|
|
81
|
+
const toolCallsPromise = new Promise((resolve) => {
|
|
72
82
|
toolCallsResolver = resolve;
|
|
73
|
-
toolCallsRejecter = reject;
|
|
74
83
|
});
|
|
75
|
-
|
|
84
|
+
const responses = streamRpc(request);
|
|
76
85
|
const tokenQueue = [];
|
|
77
86
|
const toolEventQueue = [];
|
|
78
87
|
let tokenDone = false;
|
|
@@ -80,101 +89,48 @@ export function completion(params) {
|
|
|
80
89
|
let tokenResolve = null;
|
|
81
90
|
let toolResolve = null;
|
|
82
91
|
let textBuffer = "";
|
|
83
|
-
let streamError = null;
|
|
84
92
|
const processResponses = async () => {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
if (params.mcp && params.mcp.length > 0) {
|
|
99
|
-
const { tools: mcpTools, handlers: mcpHandlers } = await getMcpToolsWithHandlers(params.mcp);
|
|
100
|
-
allTools = [...mcpTools, ...allTools];
|
|
101
|
-
for (const [name, handler] of mcpHandlers) {
|
|
102
|
-
if (allHandlers.has(name)) {
|
|
103
|
-
logger.warn(`Duplicate tool handler for "${name}", overwriting`);
|
|
104
|
-
}
|
|
105
|
-
allHandlers.set(name, handler);
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
const request = {
|
|
109
|
-
type: "completionStream",
|
|
110
|
-
modelId: params.modelId,
|
|
111
|
-
history: params.history,
|
|
112
|
-
kvCache: params.kvCache,
|
|
113
|
-
tools: allTools.length > 0 ? allTools : undefined,
|
|
114
|
-
stream: params.stream ?? true,
|
|
115
|
-
generationParams: params.generationParams,
|
|
116
|
-
};
|
|
117
|
-
const responses = streamRpc(request, params.rpcOptions);
|
|
118
|
-
for await (const response of responses) {
|
|
119
|
-
if (response &&
|
|
120
|
-
typeof response === "object" &&
|
|
121
|
-
"type" in response &&
|
|
122
|
-
response.type === "completionStream") {
|
|
123
|
-
const streamResponse = completionStreamResponseSchema.parse(response);
|
|
124
|
-
if (!streamResponse.done) {
|
|
125
|
-
const token = streamResponse.token;
|
|
126
|
-
if (token) {
|
|
127
|
-
textBuffer += token;
|
|
128
|
-
tokenQueue.push(token);
|
|
129
|
-
if (tokenResolve) {
|
|
130
|
-
tokenResolve();
|
|
131
|
-
tokenResolve = null;
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
if (streamResponse.toolCallEvent) {
|
|
135
|
-
toolEventQueue.push(streamResponse.toolCallEvent);
|
|
136
|
-
if (toolResolve) {
|
|
137
|
-
toolResolve();
|
|
138
|
-
toolResolve = null;
|
|
139
|
-
}
|
|
140
|
-
}
|
|
93
|
+
for await (const response of responses) {
|
|
94
|
+
if (response &&
|
|
95
|
+
typeof response === "object" &&
|
|
96
|
+
"type" in response &&
|
|
97
|
+
response.type === "completionStream") {
|
|
98
|
+
const streamResponse = completionStreamResponseSchema.parse(response);
|
|
99
|
+
if (!streamResponse.done) {
|
|
100
|
+
const token = streamResponse.token;
|
|
101
|
+
textBuffer += token;
|
|
102
|
+
tokenQueue.push(token);
|
|
103
|
+
if (tokenResolve) {
|
|
104
|
+
tokenResolve();
|
|
105
|
+
tokenResolve = null;
|
|
141
106
|
}
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
textBuffer += streamResponse.token;
|
|
145
|
-
}
|
|
146
|
-
stats = streamResponse.stats;
|
|
147
|
-
statsResolver(stats);
|
|
148
|
-
const rawToolCalls = streamResponse.toolCalls || [];
|
|
149
|
-
toolCallsArray = attachHandlersToToolCalls(rawToolCalls, allHandlers);
|
|
150
|
-
toolCallsResolver(toolCallsArray);
|
|
151
|
-
tokenDone = true;
|
|
152
|
-
toolDone = true;
|
|
153
|
-
if (tokenResolve) {
|
|
154
|
-
tokenResolve();
|
|
155
|
-
tokenResolve = null;
|
|
156
|
-
}
|
|
107
|
+
if (streamResponse.toolCallEvent) {
|
|
108
|
+
toolEventQueue.push(streamResponse.toolCallEvent);
|
|
157
109
|
if (toolResolve) {
|
|
158
110
|
toolResolve();
|
|
159
111
|
toolResolve = null;
|
|
160
112
|
}
|
|
161
113
|
}
|
|
162
114
|
}
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
115
|
+
else {
|
|
116
|
+
if (streamResponse.token) {
|
|
117
|
+
textBuffer += streamResponse.token;
|
|
118
|
+
}
|
|
119
|
+
stats = streamResponse.stats;
|
|
120
|
+
statsResolver(stats);
|
|
121
|
+
toolCallsArray = streamResponse.toolCalls || [];
|
|
122
|
+
toolCallsResolver(toolCallsArray);
|
|
123
|
+
tokenDone = true;
|
|
124
|
+
toolDone = true;
|
|
125
|
+
if (tokenResolve) {
|
|
126
|
+
tokenResolve();
|
|
127
|
+
tokenResolve = null;
|
|
128
|
+
}
|
|
129
|
+
if (toolResolve) {
|
|
130
|
+
toolResolve();
|
|
131
|
+
toolResolve = null;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
178
134
|
}
|
|
179
135
|
}
|
|
180
136
|
};
|
|
@@ -183,7 +139,6 @@ export function completion(params) {
|
|
|
183
139
|
await statsPromise;
|
|
184
140
|
return textBuffer;
|
|
185
141
|
})();
|
|
186
|
-
textPromise.catch(() => { });
|
|
187
142
|
if (params.stream) {
|
|
188
143
|
const tokenStream = (async function* () {
|
|
189
144
|
while (true) {
|
|
@@ -191,9 +146,6 @@ export function completion(params) {
|
|
|
191
146
|
yield tokenQueue.shift();
|
|
192
147
|
}
|
|
193
148
|
else if (tokenDone) {
|
|
194
|
-
if (streamError !== null) {
|
|
195
|
-
throw streamError;
|
|
196
|
-
}
|
|
197
149
|
break;
|
|
198
150
|
}
|
|
199
151
|
else {
|
|
@@ -209,9 +161,6 @@ export function completion(params) {
|
|
|
209
161
|
yield toolEventQueue.shift();
|
|
210
162
|
}
|
|
211
163
|
else if (toolDone) {
|
|
212
|
-
if (streamError !== null) {
|
|
213
|
-
throw streamError;
|
|
214
|
-
}
|
|
215
164
|
break;
|
|
216
165
|
}
|
|
217
166
|
else {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { send } from "../rpc/rpc-client.js";
|
|
2
|
-
import { InvalidDeleteCacheParamsError, DeleteCacheFailedError, } from "../../utils/errors-client.js";
|
|
3
2
|
/**
|
|
4
3
|
* Deletes KV cache files.
|
|
5
4
|
*
|
|
@@ -36,11 +35,11 @@ export async function deleteCache(params) {
|
|
|
36
35
|
};
|
|
37
36
|
}
|
|
38
37
|
else {
|
|
39
|
-
throw new
|
|
38
|
+
throw new Error("Invalid deleteCache parameters");
|
|
40
39
|
}
|
|
41
40
|
const response = (await send(req));
|
|
42
41
|
if (!response.success && response.error) {
|
|
43
|
-
throw new
|
|
42
|
+
throw new Error(response.error);
|
|
44
43
|
}
|
|
45
44
|
return {
|
|
46
45
|
success: response.success,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type DownloadAssetOptions as BaseDownloadAssetOptions
|
|
1
|
+
import { type DownloadAssetOptions as BaseDownloadAssetOptions } from "../../schemas/index";
|
|
2
2
|
export type DownloadAssetOptions = BaseDownloadAssetOptions;
|
|
3
3
|
/**
|
|
4
4
|
* Downloads an asset (model file) without loading it into memory.
|
|
@@ -11,13 +11,12 @@ export type DownloadAssetOptions = BaseDownloadAssetOptions;
|
|
|
11
11
|
* - assetSrc: The location from which the asset is downloaded (local path, remote URL, or Hyperdrive URL)
|
|
12
12
|
* - seed: Optional boolean for hyperdrive seeding
|
|
13
13
|
* - onProgress: Optional callback for download progress
|
|
14
|
-
* @param rpcOptions - Optional RPC options including per-call profiling configuration
|
|
15
14
|
*
|
|
16
15
|
* @returns Promise that resolves to the asset ID (either the provided assetSrc or a generated ID)
|
|
17
16
|
*
|
|
18
|
-
* @throws {
|
|
19
|
-
* @throws {
|
|
20
|
-
* @throws {
|
|
17
|
+
* @throws {Error} When asset download fails, with details in the error message
|
|
18
|
+
* @throws {Error} When streaming ends unexpectedly (only when using onProgress)
|
|
19
|
+
* @throws {Error} When receiving an invalid response type from the server
|
|
21
20
|
*
|
|
22
21
|
* @example
|
|
23
22
|
* ```typescript
|
|
@@ -36,5 +35,5 @@ export type DownloadAssetOptions = BaseDownloadAssetOptions;
|
|
|
36
35
|
* });
|
|
37
36
|
* ```
|
|
38
37
|
*/
|
|
39
|
-
export declare function downloadAsset(options: DownloadAssetOptions
|
|
38
|
+
export declare function downloadAsset(options: DownloadAssetOptions): Promise<string>;
|
|
40
39
|
//# sourceMappingURL=download-asset.d.ts.map
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { send, stream } from "../rpc/rpc-client.js";
|
|
2
|
-
import {
|
|
3
|
-
import { DownloadAssetFailedError, StreamEndedError, InvalidResponseError, } from "../../utils/errors-client.js";
|
|
2
|
+
import { downloadAssetRequestSchema, } from "../../schemas/index.js";
|
|
4
3
|
/**
|
|
5
4
|
* Downloads an asset (model file) without loading it into memory.
|
|
6
5
|
*
|
|
@@ -12,13 +11,12 @@ import { DownloadAssetFailedError, StreamEndedError, InvalidResponseError, } fro
|
|
|
12
11
|
* - assetSrc: The location from which the asset is downloaded (local path, remote URL, or Hyperdrive URL)
|
|
13
12
|
* - seed: Optional boolean for hyperdrive seeding
|
|
14
13
|
* - onProgress: Optional callback for download progress
|
|
15
|
-
* @param rpcOptions - Optional RPC options including per-call profiling configuration
|
|
16
14
|
*
|
|
17
15
|
* @returns Promise that resolves to the asset ID (either the provided assetSrc or a generated ID)
|
|
18
16
|
*
|
|
19
|
-
* @throws {
|
|
20
|
-
* @throws {
|
|
21
|
-
* @throws {
|
|
17
|
+
* @throws {Error} When asset download fails, with details in the error message
|
|
18
|
+
* @throws {Error} When streaming ends unexpectedly (only when using onProgress)
|
|
19
|
+
* @throws {Error} When receiving an invalid response type from the server
|
|
22
20
|
*
|
|
23
21
|
* @example
|
|
24
22
|
* ```typescript
|
|
@@ -37,32 +35,38 @@ import { DownloadAssetFailedError, StreamEndedError, InvalidResponseError, } fro
|
|
|
37
35
|
* });
|
|
38
36
|
* ```
|
|
39
37
|
*/
|
|
40
|
-
export async function downloadAsset(options
|
|
41
|
-
const
|
|
38
|
+
export async function downloadAsset(options) {
|
|
39
|
+
const { assetSrc } = options;
|
|
40
|
+
const request = downloadAssetRequestSchema.parse({
|
|
41
|
+
type: "downloadAsset",
|
|
42
|
+
assetSrc: assetSrc,
|
|
43
|
+
withProgress: !!options.onProgress,
|
|
44
|
+
seed: options.seed,
|
|
45
|
+
});
|
|
42
46
|
if (options.onProgress) {
|
|
43
47
|
// Use streaming for progress updates
|
|
44
|
-
for await (const response of stream(request
|
|
48
|
+
for await (const response of stream(request)) {
|
|
45
49
|
if (response.type === "modelProgress") {
|
|
46
50
|
options.onProgress(response);
|
|
47
51
|
}
|
|
48
52
|
else if (response.type === "downloadAsset") {
|
|
49
53
|
if (!response.success) {
|
|
50
|
-
throw new
|
|
54
|
+
throw new Error(response.error ?? "Failed to download asset");
|
|
51
55
|
}
|
|
52
|
-
return response.assetId;
|
|
56
|
+
return response.assetId ?? assetSrc;
|
|
53
57
|
}
|
|
54
58
|
}
|
|
55
|
-
throw new
|
|
59
|
+
throw new Error("Stream ended without final response");
|
|
56
60
|
}
|
|
57
61
|
else {
|
|
58
62
|
// Use regular send for simple downloading
|
|
59
|
-
const response = await send(request
|
|
63
|
+
const response = await send(request);
|
|
60
64
|
if (response.type !== "downloadAsset") {
|
|
61
|
-
throw new
|
|
65
|
+
throw new Error("Invalid response type");
|
|
62
66
|
}
|
|
63
67
|
if (!response.success) {
|
|
64
|
-
throw new
|
|
68
|
+
throw new Error(response.error ?? "Failed to download asset");
|
|
65
69
|
}
|
|
66
|
-
return response.assetId;
|
|
70
|
+
return response.assetId ?? assetSrc;
|
|
67
71
|
}
|
|
68
72
|
}
|
|
@@ -1,28 +1,11 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type EmbedParams } from "../../schemas/index";
|
|
2
2
|
/**
|
|
3
|
-
* Generates embeddings for a
|
|
3
|
+
* Generates embeddings for a given text using a specified model.
|
|
4
4
|
*
|
|
5
5
|
* @param params - The parameters for the embedding
|
|
6
6
|
* @param params.modelId - The identifier of the embedding model to use
|
|
7
7
|
* @param params.text - The input text to embed
|
|
8
|
-
* @
|
|
9
|
-
* @throws {QvacErrorBase} When the response type is invalid or when the embedding fails
|
|
8
|
+
* @throws {Error} When the response type is invalid or when the embedding fails
|
|
10
9
|
*/
|
|
11
|
-
export declare function embed(params:
|
|
12
|
-
modelId: string;
|
|
13
|
-
text: string;
|
|
14
|
-
}, options?: RPCOptions): Promise<number[]>;
|
|
15
|
-
/**
|
|
16
|
-
* Generates embeddings for multiple texts using a specified model.
|
|
17
|
-
*
|
|
18
|
-
* @param params - The parameters for the embedding
|
|
19
|
-
* @param params.modelId - The identifier of the embedding model to use
|
|
20
|
-
* @param params.text - The input texts to embed
|
|
21
|
-
* @param options - Optional RPC options including per-call profiling
|
|
22
|
-
* @throws {QvacErrorBase} When the response type is invalid or when the embedding fails
|
|
23
|
-
*/
|
|
24
|
-
export declare function embed(params: {
|
|
25
|
-
modelId: string;
|
|
26
|
-
text: string[];
|
|
27
|
-
}, options?: RPCOptions): Promise<number[][]>;
|
|
10
|
+
export declare function embed(params: EmbedParams): Promise<number[]>;
|
|
28
11
|
//# sourceMappingURL=embed.d.ts.map
|