mindcontrol_types 0.21.0

Mind Control types
Documentation
use super::dependency::DependencyV1;
use super::resource::ResourceV1;
use litty::literal;
use serde::{Deserialize, Serialize};

/// Collection payload.
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct PayloadV1 {
    /// Schema version.
    pub v: PayloadV1V1,
    /// Payload dependencies. They define various dependencies that affect
    /// the behavior and requirements of the collection, i.e. adding Azure
    /// provider that will require Azure credentials. Adding a dependency
    /// triggers the major version bump, while removing a dependency does not.
    pub dependencies: Vec<DependencyV1>,
    /// Payload resources.
    pub resources: Vec<ResourceV1>,
    /// Payload settings. They define various settings that dictate the collection
    /// behavior, i.e. which provider to use for a specific model or model author.
    pub settings: Option<PayloadSettings>,
}

#[literal(1)]
pub struct PayloadV1V1;

/// Payload settings.
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct PayloadSettings {
    /// Payload providers settings. Changing the provider settings does not
    /// trigger major version bump directly, but rather indirectly by affecting
    /// the payload dependencies. The payload dependencies should always include
    /// whatever providers are used in the payload settings.
    pub providers: Option<PayloadSettingsProviders>,
}

/// Payload settings providers.
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct PayloadSettingsProviders {
    /// OpenAI provider settings.
    pub openai: Option<super::openai::OpenAIProviderSettingsV1>,
    /// Anthropic provider settings.
    pub anthropic: Option<super::anthropic::AnthropicProviderSettingsV1>,
    /// Perplexity provider settings.
    pub perplexity: Option<super::perplexity::PerplexityProviderSettings>,
}