vapi_client/models/tool_message_complete.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 ToolMessageComplete {
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 is complete. This message is triggered immediately without waiting for your server to respond for async tool calls. If this message is not provided, the model will be requested to respond. If this message is provided, only this message will be spoken and the model will not be requested to come up with a response. It's an exclusive OR.
20 #[serde(rename = "type")]
21 pub r#type: TypeTrue,
22 /// This is optional and defaults to \"assistant\". When role=assistant, `content` is said out loud. When role=system, `content` is passed to the model in a system message. Example: system: default one assistant: user: assistant: user: assistant: user: assistant: tool called tool: your server response <--- system prompt as hint ---> model generates response which is spoken This is useful when you want to provide a hint to the model about what to say next.
23 #[serde(rename = "role", skip_serializing_if = "Option::is_none")]
24 pub role: Option<RoleTrue>,
25 /// This is an optional boolean that if true, the call will end after the message is spoken. Default is false. This is ignored if `role` is set to `system`. @default false
26 #[serde(
27 rename = "endCallAfterSpokenEnabled",
28 skip_serializing_if = "Option::is_none"
29 )]
30 pub end_call_after_spoken_enabled: Option<bool>,
31 /// This is the content that the assistant says when this message is triggered.
32 #[serde(rename = "content", skip_serializing_if = "Option::is_none")]
33 pub content: Option<String>,
34 /// This is an optional array of conditions that the tool call arguments must meet in order for this message to be triggered.
35 #[serde(rename = "conditions", skip_serializing_if = "Option::is_none")]
36 pub conditions: Option<Vec<models::Condition>>,
37}
38
39impl ToolMessageComplete {
40 pub fn new(r#type: TypeTrue) -> ToolMessageComplete {
41 ToolMessageComplete {
42 contents: None,
43 r#type,
44 role: None,
45 end_call_after_spoken_enabled: None,
46 content: None,
47 conditions: None,
48 }
49 }
50}
51/// This message is triggered when the tool call is complete. This message is triggered immediately without waiting for your server to respond for async tool calls. If this message is not provided, the model will be requested to respond. If this message is provided, only this message will be spoken and the model will not be requested to come up with a response. It's an exclusive OR.
52#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
53pub enum TypeTrue {
54 #[serde(rename = "request-complete")]
55 RequestComplete,
56}
57
58impl Default for TypeTrue {
59 fn default() -> TypeTrue {
60 Self::RequestComplete
61 }
62}
63/// This is optional and defaults to \"assistant\". When role=assistant, `content` is said out loud. When role=system, `content` is passed to the model in a system message. Example: system: default one assistant: user: assistant: user: assistant: user: assistant: tool called tool: your server response <--- system prompt as hint ---> model generates response which is spoken This is useful when you want to provide a hint to the model about what to say next.
64#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
65pub enum RoleTrue {
66 #[serde(rename = "assistant")]
67 Assistant,
68 #[serde(rename = "system")]
69 System,
70}
71
72impl Default for RoleTrue {
73 fn default() -> RoleTrue {
74 Self::Assistant
75 }
76}