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: TypeTrue,
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(
29        r#type: TypeTrue,
30        properties: std::collections::HashMap<String, models::JsonSchema>,
31    ) -> OpenAiFunctionParameters {
32        OpenAiFunctionParameters {
33            r#type,
34            properties,
35            required: None,
36        }
37    }
38}
39/// This must be set to 'object'. It instructs the model to return a JSON object containing the function call properties.
40#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
41pub enum TypeTrue {
42    #[serde(rename = "object")]
43    Object,
44}
45
46impl Default for TypeTrue {
47    fn default() -> TypeTrue {
48        Self::Object
49    }
50}