@jambonz/sdk 0.1.19 → 0.1.21

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jambonz/sdk",
3
- "version": "0.1.19",
3
+ "version": "0.1.21",
4
4
  "description": "jambonz SDK for building voice applications — optimized for AI agents",
5
5
  "author": "Dave Horton",
6
6
  "license": "MIT",
@@ -0,0 +1,71 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://jambonz.org/schema/callbacks/pipeline-turn",
4
+ "title": "Pipeline Turn End Event",
5
+ "description": "Payload sent to the pipeline verb's eventHook at the end of each conversational turn. Provides the user transcript, assistant response, and per-component latency metrics for the turn.",
6
+ "type": "object",
7
+ "properties": {
8
+ "type": {
9
+ "const": "turn_end",
10
+ "description": "Event type identifier."
11
+ },
12
+ "transcript": {
13
+ "type": "string",
14
+ "description": "The user's final speech-to-text transcript for this turn."
15
+ },
16
+ "response": {
17
+ "type": "string",
18
+ "description": "The assistant's text response for this turn. May be partial if the turn was interrupted."
19
+ },
20
+ "interrupted": {
21
+ "type": "boolean",
22
+ "description": "True if the user interrupted the assistant before it finished speaking.",
23
+ "default": false
24
+ },
25
+ "latency": {
26
+ "type": "object",
27
+ "description": "Latency metrics for this turn, all in milliseconds. Fields are absent when not applicable.",
28
+ "properties": {
29
+ "turn_ms": {
30
+ "type": "integer",
31
+ "description": "Total turn duration from start of user speech through assistant response completion."
32
+ },
33
+ "response_ms": {
34
+ "type": "integer",
35
+ "description": "User-perceived response latency: time from end of user speech to first audio played back. This is the headline number most developers care about."
36
+ },
37
+ "stt_ms": {
38
+ "type": "integer",
39
+ "description": "Time from start of user speech until the final transcript was received from the STT engine."
40
+ },
41
+ "llm_ttft_ms": {
42
+ "type": "integer",
43
+ "description": "LLM time-to-first-token: time from when the LLM was prompted until the first response token arrived."
44
+ },
45
+ "tts_ttfa_ms": {
46
+ "type": "integer",
47
+ "description": "TTS time-to-first-audio: time from when the first text chunk was sent to the TTS engine until audio was ready to play."
48
+ },
49
+ "preflight": {
50
+ "type": "object",
51
+ "description": "Early generation (preflight) metrics. Only present when earlyGeneration is enabled.",
52
+ "properties": {
53
+ "result": {
54
+ "type": "string",
55
+ "enum": ["hit", "miss", "pending"],
56
+ "description": "Whether the speculative preflight transcript matched the final transcript ('hit'), did not match ('miss'), or was still in progress ('pending')."
57
+ },
58
+ "tokens": {
59
+ "type": "integer",
60
+ "description": "Number of preflight tokens that were buffered. Only present on a 'hit'."
61
+ }
62
+ },
63
+ "additionalProperties": false
64
+ }
65
+ },
66
+ "additionalProperties": false
67
+ }
68
+ },
69
+ "required": ["type", "transcript", "response", "interrupted", "latency"],
70
+ "additionalProperties": false
71
+ }
@@ -89,7 +89,7 @@
89
89
  },
90
90
  "eventHook": {
91
91
  "$ref": "../components/actionHook",
92
- "description": "A webhook invoked for pipeline events."
92
+ "description": "A webhook invoked for pipeline events. Receives event types: 'user_transcript' (user speech recognized), 'agent_response' (assistant reply), 'user_interruption' (barge-in detected), and 'turn_end' (end-of-turn summary with transcript, response, and latency metrics)."
93
93
  },
94
94
  "toolHook": {
95
95
  "$ref": "../components/actionHook",