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