use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ResourceQuotas {
#[serde(default)]
pub max_execution_time: Option<u64>,
#[serde(default)]
pub max_memory: Option<u64>,
#[serde(default)]
pub max_tokens: Option<u64>,
#[serde(default)]
pub max_tool_calls: Option<u32>,
#[serde(default)]
pub max_files_modified: Option<u32>,
}
impl Default for ResourceQuotas {
fn default() -> Self {
Self {
max_execution_time: Some(30 * 60), max_memory: None,
max_tokens: Some(100_000),
max_tool_calls: Some(500),
max_files_modified: Some(50),
}
}
}
impl ResourceQuotas {
pub fn conservative() -> Self {
Self {
max_execution_time: Some(5 * 60), max_memory: Some(512 * 1024 * 1024), max_tokens: Some(10_000),
max_tool_calls: Some(50),
max_files_modified: Some(10),
}
}
pub fn standard() -> Self {
Self::default()
}
pub fn generous() -> Self {
Self {
max_execution_time: Some(2 * 60 * 60), max_memory: None,
max_tokens: Some(500_000),
max_tool_calls: Some(2000),
max_files_modified: Some(200),
}
}
}