Dependencies¶
Injectable dependencies for hook handlers.
Transcript¶
Access to the conversation history and statistics. See Transcript API for full documentation.
Transcript ¶
Mutable collection of entries backed by a JSONL file.
Usage
Standalone¶
transcript = Transcript("/path/to/transcript.jsonl") transcript.load()
Query¶
for msg in transcript.user_messages: print(msg.text)
user_messages
property
¶
All user messages (uses default include_archived setting).
assistant_messages
property
¶
All assistant messages (uses default include_archived setting).
__init__ ¶
__init__(
path: str | Path | None = None,
validate: Literal["strict", "warn", "none"] = "warn",
safety: Literal["strict", "warn", "none"] = "warn",
auto_load: bool = True,
)
TranscriptStats ¶
Statistics extracted from a transcript.
State¶
Persistent session-scoped storage.
State ¶
Bases: dict[str, Any]
Persistent dict backed by JSON file.
Behaves like a regular dict but can save/load from file. Use as context manager for auto-save on exit.