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