Skip to main content

windmill_api/models/
ai_config.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.816.0
7 * Contact: contact@windmill.dev
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct AiConfig {
16    #[serde(rename = "providers", skip_serializing_if = "Option::is_none")]
17    pub providers: Option<std::collections::HashMap<String, models::AiProviderConfig>>,
18    #[serde(rename = "default_model", skip_serializing_if = "Option::is_none")]
19    pub default_model: Option<Box<models::AiProviderModel>>,
20    #[serde(rename = "metadata_model", skip_serializing_if = "Option::is_none")]
21    pub metadata_model: Option<Box<models::AiProviderModel>>,
22    #[serde(rename = "code_completion_model", skip_serializing_if = "Option::is_none")]
23    pub code_completion_model: Option<Box<models::AiProviderModel>>,
24    #[serde(rename = "custom_prompts", skip_serializing_if = "Option::is_none")]
25    pub custom_prompts: Option<std::collections::HashMap<String, String>>,
26    #[serde(rename = "max_tokens_per_model", skip_serializing_if = "Option::is_none")]
27    pub max_tokens_per_model: Option<std::collections::HashMap<String, i32>>,
28    #[serde(rename = "free_tier", skip_serializing_if = "Option::is_none")]
29    pub free_tier: Option<Box<models::FreeTierInfo>>,
30    #[serde(rename = "model_pricing", skip_serializing_if = "Option::is_none")]
31    pub model_pricing: Option<std::collections::HashMap<String, models::ModelPriceOverride>>,
32    /// Context window in tokens per `provider:model`, overriding the built-in table the AI chat uses to decide when to compact its history.
33    #[serde(rename = "context_window_per_model", skip_serializing_if = "Option::is_none")]
34    pub context_window_per_model: Option<std::collections::HashMap<String, i32>>,
35    /// Hides the Windmill AI assistant (chat, sessions, code generation, completion, fixes) from the workspace UI. Read from the workspace's own settings even when the providers served fall back to the instance config. AI agent steps and the AI sandbox in flows are unaffected.
36    #[serde(rename = "copilot_disabled", skip_serializing_if = "Option::is_none")]
37    pub copilot_disabled: Option<bool>,
38    /// Stops browsers from backing their AI sessions up to the workspace's object storage. Read from the workspace's own settings like `copilot_disabled`.
39    #[serde(rename = "sessions_storage_disabled", skip_serializing_if = "Option::is_none")]
40    pub sessions_storage_disabled: Option<bool>,
41    /// The server deletes the backup of a session no push has reached for this many days. Unset keeps backups until the user deletes the session. Read from the workspace's own settings like `copilot_disabled`.
42    #[serde(rename = "sessions_retention_days", skip_serializing_if = "Option::is_none")]
43    pub sessions_retention_days: Option<i32>,
44}
45
46impl AiConfig {
47    pub fn new() -> AiConfig {
48        AiConfig {
49            providers: None,
50            default_model: None,
51            metadata_model: None,
52            code_completion_model: None,
53            custom_prompts: None,
54            max_tokens_per_model: None,
55            free_tier: None,
56            model_pricing: None,
57            context_window_per_model: None,
58            copilot_disabled: None,
59            sessions_storage_disabled: None,
60            sessions_retention_days: None,
61        }
62    }
63}
64