MCPcopy Create free account
hub / github.com/AI45Lab/Code / with_freshness

Method with_freshness

core/src/context/mod.rs:259–265  ·  view source on GitHub ↗

Set freshness score (0.0 to 1.0) for harness-controlled ranking.

(mut self, freshness: f32)

Source from the content-addressed store, hash-verified

257
258 /// Set freshness score (0.0 to 1.0) for harness-controlled ranking.
259 pub fn with_freshness(mut self, freshness: f32) -> Self {
260 self.metadata.insert(
261 CONTEXT_FRESHNESS_METADATA.to_string(),
262 serde_json::json!(freshness.clamp(0.0, 1.0)),
263 );
264 self
265 }
266
267 pub fn provenance(&self) -> Option<&str> {
268 self.metadata

Callers 8

push_agents_md_contextFunction · 0.80
queryMethod · 0.80
queryMethod · 0.80

Calls 1

insertMethod · 0.45

Tested by 1