vapi_client/models/
tool_call_result_message.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};
12
13use crate::models;
14
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct ToolCallResultMessage {
17    /// The role of the tool call result in the conversation.
18    #[serde(rename = "role")]
19    pub role: String,
20    /// The ID of the tool call.
21    #[serde(rename = "toolCallId")]
22    pub tool_call_id: String,
23    /// The name of the tool that returned the result.
24    #[serde(rename = "name")]
25    pub name: String,
26    /// The result of the tool call in JSON format.
27    #[serde(rename = "result")]
28    pub result: String,
29    /// The timestamp when the message was sent.
30    #[serde(rename = "time")]
31    pub time: f64,
32    /// The number of seconds from the start of the conversation.
33    #[serde(rename = "secondsFromStart")]
34    pub seconds_from_start: f64,
35}
36
37impl ToolCallResultMessage {
38    pub fn new(
39        role: String,
40        tool_call_id: String,
41        name: String,
42        result: String,
43        time: f64,
44        seconds_from_start: f64,
45    ) -> ToolCallResultMessage {
46        ToolCallResultMessage {
47            role,
48            tool_call_id,
49            name,
50            result,
51            time,
52            seconds_from_start,
53        }
54    }
55}