Sooz
03/10/2025, 5:44 PMend-of-call-report
webhook event is not matching the json schema given as per the structured data schema in analysis plan
export interface AnalysisPlan {
/** This is the plan for generating the summary of the call. This outputs to `call.analysis.summary`. */
summaryPlan?: Vapi.SummaryPlan;
/** This is the plan for generating the structured data from the call. This outputs to `call.analysis.structuredData`. */
structuredDataPlan?: Vapi.StructuredDataPlan;
/** This is the plan for generating the success evaluation of the call. This outputs to `call.analysis.successEvaluation`. */
successEvaluationPlan?: Vapi.SuccessEvaluationPlan;
}
I'm following the types for CreateAssistantDto
closely but the returned format for structured data differs wildly from the requested format.
Example call id where the llm is not abiding by the schema: 630428b7-6065-4611-8e8b-435b0da19ca5
LBThree
03/10/2025, 7:02 PMSooz
03/10/2025, 10:25 PMstructuredData
objects I receive are all over the place. There's no way to accommodate all the possible random shapesRaju
03/10/2025, 10:58 PMSooz
03/11/2025, 12:02 AMLBThree
03/11/2025, 1:50 PMtotalCost
, duration
, etc. The rest should be available through API if you absolutely need it, although it would be asynchronous of course. I just keep an eye on the changelog https://docs.vapi.ai/changelog periodically but I shouldnt have to! VAPI is growing quite quickly so I believe they will stabilize soon and hopefully remember that this is voice ai for developers - and developers develop through documentationShubham Bajaj
03/12/2025, 3:21 PMShubham Bajaj
03/12/2025, 4:51 PMSooz
03/12/2025, 7:26 PMShubham Bajaj
03/16/2025, 5:52 AMts
const assistant: CreateAssistantDTO = {
name: "Your Assistant Name",
model: {
// Your model configuration
},
voice: {
// Your voice configuration
},
firstMessage: "Hello! How can I help you today?",
// Other assistant properties...
analysisPlan: {
structuredDataPlan: {
enabled: true,
schema: {
type: "object",
required: [
"callerName",
"callerEmail",
"reasonForCall",
"additionalNotes"
],
properties: {
callerName: {
type: "string",
default: "",
description: "Name of the caller. Empty string if not provided."
},
callerEmail: {
type: "string",
default: "",
description: "Caller's email address. Empty string if not provided."
},
reasonForCall: {
type: "string",
default: "Not provided",
description: "A brief description of why the caller contacted us."
},
additionalNotes: {
type: "array",
items: {type: "string"},
default: [],
description: "Any additional relevant details. Provide each note as a separate string."
}
}
},
// NOTE: You can customize the timeout for the structured data generation
timeoutSeconds: 30
// NOTE: Other available options:
//
// messages: [...] - Custom messages to send to the LLM (default shown below)
// useAssistantLlm: boolean - Whether to use the assistant's LLM instead of default Anthropic model
// customLlmUrl: string - URL to a custom LLM endpoint for structured data generation
}
}
};
Note about default messages:
When messages is not explicitly provided, Vapi will use the following default messages:
ts
[
{
role: "system",
content: "You are an expert data extractor. You will be given a transcript of a call. Extract structured data per the JSON Schema. DO NOT return anything except the structured data.\n\nJson Schema:\n{{schema}}\n\nOnly respond with the JSON."
},
{
role: "user",
content: "Here is the transcript:\n\n{{transcript}}\n\n"
}
]