@qvac/sdk 0.9.2 → 0.10.1
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 +42 -95
- 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-structured-output.d.ts +2 -0
- package/dist/examples/llamacpp-structured-output.js +106 -0
- package/dist/examples/plugins.js +4 -4
- package/dist/examples/suspend-resume.js +21 -4
- package/dist/examples/{llamacpp-native-tools.js → tools/llamacpp-native-tools.js} +6 -55
- package/dist/examples/tools/llamacpp-tools-harmony-multiturn.d.ts +2 -0
- package/dist/examples/tools/llamacpp-tools-harmony-multiturn.js +81 -0
- package/dist/examples/tools/llamacpp-tools-pythonic.d.ts +2 -0
- package/dist/examples/tools/llamacpp-tools-pythonic.js +50 -0
- package/dist/examples/tools/shared.d.ts +21 -0
- package/dist/examples/tools/shared.js +42 -0
- 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 +6973 -7457
- package/dist/models/registry/models.js +6889 -6855
- 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.d.ts +1 -0
- package/dist/models/update-models/registry.js +23 -3
- 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 +354 -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 +126 -31
- package/dist/schemas/completion-stream.js +138 -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 +80 -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 +54 -116
- package/dist/server/bare/plugins/nmtcpp-translation/resolve-vocab.d.ts +32 -0
- package/dist/server/bare/plugins/nmtcpp-translation/resolve-vocab.js +117 -0
- 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 +413 -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 +14 -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 +46 -0
- package/dist/server/utils/tools/parsers/harmony.d.ts +4 -0
- package/dist/server/utils/tools/parsers/harmony.js +59 -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
- /package/dist/examples/{llamacpp-native-tools.d.ts → tools/llamacpp-native-tools.d.ts} +0 -0
package/NOTICE
CHANGED
|
@@ -83,46 +83,6 @@ Third-Party Model Licenses
|
|
|
83
83
|
https://huggingface.co/personalizedrefrigerator/whisper-base-fr
|
|
84
84
|
fr-tiny-ggml-model-f16
|
|
85
85
|
https://huggingface.co/JaepaX/whisper-tiny-fr
|
|
86
|
-
ggml-opus-ar-en
|
|
87
|
-
https://huggingface.co/Helsinki-NLP/opus-mt-ar-en
|
|
88
|
-
ggml-opus-de-en
|
|
89
|
-
https://huggingface.co/Helsinki-NLP/opus-mt-de-en
|
|
90
|
-
ggml-opus-de-fr
|
|
91
|
-
https://huggingface.co/Helsinki-NLP/opus-mt-de-fr
|
|
92
|
-
ggml-opus-en-ar
|
|
93
|
-
https://huggingface.co/Helsinki-NLP/opus-mt-en-ar
|
|
94
|
-
ggml-opus-en-es
|
|
95
|
-
https://huggingface.co/Helsinki-NLP/opus-mt-en-es
|
|
96
|
-
ggml-opus-en-fr
|
|
97
|
-
https://huggingface.co/Helsinki-NLP/opus-mt-en-fr
|
|
98
|
-
ggml-opus-en-it
|
|
99
|
-
https://huggingface.co/Helsinki-NLP/opus-mt-en-it
|
|
100
|
-
ggml-opus-en-roa
|
|
101
|
-
https://huggingface.co/Helsinki-NLP/opus-mt-en-roa
|
|
102
|
-
ggml-opus-en-ru
|
|
103
|
-
https://huggingface.co/Helsinki-NLP/opus-mt-en-ru
|
|
104
|
-
ggml-opus-en-zh
|
|
105
|
-
https://huggingface.co/Helsinki-NLP/opus-mt-en-zh
|
|
106
|
-
ggml-opus-es-en
|
|
107
|
-
https://huggingface.co/Helsinki-NLP/opus-mt-es-en
|
|
108
|
-
ggml-opus-es-fr
|
|
109
|
-
https://huggingface.co/Helsinki-NLP/opus-mt-es-fr
|
|
110
|
-
ggml-opus-fr-de
|
|
111
|
-
https://huggingface.co/Helsinki-NLP/opus-mt-fr-de
|
|
112
|
-
ggml-opus-fr-en
|
|
113
|
-
https://huggingface.co/Helsinki-NLP/opus-mt-fr-en
|
|
114
|
-
ggml-opus-fr-es
|
|
115
|
-
https://huggingface.co/Helsinki-NLP/opus-mt-fr-es
|
|
116
|
-
ggml-opus-it-en
|
|
117
|
-
https://huggingface.co/Helsinki-NLP/opus-mt-it-en
|
|
118
|
-
ggml-opus-ja-en
|
|
119
|
-
https://huggingface.co/Helsinki-NLP/opus-mt-ja-en
|
|
120
|
-
ggml-opus-mt-en-roa-f16
|
|
121
|
-
https://huggingface.co/Helsinki-NLP/opus-mt-en-roa
|
|
122
|
-
ggml-opus-mt-roa-en-f16
|
|
123
|
-
https://huggingface.co/Helsinki-NLP/opus-mt-roa-en
|
|
124
|
-
ggml-opus-roa-en
|
|
125
|
-
https://huggingface.co/Helsinki-NLP/opus-mt-roa-en
|
|
126
86
|
gpt-oss-120b-Q4_K_M-00001-of-00002
|
|
127
87
|
https://huggingface.co/unsloth/gpt-oss-120b-GGUF
|
|
128
88
|
gpt-oss-20b-GGUF
|
|
@@ -216,14 +176,6 @@ Third-Party Model Licenses
|
|
|
216
176
|
https://huggingface.co/nasedkinpv/parakeet-tdt-0.6b-v3-onnx-int8
|
|
217
177
|
encoder-model
|
|
218
178
|
https://huggingface.co/istupakov/parakeet-tdt-0.6b-v3-onnx
|
|
219
|
-
ggml-opus-en-de
|
|
220
|
-
https://huggingface.co/Helsinki-NLP/opus-mt-en-de
|
|
221
|
-
ggml-opus-en-pt
|
|
222
|
-
https://huggingface.co/Helsinki-NLP/opus-mt-tc-big-en-pt
|
|
223
|
-
ggml-opus-ru-en
|
|
224
|
-
https://huggingface.co/Helsinki-NLP/opus-mt-ru-en
|
|
225
|
-
ggml-opus-zh-en
|
|
226
|
-
https://huggingface.co/Helsinki-NLP/opus-mt-zh-en
|
|
227
179
|
parakeet-ctc-0.6b-ONNX
|
|
228
180
|
https://huggingface.co/onnx-community/parakeet-ctc-0.6b-ONNX
|
|
229
181
|
parakeet-rs
|
|
@@ -376,7 +328,7 @@ Third-Party Model Licenses
|
|
|
376
328
|
model.enis.intgemm.alphas
|
|
377
329
|
https://github.com/mozilla/firefox-translations-models/tree/main/models/base-memory/enis
|
|
378
330
|
model.enit.intgemm.alphas
|
|
379
|
-
https://github.com/mozilla/firefox-translations-models/tree/main/models/
|
|
331
|
+
https://github.com/mozilla/firefox-translations-models/tree/main/models/base-memory/enit
|
|
380
332
|
model.enja.intgemm.alphas
|
|
381
333
|
https://github.com/mozilla/firefox-translations-models/tree/main/models/base-memory/enja
|
|
382
334
|
model.enkn.intgemm.alphas
|
|
@@ -420,7 +372,7 @@ Third-Party Model Licenses
|
|
|
420
372
|
model.enzh.intgemm.alphas
|
|
421
373
|
https://github.com/mozilla/firefox-translations-models/tree/main/models/base-memory/enzh
|
|
422
374
|
model.esen.intgemm.alphas
|
|
423
|
-
https://github.com/mozilla/firefox-translations-models/tree/main/models/
|
|
375
|
+
https://github.com/mozilla/firefox-translations-models/tree/main/models/base-memory/esen
|
|
424
376
|
model.eten.intgemm.alphas
|
|
425
377
|
https://github.com/mozilla/firefox-translations-models/tree/main/models/base-memory/eten
|
|
426
378
|
model.faen.intgemm.alphas
|
|
@@ -537,31 +489,22 @@ JavaScript Dependencies
|
|
|
537
489
|
|
|
538
490
|
@hyperswarm/secret-stream@6.9.1
|
|
539
491
|
https://github.com/holepunchto/hyperswarm-secret-stream
|
|
540
|
-
@qvac/decoder-audio@0.3.6
|
|
541
|
-
https://github.com/tetherto/qvac
|
|
542
492
|
@qvac/decoder-audio@0.3.7
|
|
543
493
|
https://github.com/tetherto/qvac
|
|
544
494
|
@qvac/diagnostics@0.1.1
|
|
545
|
-
@qvac/diffusion-cpp@0.
|
|
546
|
-
https://github.com/tetherto/qvac
|
|
547
|
-
@qvac/dl-base@0.2.1
|
|
548
|
-
https://github.com/tetherto/qvac
|
|
549
|
-
@qvac/dl-filesystem@0.2.1
|
|
495
|
+
@qvac/diffusion-cpp@0.3.0
|
|
550
496
|
https://github.com/tetherto/qvac
|
|
551
|
-
@qvac/dl-
|
|
552
|
-
|
|
553
|
-
@qvac/embed-llamacpp@0.
|
|
497
|
+
@qvac/dl-base@0.1.1
|
|
498
|
+
@qvac/dl-hyperdrive@0.1.1
|
|
499
|
+
@qvac/embed-llamacpp@0.14.0
|
|
554
500
|
https://github.com/tetherto/qvac
|
|
555
501
|
@qvac/error@0.1.1
|
|
556
502
|
@qvac/infer-base@0.1.1
|
|
557
|
-
@qvac/infer-base@0.
|
|
558
|
-
@qvac/infer-base@0.3.1
|
|
559
|
-
https://github.com/tetherto/qvac
|
|
560
|
-
@qvac/infer-base@0.4.0
|
|
503
|
+
@qvac/infer-base@0.4.1
|
|
561
504
|
https://github.com/tetherto/qvac
|
|
562
505
|
@qvac/langdetect-text@0.1.2
|
|
563
506
|
https://github.com/tetherto/qvac
|
|
564
|
-
@qvac/llm-llamacpp@0.
|
|
507
|
+
@qvac/llm-llamacpp@0.17.3
|
|
565
508
|
https://github.com/tetherto/qvac
|
|
566
509
|
@qvac/logging@0.1.0
|
|
567
510
|
@qvac/ocr-onnx@0.4.2
|
|
@@ -570,17 +513,17 @@ JavaScript Dependencies
|
|
|
570
513
|
https://github.com/tetherto/qvac
|
|
571
514
|
@qvac/rag@0.4.4
|
|
572
515
|
https://github.com/tetherto/qvac
|
|
573
|
-
@qvac/registry-client@0.4.
|
|
516
|
+
@qvac/registry-client@0.4.1
|
|
574
517
|
https://github.com/tetherto/qvac
|
|
575
518
|
@qvac/registry-schema@0.1.2
|
|
576
519
|
@qvac/response@0.1.2
|
|
577
|
-
@qvac/transcription-parakeet@0.3.
|
|
520
|
+
@qvac/transcription-parakeet@0.3.2
|
|
521
|
+
https://github.com/tetherto/qvac
|
|
522
|
+
@qvac/transcription-whispercpp@0.6.7
|
|
578
523
|
https://github.com/tetherto/qvac
|
|
579
|
-
@qvac/
|
|
524
|
+
@qvac/translation-nmtcpp@2.1.0
|
|
580
525
|
https://github.com/tetherto/qvac
|
|
581
|
-
@qvac/
|
|
582
|
-
https://github.com/tetherto/qvac-lib-infer-nmtcpp
|
|
583
|
-
@qvac/tts-onnx@0.8.2
|
|
526
|
+
@qvac/tts-onnx@0.8.5
|
|
584
527
|
https://github.com/tetherto/qvac
|
|
585
528
|
adaptive-timeout@1.0.1
|
|
586
529
|
https://github.com/holepunchto/adaptive-timeout
|
|
@@ -612,29 +555,31 @@ JavaScript Dependencies
|
|
|
612
555
|
https://github.com/holepunchto/bare-events
|
|
613
556
|
bare-events@2.8.2
|
|
614
557
|
https://github.com/holepunchto/bare-events
|
|
615
|
-
bare-fetch@2.
|
|
558
|
+
bare-fetch@2.9.0
|
|
616
559
|
https://github.com/holepunchto/bare-fetch
|
|
617
560
|
bare-ffmpeg@1.2.2
|
|
618
561
|
https://github.com/holepunchto/bare-ffmpeg
|
|
619
562
|
bare-form-data@1.2.1
|
|
620
563
|
https://github.com/holepunchto/bare-form-data
|
|
621
|
-
bare-fs@4.
|
|
564
|
+
bare-fs@4.7.1
|
|
622
565
|
https://github.com/holepunchto/bare-fs
|
|
623
566
|
bare-hrtime@2.1.1
|
|
624
567
|
https://github.com/holepunchto/bare-hrtime
|
|
625
568
|
bare-http-parser@1.1.3
|
|
626
569
|
https://github.com/holepunchto/bare-http-parser
|
|
627
|
-
bare-http1@4.5.
|
|
570
|
+
bare-http1@4.5.6
|
|
628
571
|
https://github.com/holepunchto/bare-http1
|
|
629
572
|
bare-https@2.1.3
|
|
630
573
|
https://github.com/holepunchto/bare-https
|
|
631
574
|
bare-inspect@3.1.4
|
|
632
575
|
https://github.com/holepunchto/bare-inspect
|
|
633
|
-
bare-lief@0.
|
|
576
|
+
bare-lief@0.2.3
|
|
634
577
|
https://github.com/holepunchto/bare-lief
|
|
635
|
-
bare-link@2.1
|
|
578
|
+
bare-link@3.2.1
|
|
636
579
|
https://github.com/holepunchto/bare-link
|
|
637
|
-
bare-
|
|
580
|
+
bare-mime@1.0.0
|
|
581
|
+
https://github.com/holepunchto/bare-mime
|
|
582
|
+
bare-module@6.2.0
|
|
638
583
|
https://github.com/holepunchto/bare-module
|
|
639
584
|
bare-module-lexer@1.4.7
|
|
640
585
|
https://github.com/holepunchto/bare-module-lexer
|
|
@@ -648,7 +593,7 @@ JavaScript Dependencies
|
|
|
648
593
|
https://github.com/holepunchto/bare-node
|
|
649
594
|
bare-node-worker-threads@1.0.0
|
|
650
595
|
https://github.com/holepunchto/bare-node
|
|
651
|
-
bare-os@3.
|
|
596
|
+
bare-os@3.9.0
|
|
652
597
|
https://github.com/holepunchto/bare-os
|
|
653
598
|
bare-path@3.0.0
|
|
654
599
|
https://github.com/holepunchto/bare-path
|
|
@@ -658,39 +603,39 @@ JavaScript Dependencies
|
|
|
658
603
|
https://github.com/holepunchto/bare-process
|
|
659
604
|
bare-rpc@1.2.0
|
|
660
605
|
https://github.com/holepunchto/bare-rpc
|
|
661
|
-
bare-runtime@1.28.
|
|
606
|
+
bare-runtime@1.28.4
|
|
662
607
|
https://github.com/holepunchto/bare-runtime
|
|
663
|
-
bare-runtime-darwin-arm64@1.28.
|
|
608
|
+
bare-runtime-darwin-arm64@1.28.4
|
|
664
609
|
https://github.com/holepunchto/bare-runtime
|
|
665
|
-
bare-semver@1.0.
|
|
610
|
+
bare-semver@1.0.3
|
|
666
611
|
https://github.com/holepunchto/bare-semver
|
|
667
612
|
bare-signals@4.2.0
|
|
668
613
|
https://github.com/holepunchto/bare-signals
|
|
669
614
|
bare-stdio@1.0.2
|
|
670
615
|
https://github.com/holepunchto/bare-stdio
|
|
671
|
-
bare-stream@2.
|
|
616
|
+
bare-stream@2.13.1
|
|
672
617
|
https://github.com/holepunchto/bare-stream
|
|
673
|
-
bare-structured-clone@1.5.
|
|
618
|
+
bare-structured-clone@1.5.4
|
|
674
619
|
https://github.com/holepunchto/bare-structured-clone
|
|
675
620
|
bare-subprocess@5.2.3
|
|
676
621
|
https://github.com/holepunchto/bare-subprocess
|
|
677
|
-
bare-tcp@2.2.
|
|
622
|
+
bare-tcp@2.2.12
|
|
678
623
|
https://github.com/holepunchto/bare-tcp
|
|
679
624
|
bare-thread@1.2.0
|
|
680
625
|
https://github.com/holepunchto/bare-thread
|
|
681
|
-
bare-tls@2.2.
|
|
626
|
+
bare-tls@2.2.3
|
|
682
627
|
https://github.com/holepunchto/bare-tls
|
|
683
628
|
bare-tty@5.1.0
|
|
684
629
|
https://github.com/holepunchto/bare-tty
|
|
685
630
|
bare-type@1.1.0
|
|
686
631
|
https://github.com/holepunchto/bare-type
|
|
687
|
-
bare-url@2.4.
|
|
632
|
+
bare-url@2.4.2
|
|
688
633
|
https://github.com/holepunchto/bare-url
|
|
689
634
|
bare-worker@4.1.6
|
|
690
635
|
https://github.com/holepunchto/bare-worker
|
|
691
|
-
bare-zlib@1.3.
|
|
636
|
+
bare-zlib@1.3.3
|
|
692
637
|
https://github.com/holepunchto/bare-zlib
|
|
693
|
-
blind-relay@1.
|
|
638
|
+
blind-relay@1.5.0
|
|
694
639
|
https://github.com/holepunchto/blind-relay
|
|
695
640
|
compact-encoding@2.19.2
|
|
696
641
|
https://github.com/holepunchto/compact-encoding
|
|
@@ -700,7 +645,7 @@ JavaScript Dependencies
|
|
|
700
645
|
https://github.com/holepunchto/events-universal
|
|
701
646
|
fd-lock@2.1.1
|
|
702
647
|
https://github.com/holepunchto/fd-lock
|
|
703
|
-
fs-native-extensions@1.
|
|
648
|
+
fs-native-extensions@1.5.0
|
|
704
649
|
https://github.com/holepunchto/fs-native-extensions
|
|
705
650
|
hyperblobs@2.11.1
|
|
706
651
|
https://github.com/holepunchto/hyperblobs
|
|
@@ -714,6 +659,8 @@ JavaScript Dependencies
|
|
|
714
659
|
https://github.com/holepunchto/hypercore-storage
|
|
715
660
|
hyperdb@4.22.3
|
|
716
661
|
https://github.com/holepunchto/hyperdb
|
|
662
|
+
hyperdht-address@1.0.1
|
|
663
|
+
https://github.com/holepunchto/hyperdht-address
|
|
717
664
|
hyperdht-stats@1.10.0
|
|
718
665
|
https://github.com/holepunchto/hyperdht-stats
|
|
719
666
|
hyperdispatch@1.5.1
|
|
@@ -726,7 +673,7 @@ JavaScript Dependencies
|
|
|
726
673
|
https://github.com/holepunchto/hyperswarm-stats
|
|
727
674
|
index-encoder@3.5.0
|
|
728
675
|
https://github.com/holepunchto/index-encoder
|
|
729
|
-
mirror-drive@1.14.
|
|
676
|
+
mirror-drive@1.14.2
|
|
730
677
|
https://github.com/holepunchto/mirror-drive
|
|
731
678
|
noise-handshake@4.2.0
|
|
732
679
|
https://github.com/holepunchto/noise-handshake
|
|
@@ -798,8 +745,8 @@ JavaScript Dependencies
|
|
|
798
745
|
https://github.com/holepunchto/corestore
|
|
799
746
|
debounceify@1.1.0
|
|
800
747
|
https://github.com/mafintosh/debounceify
|
|
801
|
-
dht-rpc@6.26.
|
|
802
|
-
https://github.com/
|
|
748
|
+
dht-rpc@6.26.4
|
|
749
|
+
https://github.com/holepunchto/dht-rpc
|
|
803
750
|
events@3.3.0
|
|
804
751
|
https://github.com/Gozala/events
|
|
805
752
|
fast-fifo@1.3.2
|
|
@@ -818,7 +765,7 @@ JavaScript Dependencies
|
|
|
818
765
|
https://github.com/holepunchto/hypercore
|
|
819
766
|
hypercore-crypto@3.6.1
|
|
820
767
|
https://github.com/mafintosh/hypercore-crypto
|
|
821
|
-
hyperdht@6.
|
|
768
|
+
hyperdht@6.30.0
|
|
822
769
|
https://github.com/holepunchto/hyperdht
|
|
823
770
|
hyperswarm@4.17.0
|
|
824
771
|
https://github.com/holepunchto/hyperswarm
|
|
@@ -836,8 +783,8 @@ JavaScript Dependencies
|
|
|
836
783
|
https://github.com/mafintosh/nat-sampler
|
|
837
784
|
protocol-buffers-encodings@1.2.0
|
|
838
785
|
https://github.com/mafintosh/protocol-buffers-encodings
|
|
839
|
-
protomux@3.10.
|
|
840
|
-
https://github.com/
|
|
786
|
+
protomux@3.10.3
|
|
787
|
+
https://github.com/holepunchto/protomux
|
|
841
788
|
queue-tick@1.0.1
|
|
842
789
|
https://github.com/mafintosh/queue-tick
|
|
843
790
|
random-array-iterator@1.0.0
|
|
@@ -28,7 +28,7 @@ import { type CancelParams } from "../../schemas/index";
|
|
|
28
28
|
* await cancel({
|
|
29
29
|
* operation: "downloadAsset",
|
|
30
30
|
* downloadKey: "download-key",
|
|
31
|
-
* delegate: {
|
|
31
|
+
* delegate: { providerPublicKey: "peerHex" },
|
|
32
32
|
* });
|
|
33
33
|
*
|
|
34
34
|
* @example
|
|
@@ -30,7 +30,7 @@ import { InvalidResponseError, CancelFailedError } from "../../utils/errors-clie
|
|
|
30
30
|
* await cancel({
|
|
31
31
|
* operation: "downloadAsset",
|
|
32
32
|
* downloadKey: "download-key",
|
|
33
|
-
* delegate: {
|
|
33
|
+
* delegate: { providerPublicKey: "peerHex" },
|
|
34
34
|
* });
|
|
35
35
|
*
|
|
36
36
|
* @example
|
|
@@ -1,19 +1,50 @@
|
|
|
1
|
-
import { type CompletionClientParams, type
|
|
1
|
+
import { type CompletionClientParams, type CompletionRun, type McpClientInput, type Tool, type RPCOptions } from "../../schemas/index";
|
|
2
2
|
import { type ToolInput } from "../../utils/tool-helpers";
|
|
3
3
|
type CompletionParams = Omit<CompletionClientParams, "tools"> & {
|
|
4
4
|
tools?: Tool[] | ToolInput[];
|
|
5
5
|
mcp?: McpClientInput[];
|
|
6
6
|
rpcOptions?: RPCOptions;
|
|
7
|
+
captureThinking?: boolean;
|
|
8
|
+
emitRawDeltas?: boolean;
|
|
7
9
|
};
|
|
8
10
|
/**
|
|
9
11
|
* Generates completion from a language model based on conversation history.
|
|
10
12
|
*
|
|
13
|
+
* Returns a `CompletionRun` whose canonical surfaces are:
|
|
14
|
+
*
|
|
15
|
+
* - `events` — `AsyncIterable<CompletionEvent>` of ordered, typed events.
|
|
16
|
+
* - `final` — `Promise<CompletionFinal>` with aggregated results once the
|
|
17
|
+
* stream ends (content, thinking, tool calls, stats, raw text).
|
|
18
|
+
*
|
|
19
|
+
* Legacy convenience fields (`tokenStream`, `text`, `toolCallStream`,
|
|
20
|
+
* `toolCalls`, `stats`) are still available but deprecated — they derive
|
|
21
|
+
* from `events` / `final` internally.
|
|
22
|
+
*
|
|
11
23
|
* @param params - The completion parameters
|
|
12
24
|
* @param params.modelId - The identifier of the model to use for completion
|
|
13
25
|
* @param params.history - Array of conversation messages with role, content, and optional attachments
|
|
14
26
|
* @param params.stream - Whether to stream tokens (true) or return complete response (false). Defaults to true
|
|
15
27
|
* @param params.tools - Optional array of tools (can be simple ToolInput with Zod schemas or full Tool objects)
|
|
16
28
|
* @param params.mcp - Optional array of MCP client inputs for tool integration
|
|
29
|
+
* @param params.captureThinking - Best-effort parsing of `<think>` blocks into `thinkingDelta` events; `final.raw.fullText` always preserves the original output
|
|
30
|
+
* @param params.emitRawDeltas - When true, every raw model token is also emitted as a `rawDelta` event
|
|
31
|
+
* @param params.toolDialect - Override the SDK's name-based dialect detection. Use when your model emits a known format (`"hermes"`, `"pythonic"`, or `"json"`) the auto-router doesn't recognise. Drives both streaming frame detection and finalization parsing.
|
|
32
|
+
* Common override case: Llama 3.x tool-calling fine-tunes that emit the native pythonic header (`<|start_header_id|>tool_call<|end_header_id|>...<|eot_id|>`).
|
|
33
|
+
* @param params.responseFormat - Optional structured-output constraint applied to the model's output:
|
|
34
|
+
* - `{ type: "text" }` — no constraint (default behavior)
|
|
35
|
+
* - `{ type: "json_object" }` — output must be a JSON object
|
|
36
|
+
* - `{ type: "json_schema", json_schema: { name, schema, description?, strict? } }` — output must validate against `schema`
|
|
37
|
+
*
|
|
38
|
+
* The schema is converted to GBNF natively by llama.cpp and applied for the
|
|
39
|
+
* duration of the request only. `json_schema.name` and `json_schema.description`
|
|
40
|
+
* are accepted for OpenAI compatibility but only used at the API boundary —
|
|
41
|
+
* they do not affect generation. **`json_schema.strict` is currently accepted
|
|
42
|
+
* for compatibility but does NOT trigger OpenAI's auto-tightening semantics**
|
|
43
|
+
* (implicit `additionalProperties: false`, all properties required). The
|
|
44
|
+
* schema is forwarded to the addon as-is, so callers who want strict
|
|
45
|
+
* validation must encode it explicitly in `schema`.
|
|
46
|
+
*
|
|
47
|
+
* Cannot be combined with `tools` (tools already constrain output via their parameter schema).
|
|
17
48
|
* @param params.kvCache - Optional KV cache configuration. Cache files are organized hierarchically:
|
|
18
49
|
* - Structure: `{kvCacheKey}/{modelId}/{configHash}.bin`
|
|
19
50
|
* - The configHash includes model config + system prompt to ensure cache isolation
|
|
@@ -22,17 +53,29 @@ type CompletionParams = Omit<CompletionClientParams, "tools"> & {
|
|
|
22
53
|
* - `false` or `undefined`: No caching
|
|
23
54
|
* - ⚡ Performance: When cache exists, only the last message is sent to the model (includes multimodal attachments)
|
|
24
55
|
* - 🗑️ Cleanup: Use `deleteCache({ kvCacheKey })` to remove cached sessions
|
|
25
|
-
*
|
|
56
|
+
*
|
|
57
|
+
* **Auto-cache (`kvCache: true`) — assistant turn contract.** When
|
|
58
|
+
* pushing the assistant turn back into `history` for the next call,
|
|
59
|
+
* use `(await run.final).cacheableAssistantContent`. That's the exact
|
|
60
|
+
* string the SDK persisted to the cache key on this turn, so re-using
|
|
61
|
+
* it verbatim guarantees the next-turn lookup hits.
|
|
62
|
+
* - Any post-processing of the assistant text (rewriting, summarizing,
|
|
63
|
+
* stripping model stop tokens like `<|im_end|>`) before pushing it
|
|
64
|
+
* back will miss the cache. Push the canonical string unchanged.
|
|
65
|
+
* - `cacheableAssistantContent` is omitted on tool-call turns - those
|
|
66
|
+
* can't be auto-cached today.
|
|
67
|
+
* @returns A CompletionRun — consume via `events` / `final`.
|
|
26
68
|
* @example
|
|
27
69
|
* ```typescript
|
|
28
70
|
* import { z } from "zod";
|
|
29
71
|
*
|
|
30
|
-
* const
|
|
72
|
+
* const run = completion({
|
|
31
73
|
* modelId: "llama-2",
|
|
32
74
|
* history: [
|
|
33
75
|
* { role: "user", content: "What's the weather in Tokyo?" }
|
|
34
76
|
* ],
|
|
35
77
|
* stream: true,
|
|
78
|
+
* captureThinking: true,
|
|
36
79
|
* tools: [{
|
|
37
80
|
* name: "get_weather",
|
|
38
81
|
* description: "Get current weather",
|
|
@@ -45,10 +88,12 @@ type CompletionParams = Omit<CompletionClientParams, "tools"> & {
|
|
|
45
88
|
* }]
|
|
46
89
|
* });
|
|
47
90
|
*
|
|
48
|
-
* for await (const
|
|
49
|
-
* process.stdout.write(
|
|
91
|
+
* for await (const event of run.events) {
|
|
92
|
+
* if (event.type === "contentDelta") process.stdout.write(event.text);
|
|
93
|
+
* if (event.type === "toolCall") console.log(event.call.name, event.call.arguments);
|
|
50
94
|
* }
|
|
51
95
|
*
|
|
96
|
+
* const result = await run.final;
|
|
52
97
|
* for (const toolCall of await result.toolCalls) {
|
|
53
98
|
* if (toolCall.invoke) {
|
|
54
99
|
* const toolResult = await toolCall.invoke();
|
|
@@ -57,12 +102,6 @@ type CompletionParams = Omit<CompletionClientParams, "tools"> & {
|
|
|
57
102
|
* }
|
|
58
103
|
* ```
|
|
59
104
|
*/
|
|
60
|
-
export declare function completion(params: CompletionParams):
|
|
61
|
-
tokenStream: AsyncGenerator<string>;
|
|
62
|
-
toolCallStream: AsyncGenerator<ToolCallEvent>;
|
|
63
|
-
stats: Promise<CompletionStats | undefined>;
|
|
64
|
-
text: Promise<string>;
|
|
65
|
-
toolCalls: Promise<ToolCallWithCall[]>;
|
|
66
|
-
};
|
|
105
|
+
export declare function completion(params: CompletionParams): CompletionRun;
|
|
67
106
|
export {};
|
|
68
107
|
//# sourceMappingURL=completion-stream.d.ts.map
|