Classes
ActionRecord
3
▼
Single recorded action with timestamp.
ActionRecord
3
▼
Single recorded action with timestamp.
Attributes
| Name | Type | Description |
|---|---|---|
timestamp |
float
|
— |
action |
Action
|
— |
state_hash |
str
|
— |
SessionRecording
4
▼
Complete recorded session.
SessionRecording
4
▼
Complete recorded session.
Attributes
| Name | Type | Description |
|---|---|---|
initial_state |
Any
|
— |
records |
tuple[ActionRecord, ...]
|
— |
final_state |
Any
|
— |
metadata |
dict[str, str]
|
— |
Functions
state_hash
1
str
▼
SHA256 hash of state repr, truncated to 16 chars.
state_hash
1
str
▼
def state_hash(state: Any) -> str
Parameters
| Name | Type | Description |
|---|---|---|
state |
Any |
Returns
str
recording_middleware
1
Any
▼
Create a middleware that records actions and state hashes.
recording_middleware
1
Any
▼
def recording_middleware(records: list[dict]) -> Any
Parameters
| Name | Type | Description |
|---|---|---|
records |
list[dict] |
Returns
Any
save_recording
5
None
▼
Save a session recording to JSONL.
save_recording
5
None
▼
def save_recording(path: str | Path, initial_state: Any, records: list[dict], final_state: Any, metadata: dict[str, str] | None = None) -> None
Parameters
| Name | Type | Description |
|---|---|---|
path |
str | Path |
|
initial_state |
Any |
|
records |
list[dict] |
|
final_state |
Any |
|
metadata |
dict[str, str] | None |
Default:None
|
load_recording
1
SessionRecording
▼
Load a session recording from JSONL.
load_recording
1
SessionRecording
▼
def load_recording(path: str | Path) -> SessionRecording
Parameters
| Name | Type | Description |
|---|---|---|
path |
str | Path |
Returns
SessionRecording