fn with_context()

in confidence/src/contextual_confidence.rs [26:41]


    fn with_context(&self, context: HashMap<String, ConfidenceValue>) -> Confidence {
        let api_config = (&self.api_config).clone();
        let new_context: HashMap<String, ConfidenceValue> = context
            .iter()
            .map(|(key, value)| (key.to_string(), value.clone()))
            .collect();

        Confidence::builder()
            .api_config(APIConfig {
                api_key: api_config.api_key,
                region: api_config.region
            })
            .context(new_context)
            .resolver(Arc::clone(&self.resolver))
            .build()
    }