vapi_client/models/
update_api_request_tool_dto.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 UpdateApiRequestToolDto {
16    /// These are the messages that will be spoken to the user as the tool is running.  For some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.
17    #[serde(rename = "messages", skip_serializing_if = "Option::is_none")]
18    pub messages: Option<Vec<models::CreateDtmfToolDtoMessagesInner>>,
19    #[serde(rename = "method", skip_serializing_if = "Option::is_none")]
20    pub method: Option<MethodTrue>,
21    /// This is the timeout in seconds for the request. Defaults to 20 seconds.  @default 20
22    #[serde(rename = "timeoutSeconds", skip_serializing_if = "Option::is_none")]
23    pub timeout_seconds: Option<f64>,
24    /// This is the function definition of the tool.  For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases.  An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument \"reason\". Then, in `messages` array, you can have many \"request-complete\" messages. One of these messages will be triggered if the `messages[].conditions` matches the \"reason\" argument.
25    #[serde(rename = "function", skip_serializing_if = "Option::is_none")]
26    pub function: Option<models::OpenAiFunction>,
27    /// This is the name of the tool. This will be passed to the model.  Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 40.
28    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
29    pub name: Option<String>,
30    /// This is the description of the tool. This will be passed to the model.
31    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
32    pub description: Option<String>,
33    /// This is where the request will be sent.
34    #[serde(rename = "url", skip_serializing_if = "Option::is_none")]
35    pub url: Option<String>,
36    /// This is the body of the request.
37    #[serde(rename = "body", skip_serializing_if = "Option::is_none")]
38    pub body: Option<models::JsonSchema>,
39    /// These are the headers to send in the request.
40    #[serde(rename = "headers", skip_serializing_if = "Option::is_none")]
41    pub headers: Option<models::JsonSchema>,
42    /// This is the backoff plan if the request fails. Defaults to undefined (the request will not be retried).  @default undefined (the request will not be retried)
43    #[serde(rename = "backoffPlan", skip_serializing_if = "Option::is_none")]
44    pub backoff_plan: Option<models::BackoffPlan>,
45    /// This is the plan that controls the variable extraction from the tool's response.
46    #[serde(
47        rename = "variableExtractionPlan",
48        skip_serializing_if = "Option::is_none"
49    )]
50    pub variable_extraction_plan: Option<models::VariableExtractionPlan>,
51}
52
53impl UpdateApiRequestToolDto {
54    pub fn new() -> UpdateApiRequestToolDto {
55        UpdateApiRequestToolDto {
56            messages: None,
57            method: None,
58            timeout_seconds: None,
59            function: None,
60            name: None,
61            description: None,
62            url: None,
63            body: None,
64            headers: None,
65            backoff_plan: None,
66            variable_extraction_plan: None,
67        }
68    }
69}
70///
71#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
72pub enum MethodTrue {
73    #[serde(rename = "POST")]
74    Post,
75    #[serde(rename = "GET")]
76    Get,
77}
78
79impl Default for MethodTrue {
80    fn default() -> MethodTrue {
81        Self::Post
82    }
83}