@jambonz/schema 0.4.25 → 0.4.26
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/docs/verbs/agent.md +29 -0
- package/package.json +1 -1
- package/verbs/agent.schema.json +12 -2
package/docs/verbs/agent.md
CHANGED
|
@@ -331,6 +331,35 @@ For Anthropic models, use `"vendor": "anthropic"` and structure messages accordi
|
|
|
331
331
|
|
|
332
332
|
By default (`greeting: true`), the agent prompts the LLM to generate an initial greeting before the user speaks. Set `greeting: false` if you want the agent to wait silently for the user to speak first.
|
|
333
333
|
|
|
334
|
+
## Controlling what is spoken
|
|
335
|
+
|
|
336
|
+
Everything the LLM writes is normally sent to TTS. Two options change that. Neither changes what the LLM sees: conversation history, `llm_response` events and the `turn_end` transcript always hold the model's raw text.
|
|
337
|
+
|
|
338
|
+
**`speechCleanup`** (default `true`) drops text that models write but don't mean to be heard:
|
|
339
|
+
|
|
340
|
+
- a paragraph that is only a stage direction in `()`, `[]` or `**`, such as `(silence)`, `(empty response)` or `[No response needed - the call has ended]`. Models write these when they are told to stay silent. A bracketed aside inside a sentence, such as "PPO (including Anthem)", is still spoken, and so is a span with no letters in it, such as a phone number's area code.
|
|
341
|
+
- `<think>`, `<thinking>` and `<reasoning>` blocks, wherever they appear.
|
|
342
|
+
|
|
343
|
+
The cleanup runs on the streaming tokens and holds back only text that could still turn out to be one of these, so ordinary speech is not delayed. If nothing is left to say, the reply ends without speaking, the same way as a reply that only called tools. Set `speechCleanup: false` to send the text to TTS exactly as written.
|
|
344
|
+
|
|
345
|
+
**`speak: false`** keeps all of the agent's text out of TTS. Use it for an agent that must never talk, such as one that navigates a DTMF-only phone menu by calling tools. The LLM's replies are still kept, so the agent can take notes for itself. With `speak: false`, `toolFiller` and `earlyGeneration` are turned off.
|
|
346
|
+
|
|
347
|
+
```json
|
|
348
|
+
{
|
|
349
|
+
"verb": "agent",
|
|
350
|
+
"speak": false,
|
|
351
|
+
"llm": {
|
|
352
|
+
"vendor": "anthropic",
|
|
353
|
+
"model": "claude-haiku-4-5",
|
|
354
|
+
"llmOptions": {
|
|
355
|
+
"messages": [
|
|
356
|
+
{ "role": "system", "content": "You navigate phone menus by pressing keys with the send_dtmf tool." }
|
|
357
|
+
]
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
```
|
|
362
|
+
|
|
334
363
|
## Complete example (TypeScript)
|
|
335
364
|
|
|
336
365
|
A voice agent using Deepgram STT, OpenAI LLM, and Cartesia TTS with Krisp turn detection. Exposes multiple endpoints with different STT/TTS combinations:
|
package/package.json
CHANGED
package/verbs/agent.schema.json
CHANGED
|
@@ -26,12 +26,12 @@
|
|
|
26
26
|
{ "type": "boolean" },
|
|
27
27
|
{ "type": "string", "enum": ["always"] }
|
|
28
28
|
],
|
|
29
|
-
"description": "
|
|
29
|
+
"description": "Switch the TTS to the language the caller speaks, using the matching languageConfig entry. Works with any STT that reports the detected language: Deepgram (language 'multi', or Flux Multilingual), AssemblyAI (languageDetection), Google and Azure (altLanguages), Soniox (enableLanguageIdentification), Gladia and Modulate. Values: false (disabled), true (lock on the first utterance whose language is detected), 'always' (re-evaluate every turn). With Deepgram Flux, true also locks the STT language hints to the detected language. Default: false.",
|
|
30
30
|
"default": false
|
|
31
31
|
},
|
|
32
32
|
"languageConfig": {
|
|
33
33
|
"type": "object",
|
|
34
|
-
"description": "Per-language overrides
|
|
34
|
+
"description": "Per-language TTS overrides, used when autoLockLanguage detects a language. Keys are language codes such as 'es' or 'es-MX'. A detected language matches an exact key first (case-insensitive), then a key with the same primary language, so 'es' matches a detected 'es-US'. A detected language with no entry keeps the current TTS. The entry's tts is merged over the agent's tts; set its language to the code the TTS vendor expects.",
|
|
35
35
|
"additionalProperties": {
|
|
36
36
|
"type": "object",
|
|
37
37
|
"properties": {
|
|
@@ -231,6 +231,16 @@
|
|
|
231
231
|
"description": "Enable speculative LLM prompting before end-of-turn is confirmed. When using Krisp turn detection, set this to true to speculatively prompt the LLM before Krisp confirms the turn has ended. If the transcript matches when turn ends, buffered tokens are released immediately — reducing response latency. Note: Deepgram Flux performs early generation automatically via its native EagerEndOfTurn signal regardless of this setting. Default: false.",
|
|
232
232
|
"default": false
|
|
233
233
|
},
|
|
234
|
+
"speak": {
|
|
235
|
+
"type": "boolean",
|
|
236
|
+
"description": "Whether the agent's text is spoken. With false the agent never talks (for example while it drives a DTMF-only phone menu with its tools): the LLM's text is still kept in conversation history, llm_response events and the transcript, but is never sent to TTS, and toolFiller and earlyGeneration are turned off. Each reply ends when the LLM finishes, as for a reply that only called tools. Default: true.",
|
|
237
|
+
"default": true
|
|
238
|
+
},
|
|
239
|
+
"speechCleanup": {
|
|
240
|
+
"type": "boolean",
|
|
241
|
+
"description": "Keep text the model was not meant to say out of TTS: a paragraph that is only a stage direction in (), [] or ** (such as '(silence)' or '[No response needed]'), and <think>, <thinking> or <reasoning> blocks. Asides inside a sentence are still spoken. Applied as the reply streams; ordinary speech is not delayed. A reply with nothing left to say ends without speaking. History, llm_response events and the transcript keep the model's raw text. Default: true.",
|
|
242
|
+
"default": true
|
|
243
|
+
},
|
|
234
244
|
"noiseIsolation": {
|
|
235
245
|
"oneOf": [
|
|
236
246
|
{
|