aillom-vox-client 2.1.0 → 2.1.2
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 +32 -6
- package/dist/AillomVox.d.ts +2 -2
- package/dist/AillomVox.js +1 -1
- package/dist/types.d.ts +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,36 @@ 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
|
+
```bash
|
|
60
|
+
git clone https://github.com/aillom/aillom-vox-client.git
|
|
61
|
+
cd aillom-vox-client/examples/npm-quickstart
|
|
62
|
+
npm install
|
|
63
|
+
npm run dev
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Open the Vite URL, paste your `av_...` key, click **Carregar vozes**, then **Iniciar chamada**.
|
|
67
|
+
|
|
68
|
+
Terminal smoke test:
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
mkdir vox-smoke && cd vox-smoke
|
|
72
|
+
npm init -y
|
|
73
|
+
npm install aillom-vox-client
|
|
74
|
+
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 }))"
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Expected output:
|
|
78
|
+
|
|
79
|
+
```text
|
|
80
|
+
{ providers: 7, pricing: 7 }
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### Use the SDK
|
|
84
|
+
|
|
54
85
|
```typescript
|
|
55
86
|
import { AillomVox } from 'aillom-vox-client';
|
|
56
87
|
|
|
@@ -154,6 +185,7 @@ See **[examples/README.md](examples/README.md)** for how to run the browser demo
|
|
|
154
185
|
|
|
155
186
|
| Path | Description |
|
|
156
187
|
| :--- | :--- |
|
|
188
|
+
| [examples/npm-quickstart/](examples/npm-quickstart/) | Published npm package test app with voice catalog, mic, playback, transcripts and text input |
|
|
157
189
|
| [examples/sdk-usage.ts](examples/sdk-usage.ts) | TypeScript sample with catalog fetch + handlers |
|
|
158
190
|
| [examples/01-basic/](examples/01-basic/) | Minimal browser demo |
|
|
159
191
|
| [examples/02-advanced-dashboard/](examples/02-advanced-dashboard/) | Larger UI example |
|
|
@@ -168,12 +200,6 @@ See **[examples/README.md](examples/README.md)** for how to run the browser demo
|
|
|
168
200
|
|
|
169
201
|
---
|
|
170
202
|
|
|
171
|
-
## n8n
|
|
172
|
-
|
|
173
|
-
Community node under [integrations/n8n-nodes-aillomvox/](integrations/n8n-nodes-aillomvox/) (REST operations).
|
|
174
|
-
|
|
175
|
-
---
|
|
176
|
-
|
|
177
203
|
## License
|
|
178
204
|
|
|
179
205
|
ISC © Aillom Technologies
|
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/dist/types.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export interface ClientTool {
|
|
|
9
9
|
description: string;
|
|
10
10
|
/** JSON Schema parameters for the function (OpenAI-style). */
|
|
11
11
|
parameters?: Record<string, unknown>;
|
|
12
|
-
/** Backward-compatible location used by some dashboard
|
|
12
|
+
/** Backward-compatible location used by some dashboard tool presets. */
|
|
13
13
|
config?: Record<string, unknown>;
|
|
14
14
|
/** Optional server-side endpoint metadata, including `aillom-connect://...` tools. */
|
|
15
15
|
url?: string;
|
package/package.json
CHANGED