Skip to main content

windmill_api/models/
provider_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.626.0
7 * Contact: contact@windmill.dev
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// ProviderConfig : Complete AI provider configuration with resource reference and model selection
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct ProviderConfig {
17    #[serde(rename = "kind")]
18    pub kind: models::AiProviderKind,
19    /// Resource reference in format '$res:{resource_path}' pointing to provider credentials
20    #[serde(rename = "resource")]
21    pub resource: String,
22    /// Model identifier (e.g., 'gpt-4', 'claude-3-opus-20240229', 'gemini-pro')
23    #[serde(rename = "model")]
24    pub model: String,
25}
26
27impl ProviderConfig {
28    /// Complete AI provider configuration with resource reference and model selection
29    pub fn new(kind: models::AiProviderKind, resource: String, model: String) -> ProviderConfig {
30        ProviderConfig {
31            kind,
32            resource,
33            model,
34        }
35    }
36}
37