Skip to main content

windmill_api/models/
question_tool_value.rs

1/*
2 * Windmill API
3 *
4 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5 *
6 * The version of the OpenAPI document: 1.864.0
7 * Contact: contact@windmill.dev
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// QuestionToolValue : Built-in tool the AI calls as ask_question: the agent stops, releasing its worker, until someone answers from the flow's run page or chat or the question times out, then resumes with the answer as the tool result.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct QuestionToolValue {
17    #[serde(rename = "tool_type")]
18    pub tool_type: ToolType,
19    /// Seconds to wait for an answer before the question is reported to the AI as timed out. Defaults to 1800.
20    #[serde(rename = "timeout", skip_serializing_if = "Option::is_none")]
21    pub timeout: Option<i32>,
22}
23
24impl QuestionToolValue {
25    /// Built-in tool the AI calls as ask_question: the agent stops, releasing its worker, until someone answers from the flow's run page or chat or the question times out, then resumes with the answer as the tool result.
26    pub fn new(tool_type: ToolType) -> QuestionToolValue {
27        QuestionToolValue {
28            tool_type,
29            timeout: None,
30        }
31    }
32}
33/// 
34#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
35pub enum ToolType {
36    #[serde(rename = "question")]
37    Question,
38}
39
40impl Default for ToolType {
41    fn default() -> ToolType {
42        Self::Question
43    }
44}
45