next_web_ai/chat/observation/
observation_convention.rs

1use next_web_core::DynClone;
2
3use crate::{
4    observation::observation::Context,
5    util::{key_value::KeyValue, key_values::KeyValues},
6};
7
8pub trait ObservationConvention<T>: Send + Sync
9where
10    Self: DynClone,
11{
12    fn low_cardinality_key_values(&self, context: &dyn Context) -> KeyValues<Box<dyn KeyValue>> {
13        KeyValues::empty()
14    }
15
16    fn high_cardinality_key_values(&self, context: &dyn Context) -> KeyValues<Box<dyn KeyValue>> {
17        KeyValues::empty()
18    }
19
20    fn supports_context(&self, context: &dyn Context) -> bool;
21
22    fn name(&self) -> Option<&str> {
23        return None;
24    }
25
26    fn contextual_name(&self, context: &dyn Context) -> Option<&str> {
27        return None;
28    }
29}
30
31next_web_core::clone_trait_object!(<T>  ObservationConvention<T> where T: Send + Sync + Clone);