hxrdxk
05/22/2025, 8:05 AMhxrdxk
05/22/2025, 8:05 AMVapi Support Bot
05/22/2025, 8:06 AMmessage
event in the Vapi Web SDK to receive assistant messages (such as transcripts or function calls) as they are generated. While this may include the text the assistant is about to speak, it is not guaranteed to always provide the entire message before it is spoken or interrupted. Here’s a code snippet:
js
vapi.on("message", (message) => {
console.log("Assistant generated message:", message);
});
This lets you capture assistant outputs in real time, but retrieving the exact unspoken remainder after an interruption is not explicitly documented.
Sources:
- [Vapi Web SDK documentation](https://docs.vapi.ai/sdk/web#message)
- [Assistant hooks: handling interruptions](https://docs.vapi.ai/assistants/assistant-hooks)Vapi
05/22/2025, 2:13 PMhxrdxk
05/23/2025, 8:44 AMhxrdxk
05/23/2025, 8:45 AMVapi Support Bot
05/23/2025, 8:46 AMmessage
event in the Vapi Web SDK:
js
vapi.on("message", (message) => {
console.log("Assistant generated message:", message);
});
This lets you access the assistant's output in real time, but it may not always provide the full message before it is spoken or interrupted.
[See documentation](https://docs.vapi.ai/sdk/web#message)
Sources:
- [Vapi Web SDK documentation](https://docs.vapi.ai/sdk/web#message)
- [Assistant hooks: handling interruptions](https://docs.vapi.ai/assistants/assistant-hooks)hxrdxk
05/23/2025, 8:46 AMVapi Support Bot
05/23/2025, 8:47 AMmessage
event in the Vapi Web SDK to capture assistant outputs as they are generated, which may include what the assistant is about to speak. However, it is not guaranteed that you will always receive the entire message before it is spoken or interrupted, and retrieving the exact unspoken remainder after an interruption is not explicitly documented ([Vapi Web SDK documentation](https://docs.vapi.ai/sdk/web#message)).
To help further, could you clarify if you are using the Web SDK, or are you looking for a solution in a different environment (e.g., server-side or mobile)?
Sources:
- [Vapi Web SDK documentation](https://docs.vapi.ai/sdk/web#message)
- [Assistant hooks: handling interruptions](https://docs.vapi.ai/assistants/assistant-hooks)Vapi Support Bot
05/23/2025, 8:47 AMmessage
event in the Vapi Web SDK:
js
vapi.on("message", (message) => {
console.log("Assistant generated message:", message);
});
This lets you capture the assistant's output in real time, but it may not always provide the full message before it is spoken or interrupted.
[See documentation](https://docs.vapi.ai/sdk/web#message)
Sources:
- [Vapi Web SDK documentation](https://docs.vapi.ai/sdk/web#message)
- [Assistant hooks: handling interruptions](https://docs.vapi.ai/assistants/assistant-hooks)Vapi
05/24/2025, 2:12 AMhxrdxk
05/26/2025, 11:12 AMVapi Support Bot
05/26/2025, 11:14 AManalysisPlan
with a structuredDataPrompt
and a structuredDataSchema
. For example:
json
{
"analysisPlan": {
"structuredDataPrompt": "Extract the user's name and intent from the call.",
"structuredDataSchema": {
"type": "object",
"properties": {
"userName": { "type": "string" },
"intent": { "type": "string" }
},
"required": ["userName", "intent"]
}
}
}
This will add your specified fields to the structured output, accessible via call.analysis.structuredData
after the call analysis completes.
[See full docs](https://docs.vapi.ai/assistants/call-analysis#structured-data-schema)
Source:
- [Vapi Call Analysis Documentation](https://docs.vapi.ai/assistants/call-analysis#structured-data-schema)hxrdxk
05/26/2025, 11:20 AMVapi Support Bot
05/26/2025, 11:21 AMmessage
event in the Web SDK or by using the modal output server event. However, there is no documented way to enforce a real-time model output format with one fixed property for speech and another fully customizable property for developer use.
Could you clarify if your main goal is to access additional structured data alongside the speech output in real time during the call, or are you looking for this structure only in post-call analysis?
Sources:
- [Vapi Web SDK documentation](https://docs.vapi.ai/sdk/web#message)
- [Vapi Call Analysis Documentation](https://docs.vapi.ai/assistants/call-analysis#structured-data-schema)hxrdxk
05/26/2025, 11:23 AMVapi Support Bot
05/26/2025, 11:25 AMmessage
event, but customizing the structure as you described is not documented ([Vapi Web SDK documentation](https://docs.vapi.ai/sdk/web#message)).
Would you like suggestions for possible workarounds, or are you specifically looking for official support for this feature?
Sources:
- [Vapi Web SDK documentation](https://docs.vapi.ai/sdk/web#message)
- [Vapi Call Analysis Documentation](https://docs.vapi.ai/assistants/call-analysis#structured-data-schema)Vapi
05/28/2025, 11:08 AM