@jambonz/sdk 0.1.5 → 0.1.6
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/dist/client/index.d.cts +2 -2
- package/dist/client/index.d.ts +2 -2
- package/dist/index.cjs +78 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +78 -7
- package/dist/index.js.map +1 -1
- package/dist/{rest-BF9HKZrA.d.ts → rest-Ct1hlTMi.d.ts} +1 -1
- package/dist/{rest-v8weIueZ.d.cts → rest-CtGvvaaV.d.cts} +1 -1
- package/dist/types/index.d.cts +2 -2
- package/dist/types/index.d.ts +2 -2
- package/dist/{verb-builder-DkHAJrk4.d.cts → verb-builder-BJalSF8p.d.cts} +15 -1
- package/dist/{verb-builder-Dg_IPC4I.d.ts → verb-builder-CclNap8d.d.ts} +15 -1
- package/dist/{verbs-fjJjfGEt.d.cts → verbs-boTMgOLb.d.cts} +83 -9
- package/dist/{verbs-fjJjfGEt.d.ts → verbs-boTMgOLb.d.ts} +83 -9
- package/dist/webhook/index.cjs +36 -0
- package/dist/webhook/index.cjs.map +1 -1
- package/dist/webhook/index.d.cts +2 -2
- package/dist/webhook/index.d.ts +2 -2
- package/dist/webhook/index.js +36 -0
- package/dist/webhook/index.js.map +1 -1
- package/dist/websocket/index.cjs +78 -7
- package/dist/websocket/index.cjs.map +1 -1
- package/dist/websocket/index.d.cts +17 -3
- package/dist/websocket/index.d.ts +17 -3
- package/dist/websocket/index.js +78 -7
- package/dist/websocket/index.js.map +1 -1
- package/package.json +2 -2
- package/schema/components/llm-base.schema.json +94 -0
- package/schema/jambonz-app.schema.json +8 -2
- package/schema/verbs/deepgram_s2s.schema.json +22 -0
- package/schema/verbs/dialogflow.schema.json +120 -0
- package/schema/verbs/elevenlabs_s2s.schema.json +22 -0
- package/schema/verbs/google_s2s.schema.json +23 -0
- package/schema/verbs/llm.schema.json +1 -101
- package/schema/verbs/openai_s2s.schema.json +23 -0
- package/schema/verbs/pipeline.schema.json +2 -1
- package/schema/verbs/s2s.schema.json +26 -0
- package/schema/verbs/stream.schema.json +2 -1
- package/schema/verbs/ultravox_s2s.schema.json +22 -0
package/dist/index.js
CHANGED
|
@@ -33,6 +33,7 @@ var COMPONENT_SCHEMAS = [
|
|
|
33
33
|
"recognizer-sonioxOptions",
|
|
34
34
|
"recognizer-speechmaticsOptions",
|
|
35
35
|
"recognizer-verbioOptions",
|
|
36
|
+
"llm-base",
|
|
36
37
|
"synthesizer",
|
|
37
38
|
"target",
|
|
38
39
|
"vad"
|
|
@@ -48,6 +49,13 @@ var VERB_SCHEMAS = [
|
|
|
48
49
|
"listen",
|
|
49
50
|
"stream",
|
|
50
51
|
"llm",
|
|
52
|
+
"s2s",
|
|
53
|
+
"openai_s2s",
|
|
54
|
+
"google_s2s",
|
|
55
|
+
"elevenlabs_s2s",
|
|
56
|
+
"deepgram_s2s",
|
|
57
|
+
"ultravox_s2s",
|
|
58
|
+
"dialogflow",
|
|
51
59
|
"pipeline",
|
|
52
60
|
"conference",
|
|
53
61
|
"transcribe",
|
|
@@ -173,6 +181,34 @@ var VerbBuilder = class {
|
|
|
173
181
|
llm(opts) {
|
|
174
182
|
return this.addVerb({ verb: "llm", ...opts });
|
|
175
183
|
}
|
|
184
|
+
/** Synonym for {@link llm}. Requires vendor to be specified. */
|
|
185
|
+
s2s(opts) {
|
|
186
|
+
return this.addVerb({ verb: "s2s", ...opts });
|
|
187
|
+
}
|
|
188
|
+
/** Shortcut for s2s with vendor='openai'. */
|
|
189
|
+
openai_s2s(opts) {
|
|
190
|
+
return this.addVerb({ verb: "openai_s2s", ...opts });
|
|
191
|
+
}
|
|
192
|
+
/** Shortcut for s2s with vendor='google'. */
|
|
193
|
+
google_s2s(opts) {
|
|
194
|
+
return this.addVerb({ verb: "google_s2s", ...opts });
|
|
195
|
+
}
|
|
196
|
+
/** Shortcut for s2s with vendor='elevenlabs'. */
|
|
197
|
+
elevenlabs_s2s(opts) {
|
|
198
|
+
return this.addVerb({ verb: "elevenlabs_s2s", ...opts });
|
|
199
|
+
}
|
|
200
|
+
/** Shortcut for s2s with vendor='deepgram'. */
|
|
201
|
+
deepgram_s2s(opts) {
|
|
202
|
+
return this.addVerb({ verb: "deepgram_s2s", ...opts });
|
|
203
|
+
}
|
|
204
|
+
/** Shortcut for s2s with vendor='ultravox'. */
|
|
205
|
+
ultravox_s2s(opts) {
|
|
206
|
+
return this.addVerb({ verb: "ultravox_s2s", ...opts });
|
|
207
|
+
}
|
|
208
|
+
/** Connect the caller to a Google Dialogflow agent (ES, CX, or CES). */
|
|
209
|
+
dialogflow(opts) {
|
|
210
|
+
return this.addVerb({ verb: "dialogflow", ...opts });
|
|
211
|
+
}
|
|
176
212
|
/** Voice AI pipeline with integrated turn detection. */
|
|
177
213
|
pipeline(opts) {
|
|
178
214
|
return this.addVerb({ verb: "pipeline", ...opts });
|
|
@@ -450,11 +486,46 @@ var Session = class extends EventEmitter {
|
|
|
450
486
|
this.builder.gather(opts);
|
|
451
487
|
return this;
|
|
452
488
|
}
|
|
453
|
-
/** Connect the caller to an LLM for real-time voice conversation. */
|
|
489
|
+
/** Connect the caller to an LLM for real-time voice conversation (deprecated — use vendor shortcuts). */
|
|
454
490
|
llm(opts) {
|
|
455
491
|
this.builder.llm(opts);
|
|
456
492
|
return this;
|
|
457
493
|
}
|
|
494
|
+
/** Connect the caller to a speech-to-speech LLM. */
|
|
495
|
+
s2s(opts) {
|
|
496
|
+
this.builder.s2s(opts);
|
|
497
|
+
return this;
|
|
498
|
+
}
|
|
499
|
+
/** Shortcut for s2s with vendor='openai'. */
|
|
500
|
+
openai_s2s(opts) {
|
|
501
|
+
this.builder.openai_s2s(opts);
|
|
502
|
+
return this;
|
|
503
|
+
}
|
|
504
|
+
/** Shortcut for s2s with vendor='google'. */
|
|
505
|
+
google_s2s(opts) {
|
|
506
|
+
this.builder.google_s2s(opts);
|
|
507
|
+
return this;
|
|
508
|
+
}
|
|
509
|
+
/** Shortcut for s2s with vendor='elevenlabs'. */
|
|
510
|
+
elevenlabs_s2s(opts) {
|
|
511
|
+
this.builder.elevenlabs_s2s(opts);
|
|
512
|
+
return this;
|
|
513
|
+
}
|
|
514
|
+
/** Shortcut for s2s with vendor='deepgram'. */
|
|
515
|
+
deepgram_s2s(opts) {
|
|
516
|
+
this.builder.deepgram_s2s(opts);
|
|
517
|
+
return this;
|
|
518
|
+
}
|
|
519
|
+
/** Shortcut for s2s with vendor='ultravox'. */
|
|
520
|
+
ultravox_s2s(opts) {
|
|
521
|
+
this.builder.ultravox_s2s(opts);
|
|
522
|
+
return this;
|
|
523
|
+
}
|
|
524
|
+
/** Connect the caller to a Google Dialogflow agent. */
|
|
525
|
+
dialogflow(opts) {
|
|
526
|
+
this.builder.dialogflow(opts);
|
|
527
|
+
return this;
|
|
528
|
+
}
|
|
458
529
|
/** Voice AI pipeline with integrated turn detection. */
|
|
459
530
|
pipeline(opts) {
|
|
460
531
|
this.builder.pipeline(opts);
|
|
@@ -679,10 +750,12 @@ var Session = class extends EventEmitter {
|
|
|
679
750
|
}
|
|
680
751
|
/** Send tool output to an active LLM conversation. */
|
|
681
752
|
sendToolOutput(toolCallId, data) {
|
|
753
|
+
const payload = typeof data === "object" && data !== null ? data : { result: data };
|
|
682
754
|
this.wsSend({
|
|
683
755
|
type: "command",
|
|
684
|
-
command: "llm:tool-
|
|
685
|
-
|
|
756
|
+
command: "llm:tool-output",
|
|
757
|
+
tool_call_id: toolCallId,
|
|
758
|
+
data: payload
|
|
686
759
|
});
|
|
687
760
|
}
|
|
688
761
|
/** Update an active LLM conversation. */
|
|
@@ -1066,10 +1139,8 @@ var WsRouter = class {
|
|
|
1066
1139
|
var WS_PROTOCOL = "ws.jambonz.org";
|
|
1067
1140
|
var AUDIO_PROTOCOL = "audio.drachtio.org";
|
|
1068
1141
|
var defaultLogger = {
|
|
1069
|
-
info: () =>
|
|
1070
|
-
|
|
1071
|
-
error: () => {
|
|
1072
|
-
},
|
|
1142
|
+
info: (...args) => console.log(...args),
|
|
1143
|
+
error: (...args) => console.error(...args),
|
|
1073
1144
|
debug: () => {
|
|
1074
1145
|
}
|
|
1075
1146
|
};
|