/*
* Windmill API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 1.824.1
* Contact: contact@windmill.dev
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// AiDecision : AI decision step: one call to a decision model (TypeSafe's Jev, or Cloudflare's Jev-compatible Clef) that answers typed questions about a state with calibrated probabilities, instead of generating text. Prefer it over an AI agent to classify, route, score or check something: it is fast, cheap and its answers are structured. Its result is { output: { <question name>: answer }, model, usage }, so a later step reads e.g. results.<id>.output.intent.choice. To route on the answers, follow it with a branchone whose branch exprs read results.<id>.output.<question>.choice. Usable as an AI agent tool, where the calling agent supplies the state.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct AiDecision {
#[serde(rename = "input_transforms")]
pub input_transforms: Box<models::AiDecisionInputTransforms>,
#[serde(rename = "type")]
pub r#type: Type,
/// Worker group tag for execution routing. If not set, the step runs on the flow's tag (default `flow`)
#[serde(rename = "tag", skip_serializing_if = "Option::is_none")]
pub tag: Option<String>,
}
impl AiDecision {
/// AI decision step: one call to a decision model (TypeSafe's Jev, or Cloudflare's Jev-compatible Clef) that answers typed questions about a state with calibrated probabilities, instead of generating text. Prefer it over an AI agent to classify, route, score or check something: it is fast, cheap and its answers are structured. Its result is { output: { <question name>: answer }, model, usage }, so a later step reads e.g. results.<id>.output.intent.choice. To route on the answers, follow it with a branchone whose branch exprs read results.<id>.output.<question>.choice. Usable as an AI agent tool, where the calling agent supplies the state.
pub fn new(input_transforms: models::AiDecisionInputTransforms, r#type: Type) -> AiDecision {
AiDecision {
input_transforms: Box::new(input_transforms),
r#type,
tag: None,
}
}
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Type {
#[serde(rename = "aidecision")]
Aidecision,
}
impl Default for Type {
fn default() -> Type {
Self::Aidecision
}
}