vapi_client/models/
open_ai_function_parameters.rs

1/*
2 * Vapi API
3 *
4 * Voice AI for developers.
5 *
6 * The version of the OpenAPI document: 1.0
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct OpenAiFunctionParameters {
16    /// This must be set to 'object'. It instructs the model to return a JSON object containing the function call properties.
17    #[serde(rename = "type")]
18    pub r#type: Type,
19    /// This provides a description of the properties required by the function. JSON Schema can be used to specify expectations for each property. Refer to [this doc](https://ajv.js.org/json-schema.html#json-data-type) for a comprehensive guide on JSON Schema.
20    #[serde(rename = "properties")]
21    pub properties: std::collections::HashMap<String, models::JsonSchema>,
22    /// This specifies the properties that are required by the function.
23    #[serde(rename = "required", skip_serializing_if = "Option::is_none")]
24    pub required: Option<Vec<String>>,
25}
26
27impl OpenAiFunctionParameters {
28    pub fn new(r#type: Type, properties: std::collections::HashMap<String, models::JsonSchema>) -> OpenAiFunctionParameters {
29        OpenAiFunctionParameters {
30            r#type,
31            properties,
32            required: None,
33        }
34    }
35}
36/// This must be set to 'object'. It instructs the model to return a JSON object containing the function call properties.
37#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
38pub enum Type {
39    #[serde(rename = "object")]
40    Object,
41}
42
43impl Default for Type {
44    fn default() -> Type {
45        Self::Object
46    }
47}
48