vapi_client/models/structured_data_plan.rs
1/*
2 * Vapi API
3 *
4 * API for building voice assistants
5 *
6 * The version of the OpenAPI document: 1.0
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11use serde::{Deserialize, Serialize};
12use utoipa::ToSchema;
13
14
15use crate::models;
16
17#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize, ToSchema)]
18pub struct StructuredDataPlan {
19 /// These are the messages used to generate the structured data. @default: ``` [ { \"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\" } ]``` You can customize by providing any messages you want. Here are the template variables available: - {{transcript}}: the transcript of the call from `call.artifact.transcript`- {{systemPrompt}}: the system prompt of the call from `assistant.model.messages[type=system].content`- {{schema}}: the schema of the structured data from `structuredDataPlan.schema`
20 #[serde(rename = "messages", skip_serializing_if = "Option::is_none")]
21 pub messages: Option<Vec<serde_json::Value>>,
22 /// This determines whether structured data is generated and stored in `call.analysis.structuredData`. Defaults to false. Usage: - If you want to extract structured data, set this to true and provide a `schema`. @default false
23 #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")]
24 pub enabled: Option<bool>,
25 /// This is the schema of the structured data. The output is stored in `call.analysis.structuredData`. Complete guide on JSON Schema can be found [here](https://ajv.js.org/json-schema.html#json-data-type).
26 #[serde(rename = "schema", skip_serializing_if = "Option::is_none")]
27 pub schema: Option<models::JsonSchema>,
28 /// This is how long the request is tried before giving up. When request times out, `call.analysis.structuredData` will be empty. Usage: - To guarantee the structured data is generated, set this value high. Note, this will delay the end of call report in cases where model is slow to respond. @default 5 seconds
29 #[serde(rename = "timeoutSeconds", skip_serializing_if = "Option::is_none")]
30 pub timeout_seconds: Option<f64>,
31}
32
33impl StructuredDataPlan {
34 pub fn new() -> StructuredDataPlan {
35 StructuredDataPlan {
36 messages: None,
37 enabled: None,
38 schema: None,
39 timeout_seconds: None,
40 }
41 }
42}