Skip to main content

load_context

Function load_context 

Source
pub async fn load_context(path: &Path) -> Vec<ChatMessage>
Expand description

Load context messages from a JSONL file.

Each line is a serde_json-serialised ChatMessage. Lines that fail to parse are skipped with a warning so a single corrupted entry doesn’t prevent the session from resuming.

Returns an empty Vec when the file does not exist — callers treat that as the start of a new session.