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