@qvac/sdk 0.21.0 → 0.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NOTICE +35 -1
- package/README.md +167 -24
- package/dist/examples/abot-world.js +1 -1
- package/dist/examples/advisory-model-fit.d.ts +0 -58
- package/dist/examples/advisory-model-fit.js +23 -150
- package/dist/examples/asr/moss-transcribe-filesystem.d.ts +2 -0
- package/dist/examples/asr/moss-transcribe-filesystem.js +84 -0
- package/dist/examples/asr/moss-transcribe-fit.d.ts +2 -0
- package/dist/examples/asr/moss-transcribe-fit.js +40 -0
- package/dist/examples/asr/nemotron-diarization-filesystem.d.ts +2 -0
- package/dist/examples/asr/nemotron-diarization-filesystem.js +64 -0
- package/dist/examples/asr/parakeet-ctc-filesystem.js +2 -2
- package/dist/examples/asr/parakeet-indic-conformer-filesystem.js +2 -2
- package/dist/examples/asr/parakeet-microphone-record.js +1 -1
- package/dist/examples/asr/parakeet-microphone-stream.js +1 -1
- package/dist/examples/asr/parakeet-nemotron-filesystem.js +3 -3
- package/dist/examples/asr/parakeet-sortformer-streaming.js +2 -2
- package/dist/examples/asr/parakeet-sortformer.js +1 -1
- package/dist/examples/asr/parakeet-tdt-filesystem-chunked.js +2 -2
- package/dist/examples/asr/parakeet-tdt-filesystem.js +2 -2
- package/dist/examples/asr/parakeet-unified-coreml.js +2 -2
- package/dist/examples/asr/parakeet-unified-filesystem.js +2 -2
- package/dist/examples/asr/whispercpp-filesystem-streaming.js +1 -1
- package/dist/examples/asr/whispercpp-filesystem.js +1 -1
- package/dist/examples/asr/whispercpp-microphone-record.js +1 -1
- package/dist/examples/asr/whispercpp-prompt.js +1 -1
- package/dist/examples/assess-model-fit.js +3 -6
- package/dist/examples/audiogen/edit-music.js +2 -2
- package/dist/examples/audiogen/generate-cover.js +2 -2
- package/dist/examples/audiogen/generate-music-minimax.js +1 -1
- package/dist/examples/audiogen/generate-music.js +1 -1
- package/dist/examples/audiogen/understand-music.js +2 -2
- package/dist/examples/batch-completion.d.ts +1 -1
- package/dist/examples/batch-completion.js +1 -1
- package/dist/examples/bci/bci-filesystem-streaming.js +2 -2
- package/dist/examples/bci/bci-filesystem.js +2 -2
- package/dist/examples/concurrent-completion-collision.js +1 -1
- package/dist/examples/config-reload.js +1 -1
- package/dist/examples/decisions.d.ts +2 -0
- package/dist/examples/decisions.js +38 -0
- package/dist/examples/diffusion-esrgan-upscale.js +1 -1
- package/dist/examples/diffusion-flux2-klein-img2img.js +1 -1
- package/dist/examples/diffusion-img2img.js +1 -1
- package/dist/examples/diffusion-img2vid-ltx.js +1 -1
- package/dist/examples/diffusion-img2vid-minimax-h3.d.ts +2 -0
- package/dist/examples/diffusion-img2vid-minimax-h3.js +72 -0
- package/dist/examples/diffusion-img2vid.js +1 -1
- package/dist/examples/llamacpp-filesystem.js +1 -1
- package/dist/examples/llamacpp-multi-gpu.js +2 -2
- package/dist/examples/llamacpp-structured-output.js +1 -1
- package/dist/examples/mcp-websearch.d.ts +2 -2
- package/dist/examples/mcp-websearch.js +3 -3
- package/dist/examples/model-fit-ui/server.d.ts +1 -1
- package/dist/examples/model-fit-ui/server.js +1 -1
- package/dist/examples/multi-job-completion.d.ts +1 -1
- package/dist/examples/multi-job-completion.js +1 -1
- package/dist/examples/ocr-fasttext.js +1 -1
- package/dist/examples/tools/llamacpp-tools-auto-dialect.js +1 -1
- package/dist/examples/tools/llamacpp-tools-gemma4.js +1 -1
- package/dist/examples/tools/llamacpp-tools-qwen35.js +1 -1
- package/dist/examples/tts/llm-to-tts-streaming.d.ts +2 -2
- package/dist/examples/tts/llm-to-tts-streaming.js +2 -2
- package/dist/examples/tts/moss-sound-effect-controls.d.ts +2 -0
- package/dist/examples/tts/moss-sound-effect-controls.js +88 -0
- package/dist/examples/tts/moss-sound-effect.d.ts +2 -0
- package/dist/examples/tts/moss-sound-effect.js +86 -0
- package/dist/examples/tts/moss-speech-audio.d.ts +2 -0
- package/dist/examples/tts/moss-speech-audio.js +159 -0
- package/dist/examples/tts/moss-speech.d.ts +2 -0
- package/dist/examples/tts/moss-speech.js +70 -0
- package/dist/examples/vla-groot.js +2 -2
- package/dist/examples/vla-pi05.js +2 -2
- package/dist/examples/vla-smolvla.js +2 -2
- package/dist/examples/voice-assistant/voice-assistant.js +1 -1
- package/dist/scripts/contract/build-contract.d.ts +3 -1
- package/dist/scripts/contract/build-contract.js +40 -2
- package/dist/scripts/contract/build-model-type-maps.d.ts +6 -1
- package/dist/scripts/contract/build-model-type-maps.js +3 -2
- package/dist/scripts/contract/constants-registry.d.ts +4 -0
- package/dist/scripts/contract/constants-registry.js +3 -1
- package/dist/scripts/contract/method-shapes.d.ts +1 -0
- package/dist/scripts/contract/method-shapes.js +1 -0
- package/dist/scripts/export-contract.js +20 -7
- package/dist/scripts/run-unit-tests.js +10 -5
- package/dist/src/client/api/assess-model-fit.d.ts +5 -5
- package/dist/src/client/api/assess-model-fit.js +5 -6
- package/dist/src/client/api/audio-edit.d.ts +14 -2
- package/dist/src/client/api/audio-edit.js +14 -2
- package/dist/src/client/api/audio-gen.d.ts +10 -2
- package/dist/src/client/api/audio-gen.js +10 -2
- package/dist/src/client/api/audio-understand.d.ts +1 -1
- package/dist/src/client/api/audio-understand.js +1 -1
- package/dist/src/client/api/batch-completion.js +1 -1
- package/dist/src/client/api/completion-stream.js +1 -1
- package/dist/src/client/api/decide.d.ts +31 -0
- package/dist/src/client/api/decide.js +29 -0
- package/dist/src/client/api/index.d.ts +1 -0
- package/dist/src/client/api/index.js +1 -0
- package/dist/src/client/api/load-model.d.ts +1 -0
- package/dist/src/client/api/text-to-speech.d.ts +1 -0
- package/dist/src/client/api/text-to-speech.js +15 -22
- package/dist/src/client/api/transcribe.js +5 -2
- package/dist/src/client/api/video-request.d.ts +5 -5
- package/dist/src/client/api/video.d.ts +23 -3
- package/dist/src/client/api/video.js +23 -3
- package/dist/src/commands/bundle/bare-pack.d.ts +8 -0
- package/dist/src/commands/bundle/bare-pack.js +28 -5
- package/dist/src/commands/bundle/constants.js +2 -0
- package/dist/src/commands/bundle/index.d.ts +7 -6
- package/dist/src/commands/bundle/index.js +126 -43
- package/dist/src/commands/bundle/manifest.d.ts +2 -0
- package/dist/src/commands/bundle/manifest.js +3 -2
- package/dist/src/commands/host-prebuilds/index.d.ts +15 -7
- package/dist/src/commands/host-prebuilds/index.js +35 -16
- package/dist/src/commands/index.d.ts +1 -1
- package/dist/src/commands/index.js +1 -1
- package/dist/src/commands/verify/addon-source.d.ts +12 -0
- package/dist/src/commands/verify/addon-source.js +36 -3
- package/dist/src/commands/verify/bare-kit-runtimes.js +2 -1
- package/dist/src/commands/verify/node-modules-source.js +10 -1
- package/dist/src/{expo/plugins/patches/qvac-platform-addons.d.ts → commands/verify/platform-addons.d.ts} +6 -10
- package/dist/src/{expo/plugins/patches/qvac-platform-addons.js → commands/verify/platform-addons.js} +2 -45
- package/dist/src/commands/verify/prebuilds.d.ts +7 -10
- package/dist/src/commands/verify/prebuilds.js +43 -34
- package/dist/src/expo/plugins/get-project-root.d.ts +1 -1
- package/dist/src/expo/plugins/link-addons.d.ts +18 -0
- package/dist/src/expo/plugins/link-addons.js +65 -0
- package/dist/src/expo/plugins/withAndroidArchitecture.d.ts +1 -1
- package/dist/src/expo/plugins/withAndroidNdkVersion.d.ts +1 -1
- package/dist/src/expo/plugins/withDeviceInfo.d.ts +1 -1
- package/dist/src/expo/plugins/withMobileBundle.d.ts +11 -21
- package/dist/src/expo/plugins/withMobileBundle.js +22 -112
- package/dist/src/expo/plugins/withOpenCL.d.ts +1 -1
- package/dist/src/expo/plugins/withQvacSDK.d.ts +1 -1
- package/dist/src/index.d.ts +3 -3
- package/dist/src/index.js +2 -2
- package/dist/src/logging/base-logger.js +1 -1
- package/dist/src/logging/utils.js +1 -1
- package/dist/src/pear/pre.js +2 -0
- package/dist/src/plugin-ids.d.ts +3 -1
- package/dist/src/plugin-ids.js +4 -0
- package/dist/src/schemas/public.d.ts +2 -1
- package/dist/src/schemas/public.js +2 -1
- package/dist/src/schemas/sdk-errors-client.d.ts +3 -0
- package/dist/src/schemas/sdk-errors-client.js +16 -0
- package/dist/src/schemas/sdk-errors-server.d.ts +1 -0
- package/dist/src/schemas/sdk-errors-server.js +5 -0
- package/dist/src/utils/errors-client.d.ts +10 -0
- package/dist/src/utils/errors-client.js +18 -0
- package/dist/src/utils/mcp-adapter.js +12 -8
- package/dist/src/utils/tool-helpers.d.ts +1 -1
- package/dist/src/utils/tool-helpers.js +20 -52
- package/dist/src/worker/create-server.d.ts +1 -0
- package/dist/src/worker/create-server.js +5 -0
- package/dist/src/worker/index.js +4 -0
- package/dist/src/worker/lifecycle.js +9 -1
- package/dist/src/worker/plugins/llamacpp-decision.d.ts +2 -0
- package/dist/src/worker/plugins/llamacpp-decision.js +1 -0
- package/dist/src/worker/plugins/moss-transcribe.d.ts +2 -0
- package/dist/src/worker/plugins/moss-transcribe.js +1 -0
- package/package.json +39 -35
- package/src/electron-forge/index.cjs +12 -71
- package/dist/scripts/link-workspace-inference.d.ts +0 -2
- package/dist/scripts/link-workspace-inference.js +0 -31
- package/src/expo/plugins/patches/android-link.mjs +0 -67
- package/src/expo/plugins/patches/ios-link.mjs +0 -67
- package/src/expo/plugins/patches/qvac-platform-addons.ts +0 -124
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MOSS-Transcribe-Diarize: one model produces text, timestamps, and speaker labels.
|
|
3
|
+
*
|
|
4
|
+
* Run from packages/sdk:
|
|
5
|
+
* npx tsx examples/asr/moss-transcribe-filesystem.ts <audio.wav> [moss.gguf] [hotword ...]
|
|
6
|
+
* npx tsx examples/asr/moss-transcribe-filesystem.ts examples/audio/diarization-sample-16k.wav
|
|
7
|
+
* npx tsx examples/asr/moss-transcribe-filesystem.ts meeting.wav ./moss.gguf QVAC OpenMOSS
|
|
8
|
+
*
|
|
9
|
+
* Omit the GGUF path to download MOSS_TRANSCRIBE_DIARIZE_Q8_0 from the registry.
|
|
10
|
+
* Use a 16 kHz mono PCM WAV recording. Hotwords are optional names/domain terms
|
|
11
|
+
* for this request, with at most 64 terms of 64 UTF-8 bytes each.
|
|
12
|
+
* This is batch transcription; MOSS streaming and CoreML are not exposed.
|
|
13
|
+
*/
|
|
14
|
+
import { access, constants } from 'node:fs/promises';
|
|
15
|
+
import { loadModel, unloadModel, transcribe, close, MOSS_TRANSCRIBE_DIARIZE_Q8_0 } from '@qvac/sdk';
|
|
16
|
+
const [audioFilePath, modelPath, ...hotwords] = process.argv.slice(2);
|
|
17
|
+
if (!audioFilePath || audioFilePath === '--help') {
|
|
18
|
+
console.error('Usage: npx tsx examples/asr/moss-transcribe-filesystem.ts <audio.wav> [moss.gguf] [hotword ...]');
|
|
19
|
+
process.exit(audioFilePath === '--help' ? 0 : 1);
|
|
20
|
+
}
|
|
21
|
+
let modelId;
|
|
22
|
+
try {
|
|
23
|
+
// Check the recording before starting a model download.
|
|
24
|
+
await access(audioFilePath, constants.R_OK);
|
|
25
|
+
console.error('▸ Loading MOSS-Transcribe-Diarize...');
|
|
26
|
+
modelId = await loadModel({
|
|
27
|
+
modelType: 'moss-transcribe',
|
|
28
|
+
modelSrc: modelPath ?? MOSS_TRANSCRIBE_DIARIZE_Q8_0,
|
|
29
|
+
modelConfig: {
|
|
30
|
+
maxThreads: 4,
|
|
31
|
+
useGPU: false // Set true to opt into Metal on a supported Mac.
|
|
32
|
+
},
|
|
33
|
+
onProgress: (progress) => {
|
|
34
|
+
const mb = (bytes) => (bytes / 1e6).toFixed(1);
|
|
35
|
+
const line = `▸ Downloading ${progress.percentage.toFixed(0)}% (${mb(progress.downloaded)}/${mb(progress.total)} MB)`;
|
|
36
|
+
process.stderr.write(process.stderr.isTTY ? `\r${line}` : `${line}\n`);
|
|
37
|
+
if (process.stderr.isTTY && progress.percentage >= 100)
|
|
38
|
+
process.stderr.write('\n');
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
console.error(`▸ Transcribing ${audioFilePath}...`);
|
|
42
|
+
const segments = await transcribe({
|
|
43
|
+
modelId,
|
|
44
|
+
audioChunk: audioFilePath,
|
|
45
|
+
metadata: true,
|
|
46
|
+
hotwords,
|
|
47
|
+
maxNewTokens: 0 // Use the model's default decoding limit.
|
|
48
|
+
// For a custom instruction, replace hotwords with prompt; do not supply both.
|
|
49
|
+
});
|
|
50
|
+
for (const segment of segments) {
|
|
51
|
+
const start = (segment.startMs / 1000).toFixed(2);
|
|
52
|
+
const end = (segment.endMs / 1000).toFixed(2);
|
|
53
|
+
const speaker = segment.speaker ??
|
|
54
|
+
(segment.speakerId !== undefined ? `Speaker ${segment.speakerId}` : 'Unknown speaker');
|
|
55
|
+
console.log(`[${start}s → ${end}s] ${speaker}: ${segment.text.trim()}`);
|
|
56
|
+
}
|
|
57
|
+
if (segments.length === 0)
|
|
58
|
+
console.error('▸ No speech segments returned.');
|
|
59
|
+
}
|
|
60
|
+
catch (error) {
|
|
61
|
+
console.error('✖ MOSS transcription failed:', error);
|
|
62
|
+
process.exitCode = 1;
|
|
63
|
+
}
|
|
64
|
+
finally {
|
|
65
|
+
try {
|
|
66
|
+
if (modelId !== undefined) {
|
|
67
|
+
console.error('▸ Unloading MOSS model...');
|
|
68
|
+
await unloadModel({ modelId });
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
catch (error) {
|
|
72
|
+
console.error('✖ Could not unload the MOSS model:', error);
|
|
73
|
+
process.exitCode = 1;
|
|
74
|
+
}
|
|
75
|
+
finally {
|
|
76
|
+
try {
|
|
77
|
+
await close();
|
|
78
|
+
}
|
|
79
|
+
catch (error) {
|
|
80
|
+
console.error('✖ Could not close the SDK:', error);
|
|
81
|
+
process.exitCode = 1;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Assess MOSS memory before downloading weights or loading a model.
|
|
3
|
+
* Run from packages/sdk:
|
|
4
|
+
* node --import tsx examples/asr/moss-transcribe-fit.ts <audio-seconds> [moss.gguf] [hotword ...]
|
|
5
|
+
* Without a local path, uses the Q8_0 registry model's weightless description.
|
|
6
|
+
*/
|
|
7
|
+
import { assessModelFit, close, MOSS_TRANSCRIBE_DIARIZE_Q8_0 } from '@qvac/sdk';
|
|
8
|
+
const [seconds, modelPath, ...hotwords] = process.argv.slice(2);
|
|
9
|
+
const audioSeconds = Number(seconds);
|
|
10
|
+
if (seconds === '--help' || !Number.isFinite(audioSeconds) || audioSeconds <= 0) {
|
|
11
|
+
console.error('Usage: node --import tsx examples/asr/moss-transcribe-fit.ts <audio-seconds> [moss.gguf] [hotword ...]');
|
|
12
|
+
process.exit(seconds === '--help' ? 0 : 1);
|
|
13
|
+
}
|
|
14
|
+
try {
|
|
15
|
+
console.error('▸ Assessing MOSS memory for the declared recording...');
|
|
16
|
+
const result = await assessModelFit({
|
|
17
|
+
models: [
|
|
18
|
+
{
|
|
19
|
+
modelType: 'moss-transcribe',
|
|
20
|
+
modelSrc: modelPath ?? MOSS_TRANSCRIBE_DIARIZE_Q8_0,
|
|
21
|
+
modelConfig: { useGPU: false, maxThreads: 4 },
|
|
22
|
+
transcriptionWorkload: { audioSeconds, hotwords, maxNewTokens: 0 }
|
|
23
|
+
}
|
|
24
|
+
]
|
|
25
|
+
});
|
|
26
|
+
console.log(JSON.stringify(result, null, 2));
|
|
27
|
+
}
|
|
28
|
+
catch (error) {
|
|
29
|
+
console.error('✖ MOSS memory assessment failed:', error);
|
|
30
|
+
process.exitCode = 1;
|
|
31
|
+
}
|
|
32
|
+
finally {
|
|
33
|
+
try {
|
|
34
|
+
await close();
|
|
35
|
+
}
|
|
36
|
+
catch (error) {
|
|
37
|
+
console.error('✖ Could not close the SDK:', error);
|
|
38
|
+
process.exitCode = 1;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Nemotron 3 Diarization detects up to eight speakers, including overlapping turns.
|
|
3
|
+
* It reports speaker activity, not recognized words.
|
|
4
|
+
*
|
|
5
|
+
* Run from packages/sdk with a local Nemotron 3 Diarization GGUF:
|
|
6
|
+
* npx tsx examples/asr/nemotron-diarization-filesystem.ts <nemotron-diarization.gguf> [audio.wav]
|
|
7
|
+
*
|
|
8
|
+
* Defaults to examples/audio/diarization-sample-16k.wav in the source repository.
|
|
9
|
+
* Supply a 16 kHz mono PCM WAV when copying this example elsewhere.
|
|
10
|
+
*/
|
|
11
|
+
import { access, constants } from 'node:fs/promises';
|
|
12
|
+
import { loadModel, unloadModel, transcribe, close } from '@qvac/sdk';
|
|
13
|
+
const [modelPath, audioPath = 'examples/audio/diarization-sample-16k.wav'] = process.argv.slice(2);
|
|
14
|
+
if (!modelPath || modelPath === '--help') {
|
|
15
|
+
console.error('Usage: npx tsx examples/asr/nemotron-diarization-filesystem.ts <nemotron-diarization.gguf> [audio.wav]');
|
|
16
|
+
process.exit(modelPath === '--help' ? 0 : 1);
|
|
17
|
+
}
|
|
18
|
+
let modelId;
|
|
19
|
+
try {
|
|
20
|
+
await access(modelPath, constants.R_OK);
|
|
21
|
+
await access(audioPath, constants.R_OK);
|
|
22
|
+
console.error('▸ Loading Nemotron 3 Diarization through the Parakeet engine...');
|
|
23
|
+
modelId = await loadModel({
|
|
24
|
+
modelSrc: modelPath,
|
|
25
|
+
modelType: 'parakeet-transcription',
|
|
26
|
+
modelConfig: {
|
|
27
|
+
maxThreads: 4,
|
|
28
|
+
useGPU: false
|
|
29
|
+
// Optional: diarizationThreshold and diarizationMinSegmentMs.
|
|
30
|
+
// Omit them to use the loaded model's defaults.
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
console.error(`▸ Diarizing ${audioPath}...`);
|
|
34
|
+
const segments = await transcribe({ modelId, audioChunk: audioPath, metadata: true });
|
|
35
|
+
const turns = segments.flatMap((segment) => segment.speakerSegments ?? []);
|
|
36
|
+
for (const turn of turns) {
|
|
37
|
+
console.log(`[${(turn.startMs / 1000).toFixed(2)}s → ${(turn.endMs / 1000).toFixed(2)}s] Speaker ${turn.speakerId + 1}`);
|
|
38
|
+
}
|
|
39
|
+
if (turns.length === 0)
|
|
40
|
+
console.error('▸ No speaker turns returned.');
|
|
41
|
+
}
|
|
42
|
+
catch (error) {
|
|
43
|
+
console.error('✖ Nemotron diarization failed:', error);
|
|
44
|
+
process.exitCode = 1;
|
|
45
|
+
}
|
|
46
|
+
finally {
|
|
47
|
+
try {
|
|
48
|
+
if (modelId !== undefined)
|
|
49
|
+
await unloadModel({ modelId });
|
|
50
|
+
}
|
|
51
|
+
catch (error) {
|
|
52
|
+
console.error('✖ Could not unload the diarization model:', error);
|
|
53
|
+
process.exitCode = 1;
|
|
54
|
+
}
|
|
55
|
+
finally {
|
|
56
|
+
try {
|
|
57
|
+
await close();
|
|
58
|
+
}
|
|
59
|
+
catch (error) {
|
|
60
|
+
console.error('✖ Could not close the SDK:', error);
|
|
61
|
+
process.exitCode = 1;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Parakeet CTC transcription from a WAV file.
|
|
3
3
|
*
|
|
4
4
|
* Usage:
|
|
5
|
-
*
|
|
5
|
+
* npx tsx examples/asr/parakeet-ctc-filesystem.ts <wav-file> [parakeet-ctc-gguf]
|
|
6
6
|
*
|
|
7
7
|
* Loads a single GGUF checkpoint (`PARAKEET_CTC_0_6B_Q8_0` by default) and
|
|
8
8
|
* transcribes the file with the batch `transcribe` API. Omit the model
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
import { loadModel, unloadModel, transcribe, PARAKEET_CTC_0_6B_Q8_0 } from '@qvac/sdk';
|
|
14
14
|
const args = process.argv.slice(2);
|
|
15
15
|
if (!args[0]) {
|
|
16
|
-
console.error('Usage:
|
|
16
|
+
console.error('Usage: npx tsx examples/asr/parakeet-ctc-filesystem.ts <wav-file> ' + '[parakeet-ctc-gguf]');
|
|
17
17
|
console.error('\nIf the model path is omitted, defaults to the registry model.');
|
|
18
18
|
process.exit(1);
|
|
19
19
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Indic Conformer CTC transcription from a WAV file.
|
|
3
3
|
*
|
|
4
4
|
* Usage:
|
|
5
|
-
*
|
|
5
|
+
* npx tsx examples/asr/parakeet-indic-conformer-filesystem.ts <wav-file> <language> [gguf]
|
|
6
6
|
*
|
|
7
7
|
* Loads a single GGUF checkpoint (`PARAKEET_INDIC_CONFORMER_600M_Q8_0` by
|
|
8
8
|
* default) and transcribes with the batch `transcribe` API. `language` is
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
import { loadModel, unloadModel, transcribe, PARAKEET_INDIC_CONFORMER_600M_Q8_0 } from '@qvac/sdk';
|
|
15
15
|
const args = process.argv.slice(2);
|
|
16
16
|
if (!args[0] || !args[1]) {
|
|
17
|
-
console.error('Usage:
|
|
17
|
+
console.error('Usage: npx tsx examples/asr/parakeet-indic-conformer-filesystem.ts ' +
|
|
18
18
|
'<wav-file> <language> [indic-conformer-gguf]');
|
|
19
19
|
console.error('\nExample: ... filesystem.ts speech.wav hi');
|
|
20
20
|
console.error('If the model path is omitted, defaults to the registry model.');
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Microphone → Parakeet batch transcription (chunked `transcribe`).
|
|
3
3
|
*
|
|
4
4
|
* Usage:
|
|
5
|
-
*
|
|
5
|
+
* npx tsx examples/asr/parakeet-microphone-record.ts
|
|
6
6
|
*
|
|
7
7
|
* Captures 3 s s16le chunks from the microphone and sends each to `transcribe`
|
|
8
8
|
* with the TDT model. Press Ctrl+C to stop.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Microphone → Parakeet duplex streaming (`transcribeStream`).
|
|
3
3
|
*
|
|
4
4
|
* Usage:
|
|
5
|
-
*
|
|
5
|
+
* npx tsx examples/asr/parakeet-microphone-stream.ts
|
|
6
6
|
*
|
|
7
7
|
* Streams microphone audio through `transcribeStream` with
|
|
8
8
|
* `parakeetStreamingConfig`. Uses the EOU checkpoint so you may see
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* Parakeet Nemotron transcription from an audio file.
|
|
3
3
|
*
|
|
4
4
|
* Usage:
|
|
5
|
-
*
|
|
5
|
+
* npx tsx examples/asr/parakeet-nemotron-filesystem.ts \
|
|
6
6
|
* <audio-file> [locale] [nemotron-gguf] [--streaming]
|
|
7
|
-
*
|
|
7
|
+
* npx tsx examples/asr/parakeet-nemotron-filesystem.ts \
|
|
8
8
|
* <audio-file> [nemotron-gguf] [--streaming]
|
|
9
9
|
*
|
|
10
10
|
* Uses `PARAKEET_NEMOTRON_0_6B_Q4_0` when the model is omitted and `auto` when
|
|
@@ -22,7 +22,7 @@ const DEFAULT_LOCALE = 'auto';
|
|
|
22
22
|
const FFMPEG_PROTOCOLS = 'file,pipe';
|
|
23
23
|
const STREAMING_FLAG = '--streaming';
|
|
24
24
|
const EARLY_OUTPUT_END_MESSAGE = 'The transcription stream ended before the decoder input completed';
|
|
25
|
-
const USAGE = 'Usage:
|
|
25
|
+
const USAGE = 'Usage: npx tsx examples/asr/parakeet-nemotron-filesystem.ts ' +
|
|
26
26
|
'<audio-file> [locale] [nemotron-gguf] [--streaming]';
|
|
27
27
|
function parseArguments(args) {
|
|
28
28
|
const streaming = args.includes(STREAMING_FLAG);
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Sortformer v2.1 streaming diarization via duplex `transcribeStream` + AOSC.
|
|
3
3
|
*
|
|
4
4
|
* Usage:
|
|
5
|
-
*
|
|
5
|
+
* npx tsx examples/asr/parakeet-sortformer-streaming.ts <wav-file> [sortformer-gguf]
|
|
6
6
|
*
|
|
7
7
|
* Streams 16 kHz mono s16le audio in real-time-paced chunks (required for parakeet
|
|
8
8
|
* duplex streaming). Loads v2.1 with AOSC knobs in `modelConfig`. Omit the model
|
|
@@ -28,7 +28,7 @@ const SORTFORMER_V21_AOSC_LOAD_CONFIG = {
|
|
|
28
28
|
};
|
|
29
29
|
const args = process.argv.slice(2);
|
|
30
30
|
if (!args[0]) {
|
|
31
|
-
console.error('Usage:
|
|
31
|
+
console.error('Usage: npx tsx examples/asr/parakeet-sortformer-streaming.ts <wav-file-path> [sortformer-gguf]');
|
|
32
32
|
console.error('\nDefaults to the v2.1 q8_0 registry model (PARAKEET_SORTFORMER_4SPK_V2_1_Q8_0).');
|
|
33
33
|
process.exit(1);
|
|
34
34
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Parakeet Sortformer diarization + TDT transcription pipeline.
|
|
3
3
|
*
|
|
4
4
|
* Usage:
|
|
5
|
-
*
|
|
5
|
+
* npx tsx examples/asr/parakeet-sortformer.ts [sortformer-gguf] [wav-file]
|
|
6
6
|
*
|
|
7
7
|
* Two-step flow: Sortformer v2.1 diarizes the audio, then TDT transcribes each
|
|
8
8
|
* speaker segment. Defaults to registry GGUFs and
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Parakeet TDT transcription for long audio files.
|
|
3
3
|
*
|
|
4
4
|
* Usage:
|
|
5
|
-
*
|
|
5
|
+
* npx tsx examples/asr/parakeet-tdt-filesystem-chunked.ts <audio-file> [parakeet-tdt-gguf]
|
|
6
6
|
*
|
|
7
7
|
* FFmpeg first detects silence, then this example selects boundaries near
|
|
8
8
|
* 45 seconds and transcribes one segment at a time. Segments never exceed
|
|
@@ -143,7 +143,7 @@ function formatTimestamp(seconds) {
|
|
|
143
143
|
}
|
|
144
144
|
const args = process.argv.slice(2);
|
|
145
145
|
if (!args[0]) {
|
|
146
|
-
console.error('Usage:
|
|
146
|
+
console.error('Usage: npx tsx examples/asr/parakeet-tdt-filesystem-chunked.ts ' +
|
|
147
147
|
'<audio-file> [parakeet-tdt-gguf]');
|
|
148
148
|
process.exit(1);
|
|
149
149
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Parakeet TDT transcription from a WAV file.
|
|
3
3
|
*
|
|
4
4
|
* Usage:
|
|
5
|
-
*
|
|
5
|
+
* npx tsx examples/asr/parakeet-tdt-filesystem.ts <wav-file> [parakeet-tdt-gguf]
|
|
6
6
|
*
|
|
7
7
|
* Loads a single GGUF checkpoint (`PARAKEET_TDT_0_6B_V3_Q8_0` by default) and
|
|
8
8
|
* transcribes the file with the batch `transcribe` API. Omit the model
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
import { loadModel, unloadModel, transcribe, PARAKEET_TDT_0_6B_V3_Q8_0 } from '@qvac/sdk';
|
|
14
14
|
const args = process.argv.slice(2);
|
|
15
15
|
if (!args[0]) {
|
|
16
|
-
console.error('Usage:
|
|
16
|
+
console.error('Usage: npx tsx examples/asr/parakeet-tdt-filesystem.ts <wav-file-path> ' +
|
|
17
17
|
'[parakeet-tdt-gguf]');
|
|
18
18
|
console.error('\nIf the model path is omitted, defaults to the registry model.');
|
|
19
19
|
process.exit(1);
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Transcribe a WAV file with Parakeet Unified and its Core ML encoder sidecar.
|
|
3
3
|
*
|
|
4
4
|
* From packages/sdk:
|
|
5
|
-
*
|
|
5
|
+
* npx tsx examples/asr/parakeet-unified-coreml.ts \
|
|
6
6
|
* /path/to/parakeet-unified-en-0.6b.q4_0.gguf [16-kHz-wav-file]
|
|
7
7
|
*
|
|
8
8
|
* The GGUF must be a regenerated Unified artifact. The five compiled Core ML
|
|
@@ -77,7 +77,7 @@ async function stageModel(path) {
|
|
|
77
77
|
}
|
|
78
78
|
async function main() {
|
|
79
79
|
if (!modelPath) {
|
|
80
|
-
throw new Error('Usage:
|
|
80
|
+
throw new Error('Usage: npx tsx examples/asr/parakeet-unified-coreml.ts ' +
|
|
81
81
|
'<regenerated-unified-gguf> [16-kHz-wav-file]');
|
|
82
82
|
}
|
|
83
83
|
let staged;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Parakeet Unified transcription from a WAV file.
|
|
3
3
|
*
|
|
4
4
|
* Usage:
|
|
5
|
-
*
|
|
5
|
+
* npx tsx examples/asr/parakeet-unified-filesystem.ts <wav-file> [parakeet-unified-gguf]
|
|
6
6
|
*
|
|
7
7
|
* Loads a single GGUF checkpoint (`PARAKEET_UNIFIED_0_6B_Q8_0` by default) and
|
|
8
8
|
* transcribes the file with the batch `transcribe` API. The Unified RNN-T
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
import { loadModel, unloadModel, transcribe, PARAKEET_UNIFIED_0_6B_Q8_0 } from '@qvac/sdk';
|
|
16
16
|
const args = process.argv.slice(2);
|
|
17
17
|
if (!args[0]) {
|
|
18
|
-
console.error('Usage:
|
|
18
|
+
console.error('Usage: npx tsx examples/asr/parakeet-unified-filesystem.ts <wav-file-path> ' +
|
|
19
19
|
'[parakeet-unified-gguf]');
|
|
20
20
|
console.error('\nIf the model path is omitted, defaults to the registry model.');
|
|
21
21
|
process.exit(1);
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Test script: pipes a WAV file through transcribeStream to verify
|
|
3
3
|
* the bidirectional streaming + addon processing works end-to-end.
|
|
4
4
|
*
|
|
5
|
-
* Usage:
|
|
5
|
+
* Usage: npx tsx examples/asr/whispercpp-filesystem-streaming.ts
|
|
6
6
|
*
|
|
7
7
|
* Uses FFmpeg to convert the WAV to raw f32le and streams chunks
|
|
8
8
|
* through the duplex RPC session to the whisper addon.
|
|
@@ -2,7 +2,7 @@ import { loadModel, unloadModel, transcribe, WHISPER_TINY } from '@qvac/sdk';
|
|
|
2
2
|
// Parse command line arguments
|
|
3
3
|
const args = process.argv.slice(2);
|
|
4
4
|
if (!args[0]) {
|
|
5
|
-
console.error('Usage:
|
|
5
|
+
console.error('Usage: npx tsx examples/asr/whispercpp-filesystem.ts <wav-file-path>');
|
|
6
6
|
process.exit(1);
|
|
7
7
|
}
|
|
8
8
|
const audioFilePath = args[0];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Microphone → Whisper streaming transcription with native VAD.
|
|
3
3
|
*
|
|
4
|
-
* Usage:
|
|
4
|
+
* Usage: npx tsx examples/asr/whispercpp-microphone-record.ts
|
|
5
5
|
*
|
|
6
6
|
* Speak into your mic; transcriptions appear automatically when you pause.
|
|
7
7
|
* Press Ctrl+C to quit.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Whisper transcription with prompt example.
|
|
3
3
|
*
|
|
4
4
|
* Usage:
|
|
5
|
-
*
|
|
5
|
+
* npx tsx examples/asr/whispercpp-prompt.ts
|
|
6
6
|
*
|
|
7
7
|
* This example requires a test audio file (default: examples/audio/sample-16khz.wav).
|
|
8
8
|
* Sample audio files are available in the QVAC source repository, but not included in the published npm package.
|
|
@@ -58,12 +58,9 @@ try {
|
|
|
58
58
|
for (const [index, model] of result.models.entries()) {
|
|
59
59
|
const mark = VERDICT_MARK[model.verdict];
|
|
60
60
|
const size = gib(CANDIDATES[index].expectedSize).padStart(9);
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
: model.evidence === 'computed-only' && model.floorBytes
|
|
65
|
-
? `at least ${gib(model.floorBytes)}`
|
|
66
|
-
: '';
|
|
61
|
+
const needs = model.evidence === 'computed-only' && model.floorBytes
|
|
62
|
+
? `at least ${gib(model.floorBytes)}`
|
|
63
|
+
: '';
|
|
67
64
|
console.log(` ${mark} ${model.name.padEnd(46)} ${size} on disk ${needs}`);
|
|
68
65
|
// Present on every `unknown`, and worth surfacing: it names what is missing.
|
|
69
66
|
if (model.verdict === 'unknown') {
|
|
@@ -5,7 +5,7 @@ import { AUDIOGEN_ACESTEP_5HZ_LM_0_6B_Q8_0, AUDIOGEN_ACESTEP_V15_TURBO_Q4_K_M, A
|
|
|
5
5
|
// regenerates one time range against a new prompt. Operations run in order.
|
|
6
6
|
//
|
|
7
7
|
// Usage:
|
|
8
|
-
//
|
|
8
|
+
// npx tsx examples/audiogen/edit-music.ts <source.wav|mp3|...> "original pop song" "guitar pop-rock" [output.wav]
|
|
9
9
|
//
|
|
10
10
|
// The source must run at least REPAINT_END seconds: the Repaint below asks for
|
|
11
11
|
// a fixed window, and a range past the end of the source is rejected with
|
|
@@ -24,7 +24,7 @@ const fromCaption = process.argv[3] ?? 'Original pop song';
|
|
|
24
24
|
const toCaption = process.argv[4] ?? 'Guitar pop-rock';
|
|
25
25
|
const outputPath = process.argv[5] ?? 'audiogen-edit.wav';
|
|
26
26
|
if (!sourcePath) {
|
|
27
|
-
console.error('Usage:
|
|
27
|
+
console.error('Usage: npx tsx examples/audiogen/edit-music.ts <source-audio> "<from caption>" "<to caption>" [output.wav]');
|
|
28
28
|
process.exit(1);
|
|
29
29
|
}
|
|
30
30
|
let modelId;
|
|
@@ -4,7 +4,7 @@ import { AUDIOGEN_ACESTEP_5HZ_LM_0_6B_Q8_0, AUDIOGEN_ACESTEP_V15_TURBO_Q4_K_M, A
|
|
|
4
4
|
// optionally conditioning the timbre on a second reference clip.
|
|
5
5
|
//
|
|
6
6
|
// Usage:
|
|
7
|
-
//
|
|
7
|
+
// npx tsx examples/audiogen/generate-cover.ts <source.wav|mp3|...> "orchestral arrangement" [reference.wav] [output.wav]
|
|
8
8
|
//
|
|
9
9
|
// Both audio inputs are file paths: the SDK decodes them (any FFmpeg-decodable
|
|
10
10
|
// format) to the 48 kHz stereo float PCM the engine expects. Pass raw
|
|
@@ -15,7 +15,7 @@ const caption = process.argv[3] ?? 'Orchestral arrangement with dramatic strings
|
|
|
15
15
|
const referencePath = process.argv[4];
|
|
16
16
|
const outputPath = process.argv[5] ?? 'audiogen-cover.wav';
|
|
17
17
|
if (!sourcePath) {
|
|
18
|
-
console.error('Usage:
|
|
18
|
+
console.error('Usage: npx tsx examples/audiogen/generate-cover.ts <source-audio> "<caption>" [reference-audio] [output.wav]');
|
|
19
19
|
process.exit(1);
|
|
20
20
|
}
|
|
21
21
|
let modelId;
|
|
@@ -3,7 +3,7 @@ import { audioGen, loadModel, unloadModel } from '@qvac/sdk';
|
|
|
3
3
|
// Usage:
|
|
4
4
|
// AUDIOGEN_MINIMAX_LM_MODEL=/models/mm3-lm-q8.gguf \
|
|
5
5
|
// AUDIOGEN_MINIMAX_SYNTH_MODEL=/models/mm3-synth-q8.gguf \
|
|
6
|
-
//
|
|
6
|
+
// npx tsx examples/audiogen/generate-music-minimax.ts "warm cinematic piano" output.wav
|
|
7
7
|
const caption = process.argv[2] ?? 'Warm cinematic piano with gentle strings';
|
|
8
8
|
const outputPath = process.argv[3] ?? 'minimax-music3-output.wav';
|
|
9
9
|
let modelId;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { writeFileSync } from 'node:fs';
|
|
2
2
|
import { AUDIOGEN_ACESTEP_5HZ_LM_0_6B_Q8_0, AUDIOGEN_ACESTEP_V15_TURBO_Q4_K_M, AUDIOGEN_QWEN3_EMBEDDING_0_6B_Q8_0, AUDIOGEN_VAE_BF16, audioGen, loadModel, unloadModel } from '@qvac/sdk';
|
|
3
3
|
// Usage:
|
|
4
|
-
//
|
|
4
|
+
// npx tsx examples/audiogen/generate-music.ts "lo-fi hip hop, mellow piano" output.wav
|
|
5
5
|
const caption = process.argv[2] ?? 'Lo-fi hip hop with mellow piano, soft drums, and a warm bass line';
|
|
6
6
|
const outputPath = process.argv[3] ?? 'audiogen-output.wav';
|
|
7
7
|
let modelId;
|
|
@@ -4,7 +4,7 @@ import { AUDIOGEN_ACESTEP_5HZ_LM_0_6B_Q8_0, AUDIOGEN_ACESTEP_V15_TURBO_Q4_K_M, A
|
|
|
4
4
|
// caption and the clip's musical metadata.
|
|
5
5
|
//
|
|
6
6
|
// Usage:
|
|
7
|
-
//
|
|
7
|
+
// npx tsx examples/audiogen/understand-music.ts <source.wav|mp3|...> [language hint]
|
|
8
8
|
//
|
|
9
9
|
// The source is a file path: the SDK decodes it (any FFmpeg-decodable format)
|
|
10
10
|
// to the 48 kHz stereo float PCM the engine expects. Pass raw interleaved
|
|
@@ -13,7 +13,7 @@ import { AUDIOGEN_ACESTEP_5HZ_LM_0_6B_Q8_0, AUDIOGEN_ACESTEP_V15_TURBO_Q4_K_M, A
|
|
|
13
13
|
const sourcePath = process.argv[2];
|
|
14
14
|
const vocalLanguage = process.argv[3];
|
|
15
15
|
if (!sourcePath) {
|
|
16
|
-
console.error('Usage:
|
|
16
|
+
console.error('Usage: npx tsx examples/audiogen/understand-music.ts <source-audio> [language]');
|
|
17
17
|
process.exit(1);
|
|
18
18
|
}
|
|
19
19
|
let modelId;
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
* `tools` or `mcp`, which already constrain output).
|
|
33
33
|
*
|
|
34
34
|
* Run from packages/sdk:
|
|
35
|
-
*
|
|
35
|
+
* npx tsx examples/batch-completion.ts
|
|
36
36
|
*/
|
|
37
37
|
import { batchCompletion, loadModel, unloadModel, LLAMA_3_2_1B_INST_Q4_0 } from '@qvac/sdk';
|
|
38
38
|
try {
|
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
* session, printing transcript text as the sliding window decodes
|
|
7
7
|
* successive windows.
|
|
8
8
|
*
|
|
9
|
-
* Usage:
|
|
9
|
+
* Usage: npx tsx examples/bci/bci-filesystem-streaming.ts <neural-bin-file-path>
|
|
10
10
|
*/
|
|
11
11
|
import { loadModel, unloadModel, bciTranscribeStream, BCI_WINDOWED } from '@qvac/sdk';
|
|
12
12
|
import { readFileSync } from 'fs';
|
|
13
13
|
const args = process.argv.slice(2);
|
|
14
14
|
if (!args[0]) {
|
|
15
|
-
console.error('Usage:
|
|
15
|
+
console.error('Usage: npx tsx examples/bci/bci-filesystem-streaming.ts <neural-bin-file-path>');
|
|
16
16
|
process.exit(1);
|
|
17
17
|
}
|
|
18
18
|
const neuralFilePath = args[0];
|
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
* (whisper.cpp) addon in one shot via `bciTranscribe`, and prints the
|
|
6
6
|
* decoded transcript.
|
|
7
7
|
*
|
|
8
|
-
* Usage:
|
|
8
|
+
* Usage: npx tsx examples/bci/bci-filesystem.ts <neural-bin-file-path>
|
|
9
9
|
*/
|
|
10
10
|
import { loadModel, unloadModel, bciTranscribe, BCI_WINDOWED } from '@qvac/sdk';
|
|
11
11
|
const args = process.argv.slice(2);
|
|
12
12
|
if (!args[0]) {
|
|
13
|
-
console.error('Usage:
|
|
13
|
+
console.error('Usage: npx tsx examples/bci/bci-filesystem.ts <neural-bin-file-path>');
|
|
14
14
|
process.exit(1);
|
|
15
15
|
}
|
|
16
16
|
const neuralFilePath = args[0];
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
* distinct models never block each other).
|
|
20
20
|
*
|
|
21
21
|
* Run from packages/sdk:
|
|
22
|
-
*
|
|
22
|
+
* npx tsx examples/concurrent-completion-collision.ts
|
|
23
23
|
*/
|
|
24
24
|
import { completion, loadModel, unloadModel, QWEN3_1_7B_INST_Q4, LLAMA_3_2_1B_INST_Q4_0, RequestRejectedByPolicyError } from '@qvac/sdk';
|
|
25
25
|
async function runCompletion(label, modelId, prompt) {
|
|
@@ -2,7 +2,7 @@ import { WHISPER_TINY, loadModel, transcribe, unloadModel } from '@qvac/sdk';
|
|
|
2
2
|
// Parse command line arguments
|
|
3
3
|
const args = process.argv.slice(2);
|
|
4
4
|
if (!args[0]) {
|
|
5
|
-
console.error('✖ Usage:
|
|
5
|
+
console.error('✖ Usage: npx tsx examples/config-reload.ts <audio-file-path>');
|
|
6
6
|
process.exit(1);
|
|
7
7
|
}
|
|
8
8
|
const audioFilePath = args[0];
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { loadModel, decide, unloadModel, close, LAYA_MULTILINGUAL_322M_Q8_0 } from '@qvac/sdk';
|
|
2
|
+
const modelSrc = process.argv[2] ?? LAYA_MULTILINGUAL_322M_Q8_0;
|
|
3
|
+
let modelId;
|
|
4
|
+
try {
|
|
5
|
+
console.error('▸ Loading decision model');
|
|
6
|
+
modelId = await loadModel({
|
|
7
|
+
modelSrc,
|
|
8
|
+
modelType: 'llamacpp-decision',
|
|
9
|
+
modelConfig: { device: 'cpu' }
|
|
10
|
+
});
|
|
11
|
+
const result = await decide({
|
|
12
|
+
modelId,
|
|
13
|
+
state: 'My payment failed twice and I was charged both times. Please refund the duplicate.',
|
|
14
|
+
questions: {
|
|
15
|
+
department: {
|
|
16
|
+
type: 'choice',
|
|
17
|
+
instructions: 'Which team should handle this ticket?',
|
|
18
|
+
criteria: ['billing', 'technical']
|
|
19
|
+
},
|
|
20
|
+
urgency: {
|
|
21
|
+
type: 'score',
|
|
22
|
+
instructions: 'How urgent is this?',
|
|
23
|
+
criteria: ['not urgent', 'somewhat urgent', 'very urgent']
|
|
24
|
+
},
|
|
25
|
+
refund: { type: 'noul', instructions: 'The customer asks for a refund.' }
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
console.log(JSON.stringify(result, null, 2));
|
|
29
|
+
}
|
|
30
|
+
catch (error) {
|
|
31
|
+
console.error('✖', error);
|
|
32
|
+
process.exitCode = 1;
|
|
33
|
+
}
|
|
34
|
+
finally {
|
|
35
|
+
if (modelId)
|
|
36
|
+
await unloadModel({ modelId });
|
|
37
|
+
await close();
|
|
38
|
+
}
|