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