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