Skip to main content

windmill_api/models/
ai_agent.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.723.0
7 * Contact: contact@windmill.dev
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// AiAgent : AI agent step that can use tools to accomplish tasks. The agent receives inputs and can call any of its configured tools to complete the task
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct AiAgent {
17    #[serde(rename = "input_transforms")]
18    pub input_transforms: Box<models::AiAgentInputTransforms>,
19    /// Array of tools the agent can use. The agent decides which tools to call based on the task
20    #[serde(rename = "tools")]
21    pub tools: Vec<models::AgentTool>,
22    #[serde(rename = "type")]
23    pub r#type: Type,
24    /// Worker group tag for execution routing. If not set, the AI agent step runs on the flow's tag (default `flow`)
25    #[serde(rename = "tag", skip_serializing_if = "Option::is_none")]
26    pub tag: Option<String>,
27    /// If true, this AI agent step does not persist its assistant or tool messages to the flow conversation when chat mode is enabled.
28    #[serde(rename = "omit_output_from_conversation", skip_serializing_if = "Option::is_none")]
29    pub omit_output_from_conversation: Option<bool>,
30    /// If true, the agent can execute multiple tool calls in parallel
31    #[serde(rename = "parallel", skip_serializing_if = "Option::is_none")]
32    pub parallel: Option<bool>,
33}
34
35impl AiAgent {
36    /// AI agent step that can use tools to accomplish tasks. The agent receives inputs and can call any of its configured tools to complete the task
37    pub fn new(input_transforms: models::AiAgentInputTransforms, tools: Vec<models::AgentTool>, r#type: Type) -> AiAgent {
38        AiAgent {
39            input_transforms: Box::new(input_transforms),
40            tools,
41            r#type,
42            tag: None,
43            omit_output_from_conversation: None,
44            parallel: None,
45        }
46    }
47}
48/// 
49#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
50pub enum Type {
51    #[serde(rename = "aiagent")]
52    Aiagent,
53}
54
55impl Default for Type {
56    fn default() -> Type {
57        Self::Aiagent
58    }
59}
60