vapi_client/models/
tool_message_delayed.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 ToolMessageDelayed {
19    /// This is an alternative to the `content` property. It allows to specify variants of the same content, one per language.  Usage: - If your assistants are multilingual, you can provide content for each language. - If you don't provide content for a language, the first item in the array will be automatically translated to the active language at that moment.  This will override the `content` property.
20    #[serde(rename = "contents", skip_serializing_if = "Option::is_none")]
21    pub contents: Option<Vec<models::ToolMessageStartContentsInner>>,
22    /// This message is triggered when the tool call is delayed.  There are the two things that can trigger this message: 1. The user talks with the assistant while your server is processing the request. Default is \"Sorry, a few more seconds.\" 2. The server doesn't respond within `timingMilliseconds`.  This message is never triggered for async tool calls.
23    #[serde(rename = "type")]
24    pub r#type: Type,
25    /// The number of milliseconds to wait for the server response before saying this message.
26    #[serde(rename = "timingMilliseconds", skip_serializing_if = "Option::is_none")]
27    pub timing_milliseconds: Option<f64>,
28    /// This is the content that the assistant says when this message is triggered.
29    #[serde(rename = "content", skip_serializing_if = "Option::is_none")]
30    pub content: Option<String>,
31    /// This is an optional array of conditions that the tool call arguments must meet in order for this message to be triggered.
32    #[serde(rename = "conditions", skip_serializing_if = "Option::is_none")]
33    pub conditions: Option<Vec<models::Condition>>,
34}
35
36impl ToolMessageDelayed {
37    pub fn new(r#type: Type) -> ToolMessageDelayed {
38        ToolMessageDelayed {
39            contents: None,
40            r#type,
41            timing_milliseconds: None,
42            content: None,
43            conditions: None,
44        }
45    }
46}
47/// This message is triggered when the tool call is delayed.  There are the two things that can trigger this message: 1. The user talks with the assistant while your server is processing the request. Default is \"Sorry, a few more seconds.\" 2. The server doesn't respond within `timingMilliseconds`.  This message is never triggered for async tool calls.
48#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize, ToSchema)]
49pub enum Type {
50    #[serde(rename = "request-response-delayed")]
51    RequestResponseDelayed,
52}
53
54impl Default for Type {
55    fn default() -> Type {
56        Self::RequestResponseDelayed
57    }
58}