vapi_client/models/
open_ai_function_parameters.rs

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