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
51
52
53
54
55
56
57
/*
* 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 ToolNode {
/// This is the Tool node. This can be used to call a tool in your workflow. The flow is: - Workflow starts the tool node - Model is called to extract parameters needed by the tool from the conversation history - Tool is called with the parameters - Server returns a response - Workflow continues with the response
#[serde(rename = "type")]
pub r#type: TypeTrue,
#[serde(rename = "tool", skip_serializing_if = "Option::is_none")]
pub tool: Option<models::ToolNodeTool>,
/// This is the tool to call. To use a transient tool, send `tool` instead.
#[serde(rename = "toolId", skip_serializing_if = "Option::is_none")]
pub tool_id: Option<String>,
#[serde(rename = "name")]
pub name: String,
/// This is whether or not the node is the start of the workflow.
#[serde(rename = "isStart", skip_serializing_if = "Option::is_none")]
pub is_start: Option<bool>,
/// This is for metadata you want to store on the task.
#[serde(rename = "metadata", skip_serializing_if = "Option::is_none")]
pub metadata: Option<serde_json::Value>,
}
impl ToolNode {
pub fn new(r#type: TypeTrue, name: String) -> ToolNode {
ToolNode {
r#type,
tool: None,
tool_id: None,
name,
is_start: None,
metadata: None,
}
}
}
/// This is the Tool node. This can be used to call a tool in your workflow. The flow is: - Workflow starts the tool node - Model is called to extract parameters needed by the tool from the conversation history - Tool is called with the parameters - Server returns a response - Workflow continues with the response
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum TypeTrue {
#[serde(rename = "tool")]
Tool,
}
impl Default for TypeTrue {
fn default() -> TypeTrue {
Self::Tool
}
}