vapi_client/models/tool_message_start.rs
1/*
2 * Vapi API
3 *
4 * Voice AI for developers.
5 *
6 * The version of the OpenAPI document: 1.0
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct ToolMessageStart {
16 /// 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.
17 #[serde(rename = "contents", skip_serializing_if = "Option::is_none")]
18 pub contents: Option<Vec<models::ToolMessageStartContentsInner>>,
19 /// This message is triggered when the tool call starts. This message is never triggered for async tools. If this message is not provided, one of the default filler messages \"Hold on a sec\", \"One moment\", \"Just a sec\", \"Give me a moment\" or \"This'll just take a sec\" will be used.
20 #[serde(rename = "type")]
21 pub r#type: TypeTrue,
22 /// This is an optional boolean that if true, the tool call will only trigger after the message is spoken. Default is false. @default false
23 #[serde(rename = "blocking", skip_serializing_if = "Option::is_none")]
24 pub blocking: Option<bool>,
25 /// This is the content that the assistant says when this message is triggered.
26 #[serde(rename = "content", skip_serializing_if = "Option::is_none")]
27 pub content: Option<String>,
28 /// This is an optional array of conditions that the tool call arguments must meet in order for this message to be triggered.
29 #[serde(rename = "conditions", skip_serializing_if = "Option::is_none")]
30 pub conditions: Option<Vec<models::Condition>>,
31}
32
33impl ToolMessageStart {
34 pub fn new(r#type: TypeTrue) -> ToolMessageStart {
35 ToolMessageStart {
36 contents: None,
37 r#type,
38 blocking: None,
39 content: None,
40 conditions: None,
41 }
42 }
43}
44/// This message is triggered when the tool call starts. This message is never triggered for async tools. If this message is not provided, one of the default filler messages \"Hold on a sec\", \"One moment\", \"Just a sec\", \"Give me a moment\" or \"This'll just take a sec\" will be used.
45#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
46pub enum TypeTrue {
47 #[serde(rename = "request-start")]
48 RequestStart,
49}
50
51impl Default for TypeTrue {
52 fn default() -> TypeTrue {
53 Self::RequestStart
54 }
55}