pub struct Config {
pub provider: Provider,
pub model: Model,
pub surface: Surface,
pub api_base: Option<Url>,
pub timeout: Duration,
pub retry: RetryConfig,
pub thresholds: Thresholds,
pub context_check: bool,
pub default_session_id: Option<String>,
pub default_user: Option<String>,
}Expand description
Deserializable client configuration, for the config-file path.
Nests under an application’s YAML with #[serde(rename_all = "camelCase", deny_unknown_fields)]
so a typo in a threshold name or config key is rejected at load time instead of
silently ignored:
jev:
model: typesafe/jev-1.13
surface: decisions
timeoutMs: 10000
retry:
maxAttempts: 3
initialBackoffMs: 200
maxBackoffMs: 2000
thresholds:
autoRouteConfidence: 0.7
isBugYes: 0.9§Examples
let yaml = r#"
model: typesafe/jev-1.13
surface: decisions
timeoutMs: 5000
thresholds:
isBugYes: 0.9
"#;
let config: jev::Config = serde_norway::from_str(yaml).unwrap();
assert_eq!(config.surface, jev::Surface::Decisions);
assert_eq!(config.thresholds.get("isBugYes"), Some(0.9));Fields§
§provider: ProviderThe hosted provider. Defaults to OpenRouter; TypeSafe always uses System One.
model: ModelThe model to request. Defaults to crate::DEFAULT_MODEL.
surface: SurfaceThe OpenRouter HTTP surface to call. TypeSafe always uses System One.
api_base: Option<Url>Override for the API base URL (scheme + host), mainly for tests.
timeout: DurationPer-request timeout.
retry: RetryConfigRetry policy.
thresholds: ThresholdsNamed probability thresholds.
context_check: boolWhether to run the cheap pre-flight context-size estimate.
default_session_id: Option<String>Default session identifier applied to every request unless overridden by
RequestOptions::with_session_id (Decisions surface only).
default_user: Option<String>Default user identifier applied to every request unless overridden by
RequestOptions::with_user (Decisions surface only).