@jambonz/sdk 0.1.19 → 0.1.20
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
|
@@ -0,0 +1,104 @@
|
|
|
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. May be '(none)' if no transcript was captured (e.g. an interrupted turn before STT completed)."
|
|
15
|
+
},
|
|
16
|
+
"response": {
|
|
17
|
+
"type": "string",
|
|
18
|
+
"description": "The assistant's full text response for this turn. May be empty or partial if the turn was interrupted."
|
|
19
|
+
},
|
|
20
|
+
"interrupted": {
|
|
21
|
+
"type": "boolean",
|
|
22
|
+
"description": "True if this turn was interrupted by the user barging in before the assistant finished speaking.",
|
|
23
|
+
"default": false
|
|
24
|
+
},
|
|
25
|
+
"latency": {
|
|
26
|
+
"type": "object",
|
|
27
|
+
"description": "Per-component latency metrics for this turn. All values are in milliseconds relative to the start of the turn (when the user began speaking). Fields are absent when not applicable.",
|
|
28
|
+
"properties": {
|
|
29
|
+
"total_ms": {
|
|
30
|
+
"type": "integer",
|
|
31
|
+
"description": "Total turn duration from start of user speech to LLM response completion."
|
|
32
|
+
},
|
|
33
|
+
"stt": {
|
|
34
|
+
"type": "object",
|
|
35
|
+
"description": "Speech-to-text latency metrics.",
|
|
36
|
+
"properties": {
|
|
37
|
+
"final_transcript_ms": {
|
|
38
|
+
"type": "integer",
|
|
39
|
+
"description": "Time from turn start until the final transcript was received from the STT engine."
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"additionalProperties": false
|
|
43
|
+
},
|
|
44
|
+
"llm": {
|
|
45
|
+
"type": "object",
|
|
46
|
+
"description": "LLM latency metrics.",
|
|
47
|
+
"properties": {
|
|
48
|
+
"prompted_ms": {
|
|
49
|
+
"type": "integer",
|
|
50
|
+
"description": "Time from turn start until the LLM was prompted."
|
|
51
|
+
},
|
|
52
|
+
"ttft_ms": {
|
|
53
|
+
"type": "integer",
|
|
54
|
+
"description": "Time-to-first-token: time from LLM prompt to first token received."
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
"additionalProperties": false
|
|
58
|
+
},
|
|
59
|
+
"tts": {
|
|
60
|
+
"type": "object",
|
|
61
|
+
"description": "Text-to-speech latency metrics.",
|
|
62
|
+
"properties": {
|
|
63
|
+
"first_buffered_ms": {
|
|
64
|
+
"type": "integer",
|
|
65
|
+
"description": "Time from turn start until the first LLM token was buffered for TTS."
|
|
66
|
+
},
|
|
67
|
+
"first_send_ms": {
|
|
68
|
+
"type": "integer",
|
|
69
|
+
"description": "Time from turn start until audio was first sent to the TTS engine."
|
|
70
|
+
},
|
|
71
|
+
"buffer_delay_ms": {
|
|
72
|
+
"type": "integer",
|
|
73
|
+
"description": "Delay between first token buffered and first send to TTS engine."
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
"additionalProperties": false
|
|
77
|
+
},
|
|
78
|
+
"preflight": {
|
|
79
|
+
"type": "object",
|
|
80
|
+
"description": "Early generation (preflight) metrics. Only present when earlyGeneration is enabled.",
|
|
81
|
+
"properties": {
|
|
82
|
+
"ms": {
|
|
83
|
+
"type": "integer",
|
|
84
|
+
"description": "Time from turn start until the preflight prompt was sent."
|
|
85
|
+
},
|
|
86
|
+
"result": {
|
|
87
|
+
"type": "string",
|
|
88
|
+
"enum": ["hit", "miss", "pending"],
|
|
89
|
+
"description": "Whether the preflight transcript matched the final transcript ('hit'), did not match ('miss'), or was still in progress ('pending')."
|
|
90
|
+
},
|
|
91
|
+
"tokens": {
|
|
92
|
+
"type": "integer",
|
|
93
|
+
"description": "Number of preflight tokens that were buffered. Only present on a 'hit'."
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
"additionalProperties": false
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
"additionalProperties": false
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
"required": ["type", "transcript", "response", "interrupted", "latency"],
|
|
103
|
+
"additionalProperties": false
|
|
104
|
+
}
|
|
@@ -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",
|