vapi_client/models/
open_ai_function_parameters.rs1use serde::{Deserialize, Serialize};
12use utoipa::ToSchema;
13
14
15use crate::models;
16
17#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize, ToSchema)]
18pub struct OpenAiFunctionParameters {
19 #[serde(rename = "type")]
21 pub r#type: Type,
22 #[serde(rename = "properties")]
24 pub properties: std::collections::HashMap<String, models::JsonSchema>,
25 #[serde(rename = "required", skip_serializing_if = "Option::is_none")]
27 pub required: Option<Vec<String>>,
28}
29
30impl OpenAiFunctionParameters {
31 pub fn new(
32 r#type: Type,
33 properties: std::collections::HashMap<String, models::JsonSchema>,
34 ) -> OpenAiFunctionParameters {
35 OpenAiFunctionParameters {
36 r#type,
37 properties,
38 required: None,
39 }
40 }
41}
42#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize, ToSchema)]
44pub enum Type {
45 #[serde(rename = "object")]
46 Object,
47}
48
49impl Default for Type {
50 fn default() -> Type {
51 Self::Object
52 }
53}