Split listener (#141)

This commit is contained in:
Adil Hafeez 2024-10-08 16:24:08 -07:00 committed by GitHub
parent 22bc3d2798
commit 285aa1419b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 449 additions and 335 deletions

View file

@ -8,6 +8,11 @@ pub struct Overrides {
pub prompt_target_intent_matching_threshold: Option<f64>,
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct Tracing {
pub sampling_rate: Option<f64>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Configuration {
pub version: String,
@ -19,8 +24,8 @@ pub struct Configuration {
pub prompt_guards: Option<PromptGuards>,
pub prompt_targets: Vec<PromptTarget>,
pub error_target: Option<ErrorTargetDetail>,
pub tracing: Option<i16>,
pub ratelimits: Option<Vec<Ratelimit>>,
pub tracing: Option<Tracing>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
@ -277,6 +282,6 @@ mod test {
);
let tracing = config.tracing.as_ref().unwrap();
assert_eq!(*tracing, 100);
assert_eq!(tracing.sampling_rate.unwrap(), 0.1);
}
}