Expand description
HAIL JSONL format: streaming serialization/deserialization
A .hail.jsonl file has the structure:
{"type":"header","version":"hail-1.0.0","session_id":"...","agent":{...},"context":{...}}
{"type":"event","event_id":"e1","timestamp":"...","event_type":{...},"content":{...},...}
{"type":"event","event_id":"e2","timestamp":"...","event_type":{...},"content":{...},...}
{"type":"stats","event_count":42,"message_count":10,...}The header line contains session metadata (no events). Each event is one line. The last line is aggregate stats (optional on write, recomputed on read if missing).
Enums§
- Hail
Line - A single line in a HAIL JSONL file
- Jsonl
Error - Error types for JSONL operations
Functions§
- from_
jsonl_ str - Read a Session from a HAIL JSONL string
- read_
header - Read only the header (first line) from HAIL JSONL — useful for listing sessions without loading all events
- read_
header_ and_ stats - Read header + stats (first and last line) without loading events. Returns (version, session_id, agent, context, stats_or_none)
- read_
jsonl - Read a Session from HAIL JSONL reader
- to_
jsonl_ string - Write a Session as HAIL JSONL to a String
- write_
jsonl - Write a Session as HAIL JSONL to a writer