MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / from_input

Method from_input

atomic-agent/src/hook_log.rs:29–32  ·  view source on GitHub ↗

Best-effort extraction keeps invalid JSON attributable when the caller supplies correlation via the environment; otherwise it stays unassigned.

(input: &[u8])

Source from the content-addressed store, hash-verified

27 /// Best-effort extraction keeps invalid JSON attributable when the caller
28 /// supplies correlation via the environment; otherwise it stays unassigned.
29 pub fn from_input(input: &[u8]) -> Self {
30 let value = serde_json::from_slice::<serde_json::Value>(input).ok();
31 Self::from_json(value.as_ref()).with_environment()
32 }
33
34 pub fn from_event(event: &crate::event::TurnEvent) -> Self {
35 Self::from_event_payload(event).with_environment()

Callers

nothing calls this directly

Calls 3

with_environmentMethod · 0.80
as_refMethod · 0.80
okMethod · 0.45

Tested by

no test coverage detected