@spekoai/sdk 0.4.0 → 0.4.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/CHANGELOG.md +28 -0
- package/README.md +32 -3
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/lib/client.d.ts +12 -6
- package/dist/lib/client.d.ts.map +1 -1
- package/dist/lib/client.js +20 -11
- package/dist/lib/http.d.ts +1 -0
- package/dist/lib/http.d.ts.map +1 -1
- package/dist/lib/http.js +4 -1
- package/dist/lib/resources/agents.d.ts +27 -10
- package/dist/lib/resources/agents.d.ts.map +1 -1
- package/dist/lib/resources/agents.js +58 -14
- package/dist/lib/resources/callbacks.d.ts +13 -0
- package/dist/lib/resources/callbacks.d.ts.map +1 -0
- package/dist/lib/resources/callbacks.js +26 -0
- package/dist/lib/resources/calls.d.ts +18 -0
- package/dist/lib/resources/calls.d.ts.map +1 -0
- package/dist/lib/resources/calls.js +33 -0
- package/dist/lib/resources/complete.d.ts +1 -1
- package/dist/lib/resources/complete.d.ts.map +1 -1
- package/dist/lib/resources/complete.js +9 -3
- package/dist/lib/resources/credits.d.ts.map +1 -1
- package/dist/lib/resources/knowledge-bases.d.ts +1 -1
- package/dist/lib/resources/knowledge-bases.d.ts.map +1 -1
- package/dist/lib/resources/knowledge-bases.js +1 -1
- package/dist/lib/resources/phone-numbers.d.ts +20 -6
- package/dist/lib/resources/phone-numbers.d.ts.map +1 -1
- package/dist/lib/resources/phone-numbers.js +27 -5
- package/dist/lib/resources/realtime.d.ts +1 -1
- package/dist/lib/resources/realtime.d.ts.map +1 -1
- package/dist/lib/resources/realtime.js +28 -3
- package/dist/lib/resources/synthesize.d.ts +1 -1
- package/dist/lib/resources/synthesize.d.ts.map +1 -1
- package/dist/lib/resources/synthesize.js +3 -1
- package/dist/lib/resources/transcribe.d.ts +1 -1
- package/dist/lib/resources/transcribe.d.ts.map +1 -1
- package/dist/lib/resources/transcribe.js +5 -2
- package/dist/lib/resources/usage.d.ts +1 -1
- package/dist/lib/resources/usage.d.ts.map +1 -1
- package/dist/lib/resources/voice.d.ts +3 -4
- package/dist/lib/resources/voice.d.ts.map +1 -1
- package/dist/lib/resources/voice.js +3 -4
- package/dist/lib/resources/voices.d.ts +27 -0
- package/dist/lib/resources/voices.d.ts.map +1 -0
- package/dist/lib/resources/voices.js +32 -0
- package/dist/lib/types/index.d.ts +561 -20
- package/dist/lib/types/index.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -18,7 +18,7 @@ const DEFAULT_POLL_TIMEOUT_MS = 120_000;
|
|
|
18
18
|
* const doc = await speko.knowledgeBases.uploadDocument(kb.id, {
|
|
19
19
|
* filename: 'faq.md',
|
|
20
20
|
* contentType: 'text/markdown',
|
|
21
|
-
* data: await
|
|
21
|
+
* data: await readFile('faq.md'),
|
|
22
22
|
* });
|
|
23
23
|
*
|
|
24
24
|
* const ready = await speko.knowledgeBases.pollDocumentReady(kb.id, doc.id);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { HttpClient } from '../http.js';
|
|
2
|
-
import type { AvailablePhoneNumber, PhoneNumberCreateParams, PhoneNumberRow, PhoneNumberSearchParams, PhoneNumberUpdateParams } from '../types/index.js';
|
|
2
|
+
import type { AvailablePhoneNumber, PhoneNumberCreateParams, PhoneNumberImportSipTrunkParams, PhoneNumberKybDraftParams, PhoneNumberKybOverview, PhoneNumberKybSubmission, PhoneNumberKybSubmitParams, PhoneNumberRow, PhoneNumberSearchParams, PhoneNumberUpdateParams } from '../types/index.js';
|
|
3
3
|
/**
|
|
4
|
-
* Phone numbers Speko has provisioned
|
|
5
|
-
*
|
|
6
|
-
* inbound, and carries an optional metadata template that's
|
|
7
|
-
* the worker dispatch payload when the number is used.
|
|
4
|
+
* Phone numbers Speko has provisioned as managed numbers or registered
|
|
5
|
+
* from your own SIP trunk. Each number can be used for outbound dialing
|
|
6
|
+
* and/or inbound, and carries an optional metadata template that's
|
|
7
|
+
* merged into the worker dispatch payload when the number is used.
|
|
8
8
|
*
|
|
9
9
|
* @example
|
|
10
10
|
* ```ts
|
|
@@ -28,7 +28,7 @@ export declare class PhoneNumbers {
|
|
|
28
28
|
constructor(http: HttpClient);
|
|
29
29
|
list(): Promise<PhoneNumberRow[]>;
|
|
30
30
|
/**
|
|
31
|
-
* Search
|
|
31
|
+
* Search the platform-managed pool for orderable US numbers. Filter by area code
|
|
32
32
|
* and/or locality. Results include cost so you can preview "$1 upfront +
|
|
33
33
|
* $1/month" before committing to {@link create}.
|
|
34
34
|
*
|
|
@@ -41,9 +41,23 @@ export declare class PhoneNumbers {
|
|
|
41
41
|
searchAvailable(params?: PhoneNumberSearchParams): Promise<AvailablePhoneNumber[]>;
|
|
42
42
|
get(id: string): Promise<PhoneNumberRow>;
|
|
43
43
|
create(params: PhoneNumberCreateParams): Promise<PhoneNumberRow>;
|
|
44
|
+
importSipTrunk(params: PhoneNumberImportSipTrunkParams): Promise<PhoneNumberRow>;
|
|
44
45
|
update(id: string, params: PhoneNumberUpdateParams): Promise<PhoneNumberRow>;
|
|
45
46
|
delete(id: string): Promise<{
|
|
46
47
|
released: boolean;
|
|
47
48
|
}>;
|
|
49
|
+
/**
|
|
50
|
+
* Read business verification state used to gate managed phone-number purchases.
|
|
51
|
+
* Includes the latest submission plus any SMS 10DLC-derived prefill.
|
|
52
|
+
*/
|
|
53
|
+
getKyb(): Promise<PhoneNumberKybOverview>;
|
|
54
|
+
/**
|
|
55
|
+
* Save a draft business verification submission without sending it for review.
|
|
56
|
+
*/
|
|
57
|
+
saveKybDraft(params: PhoneNumberKybDraftParams): Promise<PhoneNumberKybSubmission>;
|
|
58
|
+
/**
|
|
59
|
+
* Submit business verification for review. `attestationAccepted` must be `true`.
|
|
60
|
+
*/
|
|
61
|
+
submitKyb(params: PhoneNumberKybSubmitParams): Promise<PhoneNumberKybSubmission>;
|
|
48
62
|
}
|
|
49
63
|
//# sourceMappingURL=phone-numbers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"phone-numbers.d.ts","sourceRoot":"","sources":["../../../src/lib/resources/phone-numbers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,KAAK,EACV,oBAAoB,EACpB,uBAAuB,EACvB,cAAc,EACd,uBAAuB,EACvB,uBAAuB,EACxB,MAAM,mBAAmB,CAAC;AAE3B;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,qBAAa,YAAY;IACX,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,UAAU;IAE7C,IAAI,IAAI,OAAO,CAAC,cAAc,EAAE,CAAC;IAIjC;;;;;;;;;;OAUG;IACH,eAAe,
|
|
1
|
+
{"version":3,"file":"phone-numbers.d.ts","sourceRoot":"","sources":["../../../src/lib/resources/phone-numbers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,KAAK,EACV,oBAAoB,EACpB,uBAAuB,EACvB,+BAA+B,EAC/B,yBAAyB,EACzB,sBAAsB,EACtB,wBAAwB,EACxB,0BAA0B,EAC1B,cAAc,EACd,uBAAuB,EACvB,uBAAuB,EACxB,MAAM,mBAAmB,CAAC;AAE3B;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,qBAAa,YAAY;IACX,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,UAAU;IAE7C,IAAI,IAAI,OAAO,CAAC,cAAc,EAAE,CAAC;IAIjC;;;;;;;;;;OAUG;IACH,eAAe,CAAC,MAAM,GAAE,uBAA4B,GAAG,OAAO,CAAC,oBAAoB,EAAE,CAAC;IAWtF,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IAIxC,MAAM,CAAC,MAAM,EAAE,uBAAuB,GAAG,OAAO,CAAC,cAAc,CAAC;IAIhE,cAAc,CAAC,MAAM,EAAE,+BAA+B,GAAG,OAAO,CAAC,cAAc,CAAC;IAIhF,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,uBAAuB,GAAG,OAAO,CAAC,cAAc,CAAC;IAI5E,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,QAAQ,EAAE,OAAO,CAAA;KAAE,CAAC;IAIlD;;;OAGG;IACH,MAAM,IAAI,OAAO,CAAC,sBAAsB,CAAC;IAIzC;;OAEG;IACH,YAAY,CAAC,MAAM,EAAE,yBAAyB,GAAG,OAAO,CAAC,wBAAwB,CAAC;IAIlF;;OAEG;IACH,SAAS,CAAC,MAAM,EAAE,0BAA0B,GAAG,OAAO,CAAC,wBAAwB,CAAC;CAGjF"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Phone numbers Speko has provisioned
|
|
3
|
-
*
|
|
4
|
-
* inbound, and carries an optional metadata template that's
|
|
5
|
-
* the worker dispatch payload when the number is used.
|
|
2
|
+
* Phone numbers Speko has provisioned as managed numbers or registered
|
|
3
|
+
* from your own SIP trunk. Each number can be used for outbound dialing
|
|
4
|
+
* and/or inbound, and carries an optional metadata template that's
|
|
5
|
+
* merged into the worker dispatch payload when the number is used.
|
|
6
6
|
*
|
|
7
7
|
* @example
|
|
8
8
|
* ```ts
|
|
@@ -30,7 +30,7 @@ export class PhoneNumbers {
|
|
|
30
30
|
return this.http.get('/v1/phone-numbers');
|
|
31
31
|
}
|
|
32
32
|
/**
|
|
33
|
-
* Search
|
|
33
|
+
* Search the platform-managed pool for orderable US numbers. Filter by area code
|
|
34
34
|
* and/or locality. Results include cost so you can preview "$1 upfront +
|
|
35
35
|
* $1/month" before committing to {@link create}.
|
|
36
36
|
*
|
|
@@ -57,10 +57,32 @@ export class PhoneNumbers {
|
|
|
57
57
|
create(params) {
|
|
58
58
|
return this.http.post('/v1/phone-numbers', params);
|
|
59
59
|
}
|
|
60
|
+
importSipTrunk(params) {
|
|
61
|
+
return this.http.post('/v1/phone-numbers/import', params);
|
|
62
|
+
}
|
|
60
63
|
update(id, params) {
|
|
61
64
|
return this.http.patch(`/v1/phone-numbers/${encodeURIComponent(id)}`, params);
|
|
62
65
|
}
|
|
63
66
|
delete(id) {
|
|
64
67
|
return this.http.delete(`/v1/phone-numbers/${encodeURIComponent(id)}`);
|
|
65
68
|
}
|
|
69
|
+
/**
|
|
70
|
+
* Read business verification state used to gate managed phone-number purchases.
|
|
71
|
+
* Includes the latest submission plus any SMS 10DLC-derived prefill.
|
|
72
|
+
*/
|
|
73
|
+
getKyb() {
|
|
74
|
+
return this.http.get('/v1/phone-numbers/kyb');
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Save a draft business verification submission without sending it for review.
|
|
78
|
+
*/
|
|
79
|
+
saveKybDraft(params) {
|
|
80
|
+
return this.http.put('/v1/phone-numbers/kyb/draft', params);
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Submit business verification for review. `attestationAccepted` must be `true`.
|
|
84
|
+
*/
|
|
85
|
+
submitKyb(params) {
|
|
86
|
+
return this.http.post('/v1/phone-numbers/kyb/submit', params);
|
|
87
|
+
}
|
|
66
88
|
}
|
|
@@ -7,7 +7,7 @@ export declare class Realtime {
|
|
|
7
7
|
* Open a speech-to-speech session. Posts `/v1/sessions` with `mode: 's2s'`
|
|
8
8
|
* to mint a short-lived WebSocket token, then opens a direct WS to the
|
|
9
9
|
* server's S2S proxy. The proxy bridges to the underlying provider
|
|
10
|
-
* (OpenAI Realtime, Gemini Live, xAI Grok Voice) so the client sees a
|
|
10
|
+
* (OpenAI Realtime, Gemini Live, xAI Grok Voice, Inworld) so the client sees a
|
|
11
11
|
* single transport regardless of which backend is in use.
|
|
12
12
|
*/
|
|
13
13
|
connect(params: RealtimeConnectParams): Promise<RealtimeSessionHandle>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"realtime.d.ts","sourceRoot":"","sources":["../../../src/lib/resources/realtime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,KAAK,EACV,qBAAqB,EAGrB,qBAAqB,EACtB,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"realtime.d.ts","sourceRoot":"","sources":["../../../src/lib/resources/realtime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,KAAK,EACV,qBAAqB,EAGrB,qBAAqB,EACtB,MAAM,mBAAmB,CAAC;AAY3B,qBAAa,QAAQ;IACP,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,UAAU;IAE7C;;;;;;OAMG;IACG,OAAO,CAAC,MAAM,EAAE,qBAAqB,GAAG,OAAO,CAAC,qBAAqB,CAAC;CA0B7E"}
|
|
@@ -7,7 +7,7 @@ export class Realtime {
|
|
|
7
7
|
* Open a speech-to-speech session. Posts `/v1/sessions` with `mode: 's2s'`
|
|
8
8
|
* to mint a short-lived WebSocket token, then opens a direct WS to the
|
|
9
9
|
* server's S2S proxy. The proxy bridges to the underlying provider
|
|
10
|
-
* (OpenAI Realtime, Gemini Live, xAI Grok Voice) so the client sees a
|
|
10
|
+
* (OpenAI Realtime, Gemini Live, xAI Grok Voice, Inworld) so the client sees a
|
|
11
11
|
* single transport regardless of which backend is in use.
|
|
12
12
|
*/
|
|
13
13
|
async connect(params) {
|
|
@@ -26,18 +26,22 @@ export class Realtime {
|
|
|
26
26
|
metadata: params.metadata,
|
|
27
27
|
ttlSeconds: params.ttlSeconds,
|
|
28
28
|
});
|
|
29
|
-
return new BrowserRealtimeHandle(response.sessionId, response.wsUrl, response.wsToken, response.expiresAt);
|
|
29
|
+
return new BrowserRealtimeHandle(response.sessionId, response.wsUrl, response.wsToken, response.expiresAt, response.inputSampleRate, response.outputSampleRate);
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
class BrowserRealtimeHandle {
|
|
33
33
|
sessionId;
|
|
34
34
|
expiresAt;
|
|
35
|
+
inputSampleRate;
|
|
36
|
+
outputSampleRate;
|
|
35
37
|
ws;
|
|
36
38
|
handlers = new Set();
|
|
37
39
|
closed = false;
|
|
38
|
-
constructor(sessionId, wsUrl, wsToken, expiresAt) {
|
|
40
|
+
constructor(sessionId, wsUrl, wsToken, expiresAt, inputSampleRate, outputSampleRate) {
|
|
39
41
|
this.sessionId = sessionId;
|
|
40
42
|
this.expiresAt = expiresAt;
|
|
43
|
+
this.inputSampleRate = inputSampleRate;
|
|
44
|
+
this.outputSampleRate = outputSampleRate;
|
|
41
45
|
// Pass the token as the first subprotocol — browsers can't set headers
|
|
42
46
|
// on `new WebSocket()`, so subprotocol is the only auth carrier that
|
|
43
47
|
// doesn't leak through URL params.
|
|
@@ -134,6 +138,27 @@ class BrowserRealtimeHandle {
|
|
|
134
138
|
final: Boolean(parsed['final']),
|
|
135
139
|
});
|
|
136
140
|
break;
|
|
141
|
+
case 'ready':
|
|
142
|
+
this.emit({
|
|
143
|
+
type: 'ready',
|
|
144
|
+
inputSampleRate: Number(parsed['inputSampleRate'] ?? this.inputSampleRate),
|
|
145
|
+
outputSampleRate: Number(parsed['outputSampleRate'] ?? this.outputSampleRate),
|
|
146
|
+
});
|
|
147
|
+
break;
|
|
148
|
+
case 'interruption':
|
|
149
|
+
this.emit({
|
|
150
|
+
type: 'interruption',
|
|
151
|
+
at: parsed['at'] === 'assistant' ? 'assistant' : 'user',
|
|
152
|
+
});
|
|
153
|
+
break;
|
|
154
|
+
case 'server_tool_call':
|
|
155
|
+
this.emit({
|
|
156
|
+
type: 'server_tool_call',
|
|
157
|
+
id: String(parsed['id'] ?? ''),
|
|
158
|
+
name: String(parsed['name'] ?? ''),
|
|
159
|
+
status: String(parsed['status'] ?? 'started'),
|
|
160
|
+
});
|
|
161
|
+
break;
|
|
137
162
|
case 'tool_call':
|
|
138
163
|
this.emit({
|
|
139
164
|
type: 'tool_call',
|
|
@@ -5,7 +5,7 @@ export declare class Synthesize {
|
|
|
5
5
|
constructor(http: HttpClient);
|
|
6
6
|
/**
|
|
7
7
|
* Synthesize text into audio. The Speko router picks the best TTS provider
|
|
8
|
-
* for your `(language, optimizeFor)` and falls over automatically.
|
|
8
|
+
* for your `(language, region, optimizeFor)` and falls over automatically.
|
|
9
9
|
*
|
|
10
10
|
* The returned audio's format depends on the chosen provider — check the
|
|
11
11
|
* `contentType` field on the result. ElevenLabs returns `audio/mpeg`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"synthesize.d.ts","sourceRoot":"","sources":["../../../src/lib/resources/synthesize.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,KAAK,EACV,iBAAiB,EACjB,gBAAgB,EAChB,sBAAsB,EACvB,MAAM,mBAAmB,CAAC;AAE3B,qBAAa,UAAU;IACT,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,UAAU;IAE7C;;;;;;;;;;;;;;;OAeG;IACG,IAAI,CACR,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,iBAAiB,EAC1B,WAAW,CAAC,EAAE,WAAW,GACxB,OAAO,CAAC,gBAAgB,CAAC;IAiBtB,MAAM,CACV,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,iBAAiB,EAC1B,WAAW,CAAC,EAAE,WAAW,GACxB,OAAO,CAAC,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"synthesize.d.ts","sourceRoot":"","sources":["../../../src/lib/resources/synthesize.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,KAAK,EACV,iBAAiB,EACjB,gBAAgB,EAChB,sBAAsB,EACvB,MAAM,mBAAmB,CAAC;AAE3B,qBAAa,UAAU;IACT,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,UAAU;IAE7C;;;;;;;;;;;;;;;OAeG;IACG,IAAI,CACR,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,iBAAiB,EAC1B,WAAW,CAAC,EAAE,WAAW,GACxB,OAAO,CAAC,gBAAgB,CAAC;IAiBtB,MAAM,CACV,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,iBAAiB,EAC1B,WAAW,CAAC,EAAE,WAAW,GACxB,OAAO,CAAC,sBAAsB,CAAC;CAiCnC"}
|
|
@@ -5,7 +5,7 @@ export class Synthesize {
|
|
|
5
5
|
}
|
|
6
6
|
/**
|
|
7
7
|
* Synthesize text into audio. The Speko router picks the best TTS provider
|
|
8
|
-
* for your `(language, optimizeFor)` and falls over automatically.
|
|
8
|
+
* for your `(language, region, optimizeFor)` and falls over automatically.
|
|
9
9
|
*
|
|
10
10
|
* The returned audio's format depends on the chosen provider — check the
|
|
11
11
|
* `contentType` field on the result. ElevenLabs returns `audio/mpeg`,
|
|
@@ -43,6 +43,8 @@ export class Synthesize {
|
|
|
43
43
|
const body = { text, intent };
|
|
44
44
|
if (options.voice !== undefined)
|
|
45
45
|
body['voice'] = options.voice;
|
|
46
|
+
if (options.model !== undefined)
|
|
47
|
+
body['model'] = options.model;
|
|
46
48
|
if (options.speed !== undefined)
|
|
47
49
|
body['speed'] = options.speed;
|
|
48
50
|
if (options.constraints !== undefined)
|
|
@@ -5,7 +5,7 @@ export declare class Transcribe {
|
|
|
5
5
|
constructor(http: HttpClient);
|
|
6
6
|
/**
|
|
7
7
|
* Transcribe audio. The Speko router picks the best STT provider for
|
|
8
|
-
* your `(language, optimizeFor)` and falls over automatically.
|
|
8
|
+
* your `(language, region, optimizeFor)` and falls over automatically.
|
|
9
9
|
*
|
|
10
10
|
* @example
|
|
11
11
|
* ```ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transcribe.d.ts","sourceRoot":"","sources":["../../../src/lib/resources/transcribe.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"transcribe.d.ts","sourceRoot":"","sources":["../../../src/lib/resources/transcribe.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAEpG,qBAAa,UAAU;IACT,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,UAAU;IAE7C;;;;;;;;;;;OAWG;IACG,IAAI,CACR,KAAK,EAAE,UAAU,EACjB,OAAO,EAAE,iBAAiB,EAC1B,WAAW,CAAC,EAAE,WAAW,GACxB,OAAO,CAAC,gBAAgB,CAAC;IAsBrB,MAAM,CACX,KAAK,EAAE,UAAU,EACjB,OAAO,EAAE,iBAAiB,EAC1B,WAAW,CAAC,EAAE,WAAW,GACxB,qBAAqB,CAAC,qBAAqB,CAAC;CAkChD"}
|
|
@@ -6,7 +6,7 @@ export class Transcribe {
|
|
|
6
6
|
}
|
|
7
7
|
/**
|
|
8
8
|
* Transcribe audio. The Speko router picks the best STT provider for
|
|
9
|
-
* your `(language, optimizeFor)` and falls over automatically.
|
|
9
|
+
* your `(language, region, optimizeFor)` and falls over automatically.
|
|
10
10
|
*
|
|
11
11
|
* @example
|
|
12
12
|
* ```ts
|
|
@@ -58,7 +58,10 @@ export class Transcribe {
|
|
|
58
58
|
}
|
|
59
59
|
const stream = await this.http.requestRawSse('POST', '/v1/transcribe', audio, headers, abortSignal);
|
|
60
60
|
for await (const event of stream) {
|
|
61
|
-
yield {
|
|
61
|
+
yield {
|
|
62
|
+
...event.data,
|
|
63
|
+
type: event.event,
|
|
64
|
+
};
|
|
62
65
|
}
|
|
63
66
|
}
|
|
64
67
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { HttpClient } from '../http.js';
|
|
2
|
-
import type {
|
|
2
|
+
import type { UsageQueryParams, UsageSummary } from '../types/index.js';
|
|
3
3
|
export declare class Usage {
|
|
4
4
|
private readonly http;
|
|
5
5
|
constructor(http: HttpClient);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usage.d.ts","sourceRoot":"","sources":["../../../src/lib/resources/usage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"usage.d.ts","sourceRoot":"","sources":["../../../src/lib/resources/usage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,KAAK,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAExE,qBAAa,KAAK;IACJ,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,UAAU;IAE7C;;;;;;;;OAQG;IACG,GAAG,CAAC,MAAM,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,YAAY,CAAC;CAQ5D"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { HttpClient } from '../http.js';
|
|
2
2
|
import type { VoiceDialParams, VoiceDialResult } from '../types/index.js';
|
|
3
3
|
/**
|
|
4
|
-
* Outbound phone calls via Speko's
|
|
4
|
+
* Outbound phone calls via Speko's managed telephony gateway.
|
|
5
5
|
*
|
|
6
6
|
* @example
|
|
7
7
|
* ```ts
|
|
@@ -19,10 +19,9 @@ export declare class Voice {
|
|
|
19
19
|
/**
|
|
20
20
|
* Place an outbound call. The destination's phone rings; once they pick
|
|
21
21
|
* up, audio bridges to a Speko worker running the configured pipeline
|
|
22
|
-
* (STT→LLM→TTS) on
|
|
22
|
+
* (STT→LLM→TTS) on the media transport.
|
|
23
23
|
*
|
|
24
|
-
* Lifecycle is
|
|
25
|
-
* server-side) and reflected in the `voice_session` row's `status`.
|
|
24
|
+
* Lifecycle is reflected in the `voice_session` row's `status`.
|
|
26
25
|
*/
|
|
27
26
|
dial(params: VoiceDialParams): Promise<VoiceDialResult>;
|
|
28
27
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"voice.d.ts","sourceRoot":"","sources":["../../../src/lib/resources/voice.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAE1E;;;;;;;;;;;;GAYG;AACH,qBAAa,KAAK;IACJ,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,UAAU;IAE7C
|
|
1
|
+
{"version":3,"file":"voice.d.ts","sourceRoot":"","sources":["../../../src/lib/resources/voice.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAE1E;;;;;;;;;;;;GAYG;AACH,qBAAa,KAAK;IACJ,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,UAAU;IAE7C;;;;;;OAMG;IACG,IAAI,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC;CAG9D"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Outbound phone calls via Speko's
|
|
2
|
+
* Outbound phone calls via Speko's managed telephony gateway.
|
|
3
3
|
*
|
|
4
4
|
* @example
|
|
5
5
|
* ```ts
|
|
@@ -19,10 +19,9 @@ export class Voice {
|
|
|
19
19
|
/**
|
|
20
20
|
* Place an outbound call. The destination's phone rings; once they pick
|
|
21
21
|
* up, audio bridges to a Speko worker running the configured pipeline
|
|
22
|
-
* (STT→LLM→TTS) on
|
|
22
|
+
* (STT→LLM→TTS) on the media transport.
|
|
23
23
|
*
|
|
24
|
-
* Lifecycle is
|
|
25
|
-
* server-side) and reflected in the `voice_session` row's `status`.
|
|
24
|
+
* Lifecycle is reflected in the `voice_session` row's `status`.
|
|
26
25
|
*/
|
|
27
26
|
async dial(params) {
|
|
28
27
|
return this.http.post('/v1/sessions/phone', params);
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { HttpClient } from '../http.js';
|
|
2
|
+
import type { VoicesListParams, VoicesListResult } from '../types/index.js';
|
|
3
|
+
/**
|
|
4
|
+
* Read-only TTS voice catalog. Use this to browse the curated list of
|
|
5
|
+
* voices per provider before calling `speko.synthesize` — handy for
|
|
6
|
+
* picking a voice id without reading each provider's API docs.
|
|
7
|
+
*
|
|
8
|
+
* ElevenLabs voices are account-scoped and are NOT returned by this
|
|
9
|
+
* endpoint; the response's `providers` array sets
|
|
10
|
+
* `voicesFetchedLive: true` on the elevenlabs entry as a signal to
|
|
11
|
+
* fetch them directly from ElevenLabs at runtime.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* // All voices, every provider:
|
|
16
|
+
* const { voices, providers } = await speko.voices.list();
|
|
17
|
+
*
|
|
18
|
+
* // Just Cartesia:
|
|
19
|
+
* const cartesia = await speko.voices.list({ provider: 'cartesia' });
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export declare class Voices {
|
|
23
|
+
private readonly http;
|
|
24
|
+
constructor(http: HttpClient);
|
|
25
|
+
list(params?: VoicesListParams): Promise<VoicesListResult>;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=voices.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"voices.d.ts","sourceRoot":"","sources":["../../../src/lib/resources/voices.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAE5E;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBAAa,MAAM;IACL,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,UAAU;IAEvC,IAAI,CAAC,MAAM,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAC;CAMjE"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Read-only TTS voice catalog. Use this to browse the curated list of
|
|
3
|
+
* voices per provider before calling `speko.synthesize` — handy for
|
|
4
|
+
* picking a voice id without reading each provider's API docs.
|
|
5
|
+
*
|
|
6
|
+
* ElevenLabs voices are account-scoped and are NOT returned by this
|
|
7
|
+
* endpoint; the response's `providers` array sets
|
|
8
|
+
* `voicesFetchedLive: true` on the elevenlabs entry as a signal to
|
|
9
|
+
* fetch them directly from ElevenLabs at runtime.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* // All voices, every provider:
|
|
14
|
+
* const { voices, providers } = await speko.voices.list();
|
|
15
|
+
*
|
|
16
|
+
* // Just Cartesia:
|
|
17
|
+
* const cartesia = await speko.voices.list({ provider: 'cartesia' });
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export class Voices {
|
|
21
|
+
http;
|
|
22
|
+
constructor(http) {
|
|
23
|
+
this.http = http;
|
|
24
|
+
}
|
|
25
|
+
async list(params) {
|
|
26
|
+
const query = new URLSearchParams();
|
|
27
|
+
if (params?.provider)
|
|
28
|
+
query.set('provider', params.provider);
|
|
29
|
+
const qs = query.toString();
|
|
30
|
+
return this.http.get(`/v1/voices${qs ? `?${qs}` : ''}`);
|
|
31
|
+
}
|
|
32
|
+
}
|