vapi_client/models/
tool_call.rs1use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct ToolCall {
16 #[serde(rename = "type")]
18 pub r#type: Type,
19 #[serde(rename = "function")]
21 pub function: Box<models::ToolCallFunction>,
22 #[serde(rename = "id")]
24 pub id: String,
25}
26
27impl ToolCall {
28 pub fn new(r#type: Type, function: models::ToolCallFunction, id: String) -> ToolCall {
29 ToolCall {
30 r#type,
31 function: Box::new(function),
32 id,
33 }
34 }
35}
36#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
38pub enum Type {
39 #[serde(rename = "function")]
40 Function,
41}
42
43impl Default for Type {
44 fn default() -> Type {
45 Self::Function
46 }
47}
48