Skip to main content

feagi_api/v1/
training_dtos.rs

1// Copyright 2025 Neuraville Inc.
2// Licensed under the Apache License, Version 2.0
3
4//! Training API DTOs
5//!
6//! Request/response types for reinforcement learning and training
7
8use serde::{Deserialize, Serialize};
9use std::collections::HashMap;
10use utoipa::ToSchema;
11
12/// Shock configuration request
13#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)]
14pub struct ShockConfigRequest {
15    pub shock: Vec<String>,
16}
17
18/// Shock options response
19#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)]
20pub struct ShockOptionsResponse {
21    pub options: Vec<String>,
22}
23
24/// Shock status response
25#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)]
26pub struct ShockStatusResponse {
27    pub active: bool,
28    pub scenarios: Vec<String>,
29}
30
31/// Intensity configuration request
32#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)]
33pub struct IntensityRequest {
34    pub intensity: f64,
35}
36
37/// Brain fitness response
38#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)]
39pub struct BrainFitnessResponse {
40    pub fitness: f64,
41}
42
43/// Fitness criteria response
44#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)]
45pub struct FitnessCriteriaResponse {
46    pub criteria: HashMap<String, f64>,
47}
48
49/// Fitness criteria update request
50#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)]
51pub struct FitnessCriteriaUpdateRequest {
52    pub criteria: HashMap<String, f64>,
53}
54
55/// Fitness statistics response
56#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)]
57pub struct FitnessStatsResponse {
58    pub stats: HashMap<String, serde_json::Value>,
59}
60
61/// Training report response
62#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)]
63pub struct TrainingReportResponse {
64    pub report: HashMap<String, serde_json::Value>,
65}
66
67/// Training status response
68#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)]
69pub struct TrainingStatusResponse {
70    pub active: bool,
71    pub mode: String,
72}
73
74/// Training statistics response
75#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)]
76pub struct TrainingStatsResponse {
77    pub total_episodes: u64,
78    pub total_rewards: f64,
79}
80
81/// Training configuration request
82#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)]
83pub struct TrainingConfigRequest {
84    pub config: HashMap<String, serde_json::Value>,
85}
86
87/// Success response
88#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)]
89pub struct TrainingSuccessResponse {
90    pub message: String,
91    pub success: bool,
92}