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};
12use utoipa::ToSchema;
13
14
15use crate::models;
16
17#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize, ToSchema)]
18pub struct OpenAiFunctionParameters {
19    /// This must be set to 'object'. It instructs the model to return a JSON object containing the function call properties.
20    #[serde(rename = "type")]
21    pub r#type: Type,
22    /// 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.
23    #[serde(rename = "properties")]
24    pub properties: std::collections::HashMap<String, models::JsonSchema>,
25    /// This specifies the properties that are required by the function.
26    #[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/// This must be set to 'object'. It instructs the model to return a JSON object containing the function call properties.
43#[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}