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.775.1
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", skip_serializing_if = "Option::is_none")]
21    pub tools: Option<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    /// Path of a reusable `ai_agent` resource (hybrid linking). When set, the agent brain config (provider/model/system prompt/etc.) and tool set are resolved at runtime from that resource; the module's input_transforms then only carry the flow-local inputs (user_message/user_attachments). 
31    #[serde(rename = "agent", skip_serializing_if = "Option::is_none")]
32    pub agent: Option<String>,
33    /// Host-local wiring for an agent's tool inputs, keyed by tool id then input key. Binds the referenced agent's tools to this flow's context (flow_input/results) without mutating the shared resource; overlaid onto the tools' input_transforms at runtime — including when `agent` is unset, since a step forked for editing keeps these overrides until it is saved back or unlinked. 
34    #[serde(rename = "tool_inputs", skip_serializing_if = "Option::is_none")]
35    pub tool_inputs: Option<std::collections::HashMap<String, std::collections::HashMap<String, models::InputTransform>>>,
36    /// If true, the agent can execute multiple tool calls in parallel
37    #[serde(rename = "parallel", skip_serializing_if = "Option::is_none")]
38    pub parallel: Option<bool>,
39}
40
41impl AiAgent {
42    /// 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
43    pub fn new(input_transforms: models::AiAgentInputTransforms, r#type: Type) -> AiAgent {
44        AiAgent {
45            input_transforms: Box::new(input_transforms),
46            tools: None,
47            r#type,
48            tag: None,
49            omit_output_from_conversation: None,
50            agent: None,
51            tool_inputs: None,
52            parallel: None,
53        }
54    }
55}
56/// 
57#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
58pub enum Type {
59    #[serde(rename = "aiagent")]
60    Aiagent,
61}
62
63impl Default for Type {
64    fn default() -> Type {
65        Self::Aiagent
66    }
67}
68