aillom-vox-client 2.1.1 → 2.1.3
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/README.md +62 -0
- package/dist/AillomVox.d.ts +2 -2
- package/dist/AillomVox.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -28,6 +28,7 @@ npm install aillom-vox-client
|
|
|
28
28
|
|
|
29
29
|
| Doc | Purpose |
|
|
30
30
|
| :--- | :--- |
|
|
31
|
+
| [docs/NPM_QUICKSTART.md](docs/NPM_QUICKSTART.md) | Copy/paste npm tests for browser and terminal |
|
|
31
32
|
| [docs/PROTOCOL.md](docs/PROTOCOL.md) | WebSocket lifecycle, handshake JSON, PCM rules |
|
|
32
33
|
| [docs/PROVIDERS.md](docs/PROVIDERS.md) | Provider matrix, **public USD/min rate card**, `tts_engine` for `aillomvox` |
|
|
33
34
|
| [docs/VOICES.md](docs/VOICES.md) | Voice catalog notes |
|
|
@@ -51,6 +52,66 @@ Hosted docs: `https://vox.aillom.com/docs`
|
|
|
51
52
|
|
|
52
53
|
## Quick start
|
|
53
54
|
|
|
55
|
+
### Test the published npm package
|
|
56
|
+
|
|
57
|
+
Full browser test with UI.
|
|
58
|
+
|
|
59
|
+
Windows PowerShell:
|
|
60
|
+
|
|
61
|
+
```powershell
|
|
62
|
+
winget install --id OpenJS.NodeJS.LTS -e
|
|
63
|
+
winget install --id Git.Git -e
|
|
64
|
+
git clone https://github.com/aillom/aillom-vox-client.git
|
|
65
|
+
cd aillom-vox-client\examples\npm-quickstart
|
|
66
|
+
npm install
|
|
67
|
+
npm run dev
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Ubuntu / Debian:
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
sudo apt update
|
|
74
|
+
sudo apt install -y git curl ca-certificates
|
|
75
|
+
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash
|
|
76
|
+
export NVM_DIR="$HOME/.nvm"
|
|
77
|
+
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"
|
|
78
|
+
nvm install --lts
|
|
79
|
+
nvm use --lts
|
|
80
|
+
git clone https://github.com/aillom/aillom-vox-client.git
|
|
81
|
+
cd aillom-vox-client/examples/npm-quickstart
|
|
82
|
+
npm install
|
|
83
|
+
npm run dev
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
macOS:
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
brew install node git
|
|
90
|
+
git clone https://github.com/aillom/aillom-vox-client.git
|
|
91
|
+
cd aillom-vox-client/examples/npm-quickstart
|
|
92
|
+
npm install
|
|
93
|
+
npm run dev
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Open the Vite URL, paste your `av_...` key, click **Carregar vozes**, then **Iniciar chamada**. Full setup and troubleshooting steps are in [docs/NPM_QUICKSTART.md](docs/NPM_QUICKSTART.md).
|
|
97
|
+
|
|
98
|
+
Terminal smoke test:
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
mkdir vox-smoke && cd vox-smoke
|
|
102
|
+
npm init -y
|
|
103
|
+
npm install aillom-vox-client
|
|
104
|
+
node -e "const { AillomVox } = require('aillom-vox-client'); Promise.all([AillomVox.fetchProviders({ includeVoices: false }), AillomVox.fetchPricing()]).then(([providers, pricing]) => console.log({ providers: providers.count, pricing: pricing.count }))"
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Expected output:
|
|
108
|
+
|
|
109
|
+
```text
|
|
110
|
+
{ providers: 7, pricing: 7 }
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### Use the SDK
|
|
114
|
+
|
|
54
115
|
```typescript
|
|
55
116
|
import { AillomVox } from 'aillom-vox-client';
|
|
56
117
|
|
|
@@ -154,6 +215,7 @@ See **[examples/README.md](examples/README.md)** for how to run the browser demo
|
|
|
154
215
|
|
|
155
216
|
| Path | Description |
|
|
156
217
|
| :--- | :--- |
|
|
218
|
+
| [examples/npm-quickstart/](examples/npm-quickstart/) | Published npm package test app with voice catalog, mic, playback, transcripts and text input |
|
|
157
219
|
| [examples/sdk-usage.ts](examples/sdk-usage.ts) | TypeScript sample with catalog fetch + handlers |
|
|
158
220
|
| [examples/01-basic/](examples/01-basic/) | Minimal browser demo |
|
|
159
221
|
| [examples/02-advanced-dashboard/](examples/02-advanced-dashboard/) | Larger UI example |
|
package/dist/AillomVox.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { AillomVoxConfig, CloneVoiceOptions, CloneVoiceResult, DeleteVoiceOption
|
|
|
2
2
|
import WebSocket from 'isomorphic-ws';
|
|
3
3
|
export type ClientEvent = 'audio' | 'transcript' | 'tool_call' | 'error' | 'connected' | 'disconnected' | 'interruption' | 'playback_clear_buffer' | 'state' | 'control' | 'raw';
|
|
4
4
|
export interface VoxClientEventMap {
|
|
5
|
-
audio: ArrayBuffer |
|
|
5
|
+
audio: ArrayBuffer | ArrayBufferView;
|
|
6
6
|
transcript: TranscriptEvent;
|
|
7
7
|
tool_call: ToolCallEvent;
|
|
8
8
|
error: ErrorEvent | WebSocket.ErrorEvent | unknown;
|
|
@@ -44,7 +44,7 @@ export declare class AillomVox {
|
|
|
44
44
|
/**
|
|
45
45
|
* Send microphone capture to the model. PCM16 LE mono at the configured `sampleRate`.
|
|
46
46
|
*/
|
|
47
|
-
sendAudio(chunk: ArrayBuffer |
|
|
47
|
+
sendAudio(chunk: ArrayBuffer | ArrayBufferView): void;
|
|
48
48
|
/**
|
|
49
49
|
* Reply to a `tool_call` event within 15 seconds or the model may stall.
|
|
50
50
|
*/
|
package/dist/AillomVox.js
CHANGED
|
@@ -112,7 +112,7 @@ class AillomVox {
|
|
|
112
112
|
sendAudio(chunk) {
|
|
113
113
|
if (!this.ws || this.ws.readyState !== isomorphic_ws_1.default.OPEN)
|
|
114
114
|
return;
|
|
115
|
-
if (chunk
|
|
115
|
+
if (ArrayBuffer.isView(chunk)) {
|
|
116
116
|
this.ws.send(chunk.buffer.slice(chunk.byteOffset, chunk.byteOffset + chunk.byteLength));
|
|
117
117
|
return;
|
|
118
118
|
}
|
package/package.json
CHANGED