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

Method from_history

core/src/agent_api/runtime.rs:22–32  ·  view source on GitHub ↗
(session: &AgentSession, history: Option<&[Message]>)

Source from the content-addressed store, hash-verified

20
21impl ConversationInput {
22 pub(super) fn from_history(session: &AgentSession, history: Option<&[Message]>) -> Self {
23 let use_internal = history.is_none();
24 let messages = match history {
25 Some(history) => history.to_vec(),
26 None => read_or_recover(&session.history).clone(),
27 };
28 Self {
29 messages,
30 persistence: use_internal.then(|| SessionPersistenceContext::from_session(session)),
31 }
32 }
33
34 pub(super) fn with_attachments(
35 session: &AgentSession,

Callers

nothing calls this directly

Calls 2

read_or_recoverFunction · 0.85
cloneMethod · 0.45

Tested by

no test coverage detected