vapi_client/models/tool_call_result_message.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/// ToolCallResultMessage : This is the message that will be spoken to the user. If this is not returned, assistant will speak: 1. a `request-complete` or `request-failed` message from `tool.messages`, if it exists 2. a response generated by the model, if not
15/// This is the message that will be spoken to the user. If this is not returned, assistant will speak: 1. a `request-complete` or `request-failed` message from `tool.messages`, if it exists 2. a response generated by the model, if not
16#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
17#[serde(untagged)]
18pub enum ToolCallResultMessage {
19 ToolMessageComplete(models::ToolMessageComplete),
20 ToolMessageFailed(models::ToolMessageFailed),
21}
22
23impl Default for ToolCallResultMessage {
24 fn default() -> Self {
25 Self::ToolMessageComplete(Default::default())
26 }
27}
28/// 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.
29#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
30pub enum TypeTrue {
31 #[serde(rename = "request-complete")]
32 RequestComplete,
33 #[serde(rename = "request-failed")]
34 RequestFailed,
35}
36
37impl Default for TypeTrue {
38 fn default() -> TypeTrue {
39 Self::RequestComplete
40 }
41}
42/// 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.
43#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
44pub enum RoleTrue {
45 #[serde(rename = "assistant")]
46 Assistant,
47 #[serde(rename = "system")]
48 System,
49}
50
51impl Default for RoleTrue {
52 fn default() -> RoleTrue {
53 Self::Assistant
54 }
55}