vapi_client/models/
chat_completion_message_metadata.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::OpenApi;
13
14
15use crate::models;
16
17#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize, OpenApi)]
18pub struct ChatCompletionMessageMetadata {
19    #[serde(rename = "taskName")]
20    pub task_name: String,
21    #[serde(rename = "taskType")]
22    pub task_type: String,
23    #[serde(rename = "taskOutput")]
24    pub task_output: String,
25    #[serde(rename = "taskState", skip_serializing_if = "Option::is_none")]
26    pub task_state: Option<serde_json::Value>,
27    #[serde(rename = "nodeTrace", skip_serializing_if = "Option::is_none")]
28    pub node_trace: Option<Vec<String>>,
29}
30
31impl ChatCompletionMessageMetadata {
32    pub fn new(
33        task_name: String,
34        task_type: String,
35        task_output: String,
36    ) -> ChatCompletionMessageMetadata {
37        ChatCompletionMessageMetadata {
38            task_name,
39            task_type,
40            task_output,
41            task_state: None,
42            node_trace: None,
43        }
44    }
45}