// This file is @generated by prost-build.
/// Request to start a new model training job
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StartTrainingRequest {
    /// Model type ("TLOB", "MAMBA_2", "DQN", "PPO", "LIQUID", "TFT")
    #[prost(string, tag = "1")]
    pub model_type: ::prost::alloc::string::String,
    /// Training data source configuration
    #[prost(message, optional, tag = "2")]
    pub data_source: ::core::option::Option<DataSource>,
    /// Model-specific training parameters
    #[prost(message, optional, tag = "3")]
    pub hyperparameters: ::core::option::Option<Hyperparameters>,
    /// Whether to use GPU acceleration
    #[prost(bool, tag = "4")]
    pub use_gpu: bool,
    /// Optional job description
    #[prost(string, tag = "5")]
    pub description: ::prost::alloc::string::String,
    /// Optional categorization tags
    #[prost(map = "string, string", tag = "6")]
    pub tags: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        ::prost::alloc::string::String,
    >,
    /// FULL (default) or FINE_TUNE
    #[prost(enumeration = "TrainingMode", tag = "7")]
    pub mode: i32,
    /// Path to checkpoint for fine-tune
    #[prost(string, tag = "8")]
    pub resume_checkpoint_path: ::prost::alloc::string::String,
    /// Override epoch count (0 = use default)
    #[prost(uint32, tag = "9")]
    pub max_epochs: u32,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct StartTrainingResponse {
    #[prost(string, tag = "1")]
    pub job_id: ::prost::alloc::string::String,
    #[prost(enumeration = "TrainingStatus", tag = "2")]
    pub status: i32,
    #[prost(string, tag = "3")]
    pub message: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SubscribeToTrainingStatusRequest {
    #[prost(string, tag = "1")]
    pub job_id: ::prost::alloc::string::String,
}
/// Real-time training progress update streamed from server
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TrainingStatusUpdate {
    /// Training job identifier
    #[prost(string, tag = "1")]
    pub job_id: ::prost::alloc::string::String,
    /// Current job status
    #[prost(enumeration = "TrainingStatus", tag = "2")]
    pub status: i32,
    /// Training progress (0.0 to 100.0)
    #[prost(float, tag = "3")]
    pub progress_percentage: f32,
    /// Current training epoch
    #[prost(uint32, tag = "4")]
    pub current_epoch: u32,
    /// Total epochs planned
    #[prost(uint32, tag = "5")]
    pub total_epochs: u32,
    /// Training metrics (loss, accuracy, sharpe_ratio, etc.)
    #[prost(map = "string, float", tag = "6")]
    pub metrics: ::std::collections::HashMap<::prost::alloc::string::String, f32>,
    /// Human-readable status message
    #[prost(string, tag = "7")]
    pub message: ::prost::alloc::string::String,
    /// Update timestamp (Unix seconds)
    #[prost(int64, tag = "8")]
    pub timestamp: i64,
    /// Financial performance metrics
    #[prost(message, optional, tag = "9")]
    pub financial_metrics: ::core::option::Option<FinancialMetrics>,
    /// Current resource utilization
    #[prost(message, optional, tag = "10")]
    pub resource_usage: ::core::option::Option<ResourceUsage>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct StopTrainingRequest {
    #[prost(string, tag = "1")]
    pub job_id: ::prost::alloc::string::String,
    /// Optional reason for stopping
    #[prost(string, tag = "2")]
    pub reason: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct StopTrainingResponse {
    #[prost(bool, tag = "1")]
    pub success: bool,
    #[prost(string, tag = "2")]
    pub message: ::prost::alloc::string::String,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ListAvailableModelsRequest {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListAvailableModelsResponse {
    #[prost(message, repeated, tag = "1")]
    pub models: ::prost::alloc::vec::Vec<ModelDefinition>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ListTrainingJobsRequest {
    #[prost(uint32, tag = "1")]
    pub page: u32,
    #[prost(uint32, tag = "2")]
    pub page_size: u32,
    #[prost(enumeration = "TrainingStatus", tag = "3")]
    pub status_filter: i32,
    #[prost(string, tag = "4")]
    pub model_type_filter: ::prost::alloc::string::String,
    /// Unix timestamp in seconds
    #[prost(int64, tag = "5")]
    pub start_time: i64,
    /// Unix timestamp in seconds
    #[prost(int64, tag = "6")]
    pub end_time: i64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListTrainingJobsResponse {
    #[prost(message, repeated, tag = "1")]
    pub jobs: ::prost::alloc::vec::Vec<TrainingJobSummary>,
    #[prost(uint32, tag = "2")]
    pub total_count: u32,
    #[prost(uint32, tag = "3")]
    pub page: u32,
    #[prost(uint32, tag = "4")]
    pub page_size: u32,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetTrainingJobDetailsRequest {
    #[prost(string, tag = "1")]
    pub job_id: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetTrainingJobDetailsResponse {
    #[prost(message, optional, tag = "1")]
    pub job_details: ::core::option::Option<TrainingJobDetails>,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct HealthCheckRequest {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct HealthCheckResponse {
    #[prost(bool, tag = "1")]
    pub healthy: bool,
    #[prost(string, tag = "2")]
    pub message: ::prost::alloc::string::String,
    #[prost(map = "string, string", tag = "3")]
    pub details: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        ::prost::alloc::string::String,
    >,
}
/// Request to start hyperparameter tuning job
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StartTuningJobRequest {
    /// Model type to tune ("TLOB", "MAMBA_2", "DQN", "PPO", "LIQUID", "TFT")
    #[prost(string, tag = "1")]
    pub model_type: ::prost::alloc::string::String,
    /// Number of tuning trials to run
    #[prost(uint32, tag = "2")]
    pub num_trials: u32,
    /// Path to tuning configuration file (search space, objectives)
    #[prost(string, tag = "3")]
    pub config_path: ::prost::alloc::string::String,
    /// Training data source for all trials
    #[prost(message, optional, tag = "4")]
    pub data_source: ::core::option::Option<DataSource>,
    /// Whether to use GPU acceleration
    #[prost(bool, tag = "5")]
    pub use_gpu: bool,
    /// Optional job description
    #[prost(string, tag = "6")]
    pub description: ::prost::alloc::string::String,
    /// Optional categorization tags
    #[prost(map = "string, string", tag = "7")]
    pub tags: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        ::prost::alloc::string::String,
    >,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct StartTuningJobResponse {
    /// Unique tuning job identifier
    #[prost(string, tag = "1")]
    pub job_id: ::prost::alloc::string::String,
    /// Initial job status
    #[prost(enumeration = "TuningJobStatus", tag = "2")]
    pub status: i32,
    /// Human-readable status message
    #[prost(string, tag = "3")]
    pub message: ::prost::alloc::string::String,
}
/// Request to query tuning job status
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetTuningJobStatusRequest {
    /// Tuning job identifier
    #[prost(string, tag = "1")]
    pub job_id: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetTuningJobStatusResponse {
    /// Tuning job identifier
    #[prost(string, tag = "1")]
    pub job_id: ::prost::alloc::string::String,
    /// Current job status
    #[prost(enumeration = "TuningJobStatus", tag = "2")]
    pub status: i32,
    /// Current trial number (0-indexed)
    #[prost(uint32, tag = "3")]
    pub current_trial: u32,
    /// Total number of trials
    #[prost(uint32, tag = "4")]
    pub total_trials: u32,
    /// Best hyperparameters found so far
    #[prost(map = "string, float", tag = "5")]
    pub best_params: ::std::collections::HashMap<::prost::alloc::string::String, f32>,
    /// Metrics for best parameters (sharpe_ratio, training_loss, etc.)
    #[prost(map = "string, float", tag = "6")]
    pub best_metrics: ::std::collections::HashMap<::prost::alloc::string::String, f32>,
    /// Complete trial history
    #[prost(message, repeated, tag = "7")]
    pub trial_history: ::prost::alloc::vec::Vec<TrialResult>,
    /// Human-readable status message
    #[prost(string, tag = "8")]
    pub message: ::prost::alloc::string::String,
    /// Job start time (Unix timestamp in seconds)
    #[prost(int64, tag = "9")]
    pub started_at: i64,
    /// Last update time (Unix timestamp in seconds)
    #[prost(int64, tag = "10")]
    pub updated_at: i64,
}
/// Request to stop a tuning job
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct StopTuningJobRequest {
    /// Tuning job identifier
    #[prost(string, tag = "1")]
    pub job_id: ::prost::alloc::string::String,
    /// Optional reason for stopping
    #[prost(string, tag = "2")]
    pub reason: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct StopTuningJobResponse {
    /// Whether stop was successful
    #[prost(bool, tag = "1")]
    pub success: bool,
    /// Human-readable status message
    #[prost(string, tag = "2")]
    pub message: ::prost::alloc::string::String,
    /// Final job status after stopping
    #[prost(enumeration = "TuningJobStatus", tag = "3")]
    pub final_status: i32,
}
/// INTERNAL: Request to train a model with specific hyperparameters (called by Optuna)
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TrainModelRequest {
    /// Model type ("TLOB", "MAMBA_2", "DQN", "PPO", "LIQUID", "TFT")
    #[prost(string, tag = "1")]
    pub model_type: ::prost::alloc::string::String,
    /// Hyperparameters to use for this trial
    #[prost(map = "string, float", tag = "2")]
    pub hyperparameters: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        f32,
    >,
    /// Training data source
    #[prost(message, optional, tag = "3")]
    pub data_source: ::core::option::Option<DataSource>,
    /// Whether to use GPU acceleration
    #[prost(bool, tag = "4")]
    pub use_gpu: bool,
    /// Optuna trial identifier for tracking
    #[prost(string, tag = "5")]
    pub trial_id: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TrainModelResponse {
    /// Whether training succeeded
    #[prost(bool, tag = "1")]
    pub success: bool,
    /// Primary optimization objective (Sharpe ratio)
    #[prost(float, tag = "2")]
    pub sharpe_ratio: f32,
    /// Final training loss
    #[prost(float, tag = "3")]
    pub training_loss: f32,
    /// Additional validation metrics
    #[prost(map = "string, float", tag = "4")]
    pub validation_metrics: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        f32,
    >,
    /// Error message if training failed
    #[prost(string, tag = "5")]
    pub error_message: ::prost::alloc::string::String,
    /// Total training time
    #[prost(int64, tag = "6")]
    pub training_duration_seconds: i64,
}
/// Individual trial result for tuning job history
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TrialResult {
    /// Trial index
    #[prost(uint32, tag = "1")]
    pub trial_number: u32,
    /// Hyperparameters tested
    #[prost(map = "string, float", tag = "2")]
    pub params: ::std::collections::HashMap<::prost::alloc::string::String, f32>,
    /// Objective metric (e.g., Sharpe ratio)
    #[prost(float, tag = "3")]
    pub objective_value: f32,
    /// Additional metrics
    #[prost(map = "string, float", tag = "4")]
    pub metrics: ::std::collections::HashMap<::prost::alloc::string::String, f32>,
    /// Trial outcome state
    #[prost(enumeration = "TrialState", tag = "5")]
    pub state: i32,
    /// Trial start time (Unix timestamp in seconds)
    #[prost(int64, tag = "6")]
    pub started_at: i64,
    /// Trial completion time (Unix timestamp in seconds)
    #[prost(int64, tag = "7")]
    pub completed_at: i64,
}
/// Request to stream tuning progress updates
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct StreamProgressRequest {
    /// Tuning job identifier to subscribe to
    #[prost(string, tag = "1")]
    pub job_id: ::prost::alloc::string::String,
}
/// Real-time progress update streamed after each trial completes
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProgressUpdate {
    /// Tuning job identifier
    #[prost(string, tag = "1")]
    pub job_id: ::prost::alloc::string::String,
    /// Current trial number (0-indexed)
    #[prost(uint32, tag = "2")]
    pub current_trial: u32,
    /// Total number of trials
    #[prost(uint32, tag = "3")]
    pub total_trials: u32,
    /// Current trial hyperparameters (as strings for display)
    #[prost(map = "string, string", tag = "4")]
    pub trial_params: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        ::prost::alloc::string::String,
    >,
    /// Current trial's Sharpe ratio (objective value)
    #[prost(float, tag = "5")]
    pub trial_sharpe: f32,
    /// Best Sharpe ratio achieved so far
    #[prost(float, tag = "6")]
    pub best_sharpe_so_far: f32,
    /// Estimated seconds until completion
    #[prost(uint32, tag = "7")]
    pub estimated_time_remaining: u32,
    /// Current job status
    #[prost(enumeration = "TuningJobStatus", tag = "8")]
    pub status: i32,
    /// Human-readable status message
    #[prost(string, tag = "9")]
    pub message: ::prost::alloc::string::String,
    /// Update timestamp (Unix seconds)
    #[prost(int64, tag = "10")]
    pub timestamp: i64,
    /// Type of update (trial completion, heartbeat, job complete)
    #[prost(enumeration = "UpdateType", tag = "11")]
    pub update_type: i32,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DataSource {
    /// Unix timestamp in seconds
    #[prost(int64, tag = "4")]
    pub start_time: i64,
    /// Unix timestamp in seconds
    #[prost(int64, tag = "5")]
    pub end_time: i64,
    #[prost(oneof = "data_source::Source", tags = "1, 2, 3")]
    pub source: ::core::option::Option<data_source::Source>,
}
/// Nested message and enum types in `DataSource`.
pub mod data_source {
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
    pub enum Source {
        #[prost(string, tag = "1")]
        HistoricalDbQuery(::prost::alloc::string::String),
        #[prost(string, tag = "2")]
        RealTimeStreamTopic(::prost::alloc::string::String),
        #[prost(string, tag = "3")]
        FilePath(::prost::alloc::string::String),
    }
}
/// Provides type-safe hyperparameter configuration.
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct Hyperparameters {
    #[prost(oneof = "hyperparameters::ModelParams", tags = "1, 2, 3, 4, 5, 6")]
    pub model_params: ::core::option::Option<hyperparameters::ModelParams>,
}
/// Nested message and enum types in `Hyperparameters`.
pub mod hyperparameters {
    #[derive(Clone, Copy, PartialEq, ::prost::Oneof)]
    pub enum ModelParams {
        #[prost(message, tag = "1")]
        TlobParams(super::TlobParams),
        #[prost(message, tag = "2")]
        MambaParams(super::MambaParams),
        #[prost(message, tag = "3")]
        DqnParams(super::DqnParams),
        #[prost(message, tag = "4")]
        PpoParams(super::PpoParams),
        #[prost(message, tag = "5")]
        LiquidParams(super::LiquidParams),
        #[prost(message, tag = "6")]
        TftParams(super::TftParams),
    }
}
/// TLOB (Time-Limit Order Book) Transformer parameters
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct TlobParams {
    #[prost(uint32, tag = "1")]
    pub epochs: u32,
    #[prost(float, tag = "2")]
    pub learning_rate: f32,
    #[prost(uint32, tag = "3")]
    pub batch_size: u32,
    #[prost(uint32, tag = "4")]
    pub sequence_length: u32,
    #[prost(uint32, tag = "5")]
    pub hidden_dim: u32,
    #[prost(uint32, tag = "6")]
    pub num_heads: u32,
    #[prost(uint32, tag = "7")]
    pub num_layers: u32,
    #[prost(float, tag = "8")]
    pub dropout_rate: f32,
    #[prost(bool, tag = "9")]
    pub use_positional_encoding: bool,
}
/// MAMBA-2 State Space Model parameters
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct MambaParams {
    #[prost(uint32, tag = "1")]
    pub epochs: u32,
    #[prost(float, tag = "2")]
    pub learning_rate: f32,
    #[prost(uint32, tag = "3")]
    pub batch_size: u32,
    #[prost(uint32, tag = "4")]
    pub state_dim: u32,
    #[prost(uint32, tag = "5")]
    pub hidden_dim: u32,
    #[prost(uint32, tag = "6")]
    pub num_layers: u32,
    #[prost(float, tag = "7")]
    pub dt_min: f32,
    #[prost(float, tag = "8")]
    pub dt_max: f32,
    #[prost(bool, tag = "9")]
    pub use_cuda_kernels: bool,
}
/// DQN (Deep Q-Network) parameters
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct DqnParams {
    #[prost(uint32, tag = "1")]
    pub epochs: u32,
    #[prost(float, tag = "2")]
    pub learning_rate: f32,
    #[prost(uint32, tag = "3")]
    pub batch_size: u32,
    #[prost(uint32, tag = "4")]
    pub replay_buffer_size: u32,
    #[prost(float, tag = "5")]
    pub epsilon_start: f32,
    #[prost(float, tag = "6")]
    pub epsilon_end: f32,
    #[prost(uint32, tag = "7")]
    pub epsilon_decay_steps: u32,
    #[prost(float, tag = "8")]
    pub gamma: f32,
    #[prost(uint32, tag = "9")]
    pub target_update_frequency: u32,
    #[prost(bool, tag = "10")]
    pub use_double_dqn: bool,
    #[prost(bool, tag = "11")]
    pub use_dueling: bool,
    #[prost(bool, tag = "12")]
    pub use_prioritized_replay: bool,
}
/// PPO (Proximal Policy Optimization) parameters
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct PpoParams {
    #[prost(uint32, tag = "1")]
    pub epochs: u32,
    #[prost(float, tag = "2")]
    pub learning_rate: f32,
    #[prost(uint32, tag = "3")]
    pub batch_size: u32,
    #[prost(float, tag = "4")]
    pub clip_ratio: f32,
    #[prost(float, tag = "5")]
    pub value_loss_coef: f32,
    #[prost(float, tag = "6")]
    pub entropy_coef: f32,
    #[prost(uint32, tag = "7")]
    pub rollout_steps: u32,
    #[prost(uint32, tag = "8")]
    pub minibatch_size: u32,
    #[prost(float, tag = "9")]
    pub gae_lambda: f32,
}
/// Liquid Network parameters
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct LiquidParams {
    #[prost(uint32, tag = "1")]
    pub epochs: u32,
    #[prost(float, tag = "2")]
    pub learning_rate: f32,
    #[prost(uint32, tag = "3")]
    pub batch_size: u32,
    #[prost(uint32, tag = "4")]
    pub num_neurons: u32,
    #[prost(float, tag = "5")]
    pub tau: f32,
    #[prost(float, tag = "6")]
    pub sigma: f32,
    #[prost(bool, tag = "7")]
    pub use_adaptive_tau: bool,
}
/// Temporal Fusion Transformer parameters
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct TftParams {
    #[prost(uint32, tag = "1")]
    pub epochs: u32,
    #[prost(float, tag = "2")]
    pub learning_rate: f32,
    #[prost(uint32, tag = "3")]
    pub batch_size: u32,
    #[prost(uint32, tag = "4")]
    pub hidden_dim: u32,
    #[prost(uint32, tag = "5")]
    pub num_heads: u32,
    #[prost(uint32, tag = "6")]
    pub num_layers: u32,
    #[prost(uint32, tag = "7")]
    pub lookback_window: u32,
    #[prost(uint32, tag = "8")]
    pub forecast_horizon: u32,
    #[prost(float, tag = "9")]
    pub dropout_rate: f32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ModelDefinition {
    #[prost(string, tag = "1")]
    pub model_type: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub description: ::prost::alloc::string::String,
    #[prost(message, optional, tag = "3")]
    pub default_hyperparameters: ::core::option::Option<Hyperparameters>,
    #[prost(string, repeated, tag = "4")]
    pub required_features: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    #[prost(uint32, tag = "5")]
    pub estimated_training_time_minutes: u32,
    #[prost(bool, tag = "6")]
    pub requires_gpu: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TrainingJobSummary {
    #[prost(string, tag = "1")]
    pub job_id: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub model_type: ::prost::alloc::string::String,
    #[prost(enumeration = "TrainingStatus", tag = "3")]
    pub status: i32,
    /// Unix timestamp in seconds
    #[prost(int64, tag = "4")]
    pub created_at: i64,
    /// Unix timestamp in seconds
    #[prost(int64, tag = "5")]
    pub started_at: i64,
    /// Unix timestamp in seconds
    #[prost(int64, tag = "6")]
    pub completed_at: i64,
    #[prost(string, tag = "7")]
    pub description: ::prost::alloc::string::String,
    #[prost(float, tag = "8")]
    pub final_loss: f32,
    #[prost(float, tag = "9")]
    pub best_validation_score: f32,
    #[prost(map = "string, string", tag = "10")]
    pub tags: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        ::prost::alloc::string::String,
    >,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TrainingJobDetails {
    #[prost(string, tag = "1")]
    pub job_id: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub model_type: ::prost::alloc::string::String,
    #[prost(enumeration = "TrainingStatus", tag = "3")]
    pub status: i32,
    /// Unix timestamp in seconds
    #[prost(int64, tag = "4")]
    pub created_at: i64,
    /// Unix timestamp in seconds
    #[prost(int64, tag = "5")]
    pub started_at: i64,
    /// Unix timestamp in seconds
    #[prost(int64, tag = "6")]
    pub completed_at: i64,
    #[prost(string, tag = "7")]
    pub description: ::prost::alloc::string::String,
    #[prost(message, optional, tag = "8")]
    pub hyperparameters: ::core::option::Option<Hyperparameters>,
    #[prost(message, optional, tag = "9")]
    pub data_source: ::core::option::Option<DataSource>,
    #[prost(message, repeated, tag = "10")]
    pub status_history: ::prost::alloc::vec::Vec<TrainingStatusUpdate>,
    #[prost(message, optional, tag = "11")]
    pub final_financial_metrics: ::core::option::Option<FinancialMetrics>,
    #[prost(string, tag = "12")]
    pub model_artifact_path: ::prost::alloc::string::String,
    #[prost(map = "string, string", tag = "13")]
    pub tags: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        ::prost::alloc::string::String,
    >,
    #[prost(string, tag = "14")]
    pub error_message: ::prost::alloc::string::String,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct FinancialMetrics {
    #[prost(float, tag = "1")]
    pub simulated_return: f32,
    #[prost(float, tag = "2")]
    pub sharpe_ratio: f32,
    #[prost(float, tag = "3")]
    pub max_drawdown: f32,
    #[prost(float, tag = "4")]
    pub hit_rate: f32,
    #[prost(float, tag = "5")]
    pub avg_prediction_error_bps: f32,
    #[prost(float, tag = "6")]
    pub risk_adjusted_return: f32,
    #[prost(float, tag = "7")]
    pub var_5pct: f32,
    #[prost(float, tag = "8")]
    pub expected_shortfall: f32,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct ResourceUsage {
    #[prost(float, tag = "1")]
    pub cpu_usage_percent: f32,
    #[prost(float, tag = "2")]
    pub memory_usage_gb: f32,
    #[prost(float, tag = "3")]
    pub gpu_usage_percent: f32,
    #[prost(float, tag = "4")]
    pub gpu_memory_usage_gb: f32,
    #[prost(uint32, tag = "5")]
    pub active_workers: u32,
}
/// Request to start batch tuning for multiple models
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchStartTuningJobsRequest {
    /// List of models to tune (DQN, PPO, MAMBA_2, TFT, etc.)
    #[prost(string, repeated, tag = "1")]
    pub model_types: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    /// Number of trials for each model
    #[prost(uint32, tag = "2")]
    pub trials_per_model: u32,
    /// Path to tuning configuration file
    #[prost(string, tag = "3")]
    pub config_path: ::prost::alloc::string::String,
    /// Training data source for all models
    #[prost(message, optional, tag = "4")]
    pub data_source: ::core::option::Option<DataSource>,
    /// Whether to use GPU acceleration
    #[prost(bool, tag = "5")]
    pub use_gpu: bool,
    /// Automatically export best params to YAML (default: true)
    #[prost(bool, tag = "6")]
    pub auto_export_yaml: bool,
    /// Custom YAML export path (default: ml/config/best_hyperparameters.yaml)
    #[prost(string, tag = "7")]
    pub yaml_export_path: ::prost::alloc::string::String,
    /// Optional batch job description
    #[prost(string, tag = "8")]
    pub description: ::prost::alloc::string::String,
    /// Optional categorization tags
    #[prost(map = "string, string", tag = "9")]
    pub tags: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        ::prost::alloc::string::String,
    >,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct BatchStartTuningJobsResponse {
    /// Unique batch job identifier
    #[prost(string, tag = "1")]
    pub batch_id: ::prost::alloc::string::String,
    /// Model execution order (after dependency resolution)
    #[prost(string, repeated, tag = "2")]
    pub execution_order: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    /// Human-readable status message
    #[prost(string, tag = "3")]
    pub message: ::prost::alloc::string::String,
    /// Initial batch status
    #[prost(enumeration = "BatchTuningStatus", tag = "4")]
    pub status: i32,
}
/// Request to get batch tuning job status
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetBatchTuningStatusRequest {
    /// Batch job identifier
    #[prost(string, tag = "1")]
    pub batch_id: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetBatchTuningStatusResponse {
    /// Batch job identifier
    #[prost(string, tag = "1")]
    pub batch_id: ::prost::alloc::string::String,
    /// Current batch status
    #[prost(enumeration = "BatchTuningStatus", tag = "2")]
    pub status: i32,
    /// Index of currently executing model (0-based)
    #[prost(uint32, tag = "3")]
    pub current_model_index: u32,
    /// Total number of models in batch
    #[prost(uint32, tag = "4")]
    pub total_models: u32,
    /// Results for completed models
    #[prost(message, repeated, tag = "5")]
    pub results: ::prost::alloc::vec::Vec<ModelTuningResult>,
    /// Currently tuning model type
    #[prost(string, tag = "6")]
    pub current_model: ::prost::alloc::string::String,
    /// Batch start time (Unix timestamp)
    #[prost(int64, tag = "7")]
    pub started_at: i64,
    /// Last update time (Unix timestamp)
    #[prost(int64, tag = "8")]
    pub updated_at: i64,
    /// Estimated completion time (Unix timestamp)
    #[prost(int64, tag = "9")]
    pub estimated_completion_time: i64,
    /// Path where YAML will be exported
    #[prost(string, tag = "10")]
    pub yaml_export_path: ::prost::alloc::string::String,
}
/// Individual model tuning result within batch
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ModelTuningResult {
    /// Model type (DQN, PPO, etc.)
    #[prost(string, tag = "1")]
    pub model_type: ::prost::alloc::string::String,
    /// Individual tuning job ID
    #[prost(string, tag = "2")]
    pub job_id: ::prost::alloc::string::String,
    /// Model tuning status
    #[prost(enumeration = "TuningJobStatus", tag = "3")]
    pub status: i32,
    /// Best hyperparameters found
    #[prost(map = "string, float", tag = "4")]
    pub best_params: ::std::collections::HashMap<::prost::alloc::string::String, f32>,
    /// Best metrics achieved
    #[prost(map = "string, float", tag = "5")]
    pub best_metrics: ::std::collections::HashMap<::prost::alloc::string::String, f32>,
    /// Number of trials completed
    #[prost(uint32, tag = "6")]
    pub trials_completed: u32,
    /// Model tuning start time
    #[prost(int64, tag = "7")]
    pub started_at: i64,
    /// Model tuning completion time
    #[prost(int64, tag = "8")]
    pub completed_at: i64,
    /// Error message if failed
    #[prost(string, tag = "9")]
    pub error_message: ::prost::alloc::string::String,
}
/// Request to stop batch tuning job
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct StopBatchTuningJobRequest {
    /// Batch job identifier
    #[prost(string, tag = "1")]
    pub batch_id: ::prost::alloc::string::String,
    /// Optional reason for stopping
    #[prost(string, tag = "2")]
    pub reason: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StopBatchTuningJobResponse {
    /// Whether stop was successful
    #[prost(bool, tag = "1")]
    pub success: bool,
    /// Human-readable status message
    #[prost(string, tag = "2")]
    pub message: ::prost::alloc::string::String,
    /// Final batch status
    #[prost(enumeration = "BatchTuningStatus", tag = "3")]
    pub final_status: i32,
    /// Results for completed models
    #[prost(message, repeated, tag = "4")]
    pub completed_results: ::prost::alloc::vec::Vec<ModelTuningResult>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct JobCompletionReport {
    #[prost(string, tag = "1")]
    pub job_id: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub s3_path: ::prost::alloc::string::String,
    #[prost(bool, tag = "3")]
    pub success: bool,
    #[prost(string, tag = "4")]
    pub error_message: ::prost::alloc::string::String,
    #[prost(map = "string, double", tag = "5")]
    pub metrics: ::std::collections::HashMap<::prost::alloc::string::String, f64>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct JobCompletionAck {
    #[prost(bool, tag = "1")]
    pub accepted: bool,
    #[prost(string, tag = "2")]
    pub promotion_status: ::prost::alloc::string::String,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ListPendingPromotionsRequest {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListPendingPromotionsResponse {
    #[prost(message, repeated, tag = "1")]
    pub promotions: ::prost::alloc::vec::Vec<PendingPromotion>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PendingPromotion {
    #[prost(string, tag = "1")]
    pub model_id: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub model_type: ::prost::alloc::string::String,
    #[prost(string, tag = "3")]
    pub symbol: ::prost::alloc::string::String,
    #[prost(string, tag = "4")]
    pub s3_path: ::prost::alloc::string::String,
    #[prost(map = "string, double", tag = "5")]
    pub new_metrics: ::std::collections::HashMap<::prost::alloc::string::String, f64>,
    #[prost(map = "string, double", tag = "6")]
    pub current_metrics: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        f64,
    >,
    #[prost(int64, tag = "7")]
    pub trained_at: i64,
    #[prost(string, tag = "8")]
    pub job_id: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ApprovePromotionRequest {
    #[prost(string, tag = "1")]
    pub model_id: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ApprovePromotionResponse {
    #[prost(bool, tag = "1")]
    pub success: bool,
    #[prost(string, tag = "2")]
    pub message: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RejectPromotionRequest {
    #[prost(string, tag = "1")]
    pub model_id: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub reason: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RejectPromotionResponse {
    #[prost(bool, tag = "1")]
    pub success: bool,
    #[prost(string, tag = "2")]
    pub message: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ApproveModelRequest {
    #[prost(string, tag = "1")]
    pub model_id: ::prost::alloc::string::String,
    /// e.g. "production", "staging", "canary"
    #[prost(string, tag = "2")]
    pub promoted_to: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ApproveModelResponse {
    #[prost(bool, tag = "1")]
    pub success: bool,
    #[prost(string, tag = "2")]
    pub message: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RejectModelRequest {
    #[prost(string, tag = "1")]
    pub model_id: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub reason: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RejectModelResponse {
    #[prost(bool, tag = "1")]
    pub success: bool,
    #[prost(string, tag = "2")]
    pub message: ::prost::alloc::string::String,
}
/// Training mode selection
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum TrainingMode {
    /// Full training from scratch (default, backward-compatible)
    Full = 0,
    /// Fine-tune from existing checkpoint
    FineTune = 1,
}
impl TrainingMode {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::Full => "TRAINING_MODE_FULL",
            Self::FineTune => "TRAINING_MODE_FINE_TUNE",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "TRAINING_MODE_FULL" => Some(Self::Full),
            "TRAINING_MODE_FINE_TUNE" => Some(Self::FineTune),
            _ => None,
        }
    }
}
/// Type of progress update
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum UpdateType {
    /// Unknown/unspecified
    UpdateUnknown = 0,
    /// Trial completed
    UpdateTrialComplete = 1,
    /// Keepalive heartbeat (no trial change)
    UpdateHeartbeat = 2,
    /// Job completed/stopped/failed
    UpdateJobComplete = 3,
}
impl UpdateType {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::UpdateUnknown => "UPDATE_UNKNOWN",
            Self::UpdateTrialComplete => "UPDATE_TRIAL_COMPLETE",
            Self::UpdateHeartbeat => "UPDATE_HEARTBEAT",
            Self::UpdateJobComplete => "UPDATE_JOB_COMPLETE",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "UPDATE_UNKNOWN" => Some(Self::UpdateUnknown),
            "UPDATE_TRIAL_COMPLETE" => Some(Self::UpdateTrialComplete),
            "UPDATE_HEARTBEAT" => Some(Self::UpdateHeartbeat),
            "UPDATE_JOB_COMPLETE" => Some(Self::UpdateJobComplete),
            _ => None,
        }
    }
}
/// Current status of a training job
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum TrainingStatus {
    /// Default/unknown status
    Unknown = 0,
    /// Job queued, waiting to start
    Pending = 1,
    /// Job currently executing
    Running = 2,
    /// Job finished successfully
    Completed = 3,
    /// Job failed with error
    Failed = 4,
    /// Job manually stopped
    Stopped = 5,
    /// Job temporarily paused
    Paused = 6,
}
impl TrainingStatus {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::Unknown => "UNKNOWN",
            Self::Pending => "PENDING",
            Self::Running => "RUNNING",
            Self::Completed => "COMPLETED",
            Self::Failed => "FAILED",
            Self::Stopped => "STOPPED",
            Self::Paused => "PAUSED",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "UNKNOWN" => Some(Self::Unknown),
            "PENDING" => Some(Self::Pending),
            "RUNNING" => Some(Self::Running),
            "COMPLETED" => Some(Self::Completed),
            "FAILED" => Some(Self::Failed),
            "STOPPED" => Some(Self::Stopped),
            "PAUSED" => Some(Self::Paused),
            _ => None,
        }
    }
}
/// Status of a hyperparameter tuning job
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum TuningJobStatus {
    /// Default/unknown status
    TuningUnknown = 0,
    /// Job queued, waiting to start
    TuningPending = 1,
    /// Job currently executing trials
    TuningRunning = 2,
    /// Job finished all trials successfully
    TuningCompleted = 3,
    /// Job failed with error
    TuningFailed = 4,
    /// Job manually stopped before completion
    TuningStopped = 5,
}
impl TuningJobStatus {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::TuningUnknown => "TUNING_UNKNOWN",
            Self::TuningPending => "TUNING_PENDING",
            Self::TuningRunning => "TUNING_RUNNING",
            Self::TuningCompleted => "TUNING_COMPLETED",
            Self::TuningFailed => "TUNING_FAILED",
            Self::TuningStopped => "TUNING_STOPPED",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "TUNING_UNKNOWN" => Some(Self::TuningUnknown),
            "TUNING_PENDING" => Some(Self::TuningPending),
            "TUNING_RUNNING" => Some(Self::TuningRunning),
            "TUNING_COMPLETED" => Some(Self::TuningCompleted),
            "TUNING_FAILED" => Some(Self::TuningFailed),
            "TUNING_STOPPED" => Some(Self::TuningStopped),
            _ => None,
        }
    }
}
/// Outcome state of an individual trial
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum TrialState {
    /// Default/unknown state
    TrialUnknown = 0,
    /// Trial currently executing
    TrialRunning = 1,
    /// Trial completed successfully
    TrialComplete = 2,
    /// Trial pruned by Optuna (early stopping)
    TrialPruned = 3,
    /// Trial failed with error
    TrialFailed = 4,
}
impl TrialState {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::TrialUnknown => "TRIAL_UNKNOWN",
            Self::TrialRunning => "TRIAL_RUNNING",
            Self::TrialComplete => "TRIAL_COMPLETE",
            Self::TrialPruned => "TRIAL_PRUNED",
            Self::TrialFailed => "TRIAL_FAILED",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "TRIAL_UNKNOWN" => Some(Self::TrialUnknown),
            "TRIAL_RUNNING" => Some(Self::TrialRunning),
            "TRIAL_COMPLETE" => Some(Self::TrialComplete),
            "TRIAL_PRUNED" => Some(Self::TrialPruned),
            "TRIAL_FAILED" => Some(Self::TrialFailed),
            _ => None,
        }
    }
}
/// Batch tuning job status
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum BatchTuningStatus {
    /// Default/unknown status
    BatchUnknown = 0,
    /// Batch queued, waiting to start
    BatchPending = 1,
    /// Batch currently executing models
    BatchRunning = 2,
    /// All models completed successfully
    BatchCompleted = 3,
    /// Some models succeeded, some failed
    BatchPartiallyCompleted = 4,
    /// Batch failed (all models failed or critical error)
    BatchFailed = 5,
    /// Batch manually stopped
    BatchStopped = 6,
}
impl BatchTuningStatus {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::BatchUnknown => "BATCH_UNKNOWN",
            Self::BatchPending => "BATCH_PENDING",
            Self::BatchRunning => "BATCH_RUNNING",
            Self::BatchCompleted => "BATCH_COMPLETED",
            Self::BatchPartiallyCompleted => "BATCH_PARTIALLY_COMPLETED",
            Self::BatchFailed => "BATCH_FAILED",
            Self::BatchStopped => "BATCH_STOPPED",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "BATCH_UNKNOWN" => Some(Self::BatchUnknown),
            "BATCH_PENDING" => Some(Self::BatchPending),
            "BATCH_RUNNING" => Some(Self::BatchRunning),
            "BATCH_COMPLETED" => Some(Self::BatchCompleted),
            "BATCH_PARTIALLY_COMPLETED" => Some(Self::BatchPartiallyCompleted),
            "BATCH_FAILED" => Some(Self::BatchFailed),
            "BATCH_STOPPED" => Some(Self::BatchStopped),
            _ => None,
        }
    }
}
/// Generated client implementations.
#[allow(unused_qualifications)]
pub mod ml_training_service_client {
    #![allow(
        unused_variables,
        dead_code,
        missing_docs,
        clippy::wildcard_imports,
        clippy::let_unit_value,
    )]
    use tonic::codegen::*;
    use tonic::codegen::http::Uri;
    /// ML Training Service provides comprehensive machine learning model training capabilities for HFT systems.
    /// This service manages training jobs for MAMBA-2, TLOB transformers, DQN, PPO, Liquid Networks, and TFT models
    /// with real-time progress monitoring, resource management, and performance tracking.
    #[derive(Debug, Clone)]
    pub struct MlTrainingServiceClient<T> {
        inner: tonic::client::Grpc<T>,
    }
    impl MlTrainingServiceClient<tonic::transport::Channel> {
        /// Attempt to create a new client by connecting to a given endpoint.
        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
        where
            D: TryInto<tonic::transport::Endpoint>,
            D::Error: Into<StdError>,
        {
            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
            Ok(Self::new(conn))
        }
    }
    impl<T> MlTrainingServiceClient<T>
    where
        T: tonic::client::GrpcService<tonic::body::Body>,
        T::Error: Into<StdError>,
        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
    {
        pub fn new(inner: T) -> Self {
            let inner = tonic::client::Grpc::new(inner);
            Self { inner }
        }
        pub fn with_origin(inner: T, origin: Uri) -> Self {
            let inner = tonic::client::Grpc::with_origin(inner, origin);
            Self { inner }
        }
        pub fn with_interceptor<F>(
            inner: T,
            interceptor: F,
        ) -> MlTrainingServiceClient<InterceptedService<T, F>>
        where
            F: tonic::service::Interceptor,
            T::ResponseBody: Default,
            T: tonic::codegen::Service<
                http::Request<tonic::body::Body>,
                Response = http::Response<
                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
                >,
            >,
            <T as tonic::codegen::Service<
                http::Request<tonic::body::Body>,
            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
        {
            MlTrainingServiceClient::new(InterceptedService::new(inner, interceptor))
        }
        /// Compress requests with the given encoding.
        ///
        /// This requires the server to support it otherwise it might respond with an
        /// error.
        #[must_use]
        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.send_compressed(encoding);
            self
        }
        /// Enable decompressing responses.
        #[must_use]
        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.accept_compressed(encoding);
            self
        }
        /// Limits the maximum size of a decoded message.
        ///
        /// Default: `4MB`
        #[must_use]
        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_decoding_message_size(limit);
            self
        }
        /// Limits the maximum size of an encoded message.
        ///
        /// Default: `usize::MAX`
        #[must_use]
        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_encoding_message_size(limit);
            self
        }
        /// Training Job Management
        /// Initiates a new training job and returns job ID immediately
        pub async fn start_training(
            &mut self,
            request: impl tonic::IntoRequest<super::StartTrainingRequest>,
        ) -> std::result::Result<
            tonic::Response<super::StartTrainingResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/ml_training.MLTrainingService/StartTraining",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new("ml_training.MLTrainingService", "StartTraining"),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Subscribe to real-time training progress and status updates
        pub async fn subscribe_to_training_status(
            &mut self,
            request: impl tonic::IntoRequest<super::SubscribeToTrainingStatusRequest>,
        ) -> std::result::Result<
            tonic::Response<tonic::codec::Streaming<super::TrainingStatusUpdate>>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/ml_training.MLTrainingService/SubscribeToTrainingStatus",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "ml_training.MLTrainingService",
                        "SubscribeToTrainingStatus",
                    ),
                );
            self.inner.server_streaming(req, path, codec).await
        }
        /// Stop a running training job (idempotent operation)
        pub async fn stop_training(
            &mut self,
            request: impl tonic::IntoRequest<super::StopTrainingRequest>,
        ) -> std::result::Result<
            tonic::Response<super::StopTrainingResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/ml_training.MLTrainingService/StopTraining",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new("ml_training.MLTrainingService", "StopTraining"),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Model and Job Discovery
        /// List available ML models with their training parameters
        pub async fn list_available_models(
            &mut self,
            request: impl tonic::IntoRequest<super::ListAvailableModelsRequest>,
        ) -> std::result::Result<
            tonic::Response<super::ListAvailableModelsResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/ml_training.MLTrainingService/ListAvailableModels",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "ml_training.MLTrainingService",
                        "ListAvailableModels",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Get paginated list of training job history
        pub async fn list_training_jobs(
            &mut self,
            request: impl tonic::IntoRequest<super::ListTrainingJobsRequest>,
        ) -> std::result::Result<
            tonic::Response<super::ListTrainingJobsResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/ml_training.MLTrainingService/ListTrainingJobs",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new("ml_training.MLTrainingService", "ListTrainingJobs"),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Get comprehensive details for a specific training job
        pub async fn get_training_job_details(
            &mut self,
            request: impl tonic::IntoRequest<super::GetTrainingJobDetailsRequest>,
        ) -> std::result::Result<
            tonic::Response<super::GetTrainingJobDetailsResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/ml_training.MLTrainingService/GetTrainingJobDetails",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "ml_training.MLTrainingService",
                        "GetTrainingJobDetails",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Service Health and Status
        /// Check service health and resource availability
        pub async fn health_check(
            &mut self,
            request: impl tonic::IntoRequest<super::HealthCheckRequest>,
        ) -> std::result::Result<
            tonic::Response<super::HealthCheckResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/ml_training.MLTrainingService/HealthCheck",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(GrpcMethod::new("ml_training.MLTrainingService", "HealthCheck"));
            self.inner.unary(req, path, codec).await
        }
        /// Hyperparameter Tuning Management
        /// Start a new hyperparameter tuning job using Optuna
        pub async fn start_tuning_job(
            &mut self,
            request: impl tonic::IntoRequest<super::StartTuningJobRequest>,
        ) -> std::result::Result<
            tonic::Response<super::StartTuningJobResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/ml_training.MLTrainingService/StartTuningJob",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new("ml_training.MLTrainingService", "StartTuningJob"),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Get current status and best parameters from a tuning job
        pub async fn get_tuning_job_status(
            &mut self,
            request: impl tonic::IntoRequest<super::GetTuningJobStatusRequest>,
        ) -> std::result::Result<
            tonic::Response<super::GetTuningJobStatusResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/ml_training.MLTrainingService/GetTuningJobStatus",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "ml_training.MLTrainingService",
                        "GetTuningJobStatus",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Stop a running hyperparameter tuning job
        pub async fn stop_tuning_job(
            &mut self,
            request: impl tonic::IntoRequest<super::StopTuningJobRequest>,
        ) -> std::result::Result<
            tonic::Response<super::StopTuningJobResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/ml_training.MLTrainingService/StopTuningJob",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new("ml_training.MLTrainingService", "StopTuningJob"),
                );
            self.inner.unary(req, path, codec).await
        }
        /// INTERNAL: Train a single model instance with specific hyperparameters (called by Optuna subprocess)
        pub async fn train_model(
            &mut self,
            request: impl tonic::IntoRequest<super::TrainModelRequest>,
        ) -> std::result::Result<
            tonic::Response<super::TrainModelResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/ml_training.MLTrainingService/TrainModel",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(GrpcMethod::new("ml_training.MLTrainingService", "TrainModel"));
            self.inner.unary(req, path, codec).await
        }
        /// Stream real-time tuning progress updates (trial completion events)
        pub async fn stream_tuning_progress(
            &mut self,
            request: impl tonic::IntoRequest<super::StreamProgressRequest>,
        ) -> std::result::Result<
            tonic::Response<tonic::codec::Streaming<super::ProgressUpdate>>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/ml_training.MLTrainingService/StreamTuningProgress",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "ml_training.MLTrainingService",
                        "StreamTuningProgress",
                    ),
                );
            self.inner.server_streaming(req, path, codec).await
        }
        /// Batch Tuning Management
        /// Start batch tuning job for multiple models with automatic dependency resolution
        pub async fn batch_start_tuning_jobs(
            &mut self,
            request: impl tonic::IntoRequest<super::BatchStartTuningJobsRequest>,
        ) -> std::result::Result<
            tonic::Response<super::BatchStartTuningJobsResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/ml_training.MLTrainingService/BatchStartTuningJobs",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "ml_training.MLTrainingService",
                        "BatchStartTuningJobs",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Get batch tuning job status with per-model results
        pub async fn get_batch_tuning_status(
            &mut self,
            request: impl tonic::IntoRequest<super::GetBatchTuningStatusRequest>,
        ) -> std::result::Result<
            tonic::Response<super::GetBatchTuningStatusResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/ml_training.MLTrainingService/GetBatchTuningStatus",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "ml_training.MLTrainingService",
                        "GetBatchTuningStatus",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Stop a running batch tuning job
        pub async fn stop_batch_tuning_job(
            &mut self,
            request: impl tonic::IntoRequest<super::StopBatchTuningJobRequest>,
        ) -> std::result::Result<
            tonic::Response<super::StopBatchTuningJobResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/ml_training.MLTrainingService/StopBatchTuningJob",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "ml_training.MLTrainingService",
                        "StopBatchTuningJob",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Job Completion Callback (called by training-uploader sidecar)
        pub async fn report_job_completion(
            &mut self,
            request: impl tonic::IntoRequest<super::JobCompletionReport>,
        ) -> std::result::Result<
            tonic::Response<super::JobCompletionAck>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/ml_training.MLTrainingService/ReportJobCompletion",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "ml_training.MLTrainingService",
                        "ReportJobCompletion",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Model Promotion Management
        pub async fn list_pending_promotions(
            &mut self,
            request: impl tonic::IntoRequest<super::ListPendingPromotionsRequest>,
        ) -> std::result::Result<
            tonic::Response<super::ListPendingPromotionsResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/ml_training.MLTrainingService/ListPendingPromotions",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "ml_training.MLTrainingService",
                        "ListPendingPromotions",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        pub async fn approve_promotion(
            &mut self,
            request: impl tonic::IntoRequest<super::ApprovePromotionRequest>,
        ) -> std::result::Result<
            tonic::Response<super::ApprovePromotionResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/ml_training.MLTrainingService/ApprovePromotion",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new("ml_training.MLTrainingService", "ApprovePromotion"),
                );
            self.inner.unary(req, path, codec).await
        }
        pub async fn reject_promotion(
            &mut self,
            request: impl tonic::IntoRequest<super::RejectPromotionRequest>,
        ) -> std::result::Result<
            tonic::Response<super::RejectPromotionResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/ml_training.MLTrainingService/RejectPromotion",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new("ml_training.MLTrainingService", "RejectPromotion"),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Model approval / rejection (dashboard-facing, delegates to promotion pipeline)
        pub async fn approve_model(
            &mut self,
            request: impl tonic::IntoRequest<super::ApproveModelRequest>,
        ) -> std::result::Result<
            tonic::Response<super::ApproveModelResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/ml_training.MLTrainingService/ApproveModel",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new("ml_training.MLTrainingService", "ApproveModel"),
                );
            self.inner.unary(req, path, codec).await
        }
        pub async fn reject_model(
            &mut self,
            request: impl tonic::IntoRequest<super::RejectModelRequest>,
        ) -> std::result::Result<
            tonic::Response<super::RejectModelResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/ml_training.MLTrainingService/RejectModel",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(GrpcMethod::new("ml_training.MLTrainingService", "RejectModel"));
            self.inner.unary(req, path, codec).await
        }
    }
}
