use std::net::SocketAddr;
use std::path::PathBuf;
use clap::Args;
#[derive(Debug, Clone, Default, Args)]
pub(crate) struct ServerArgs {
#[arg(long)]
pub(super) config: Option<PathBuf>,
#[arg(long, env = "NEMO_RELAY_GATEWAY_BIND")]
pub(super) bind: Option<SocketAddr>,
#[arg(long, env = "NEMO_RELAY_OPENAI_BASE_URL")]
pub(super) openai_base_url: Option<String>,
#[arg(long, env = "NEMO_RELAY_ANTHROPIC_BASE_URL")]
pub(super) anthropic_base_url: Option<String>,
#[arg(long, env = "NEMO_RELAY_PLUGIN_CONFIG_PATH", hide = true)]
pub(super) plugin_config_path: Option<PathBuf>,
#[arg(long, hide = true)]
pub(super) ready_file: Option<PathBuf>,
#[arg(long, env = "NEMO_RELAY_MAX_HOOK_PAYLOAD_BYTES")]
pub(super) max_hook_payload_bytes: Option<usize>,
#[arg(long, env = "NEMO_RELAY_MAX_PASSTHROUGH_BODY_BYTES")]
pub(super) max_passthrough_body_bytes: Option<usize>,
}
impl ServerArgs {
pub(super) fn to_runtime(&self) -> crate::server::GatewayOverrides {
crate::server::GatewayOverrides {
config: self.config.clone(),
bind: self.bind,
openai_base_url: self.openai_base_url.clone(),
anthropic_base_url: self.anthropic_base_url.clone(),
plugin_config_path: self.plugin_config_path.clone(),
ready_file: self.ready_file.clone(),
max_hook_payload_bytes: self.max_hook_payload_bytes,
max_passthrough_body_bytes: self.max_passthrough_body_bytes,
}
}
}